0
votes

I am changing datasource which is a list with radiobutton change , but the data of row from old datasource is getting overlapped in the first selected row of the datagridview. it gets clear when new row is selected. I have set selection back colour of row and header to transparent.

enter image description here datagridview row is overlapped here with old datasource data.

private void rb_allmat_CheckedChanged(object sender, EventArgs e)
    {
        if (rb_allmat.Checked) // radiobutton checked.
        {
            dataGridView1.ClearSelection();
            dataGridView1.DataSource = null;
            dataGridView1.DataSource =  
CommonClass.ListofthresholdIndication; // this is a list that is to be displayed.
dataGridView1.Update();
            dataGridView1.Refresh();
            colorchange();
            changecolorofheader(); 
        }
1
Please share the code in the question itself instead of image of the code. - Chetan
you need to share the code in the question. Not in comment... - Chetan
pardon. I am new here. i have shared my code. - prabuddha R. shrestha

1 Answers

0
votes

use datagridview1.Rows.Clear()