In my WinForms I have DataGridView
. I wanted to select full row at once so I set SelectionMode
as FullRowSelect
. And now I have problem, b
If this is because it raised unwanted GridView1_SelectionChanged event on initial loading, you can use a flag to handle this
public partial class YourFormName
{
private bool IsReady= false;
private void YourFormName_Load(object sender, EventArgs e)
{
//Load your GridView1...
//Format your GridView1...
IsReady = true;
}
void GridView1_SelectionChanged(object sender, EventArgs e)
{
if (!IsReady)
return;
//do the rest of the stuffs
}
}