how to make datagridview not select automatic

Maurício Seabra

New member
Joined
May 19, 2020
Messages
1
Programming Experience
1-3
Guys good morning can someone help me: language C # windows form in datagridview.Rows.Add (); the line is selected. But I have a SelectChange event that runs. In my case a datagridview loads data in another 4 datagridview so with each new load the selection changes and loads 6 more datagridview tables is very heavy. I need insert row without selecting?
 
Last edited:

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
1,227
Location
Virginia Beach, VA
Programming Experience
10+
Perhaps you need to show us exactly how you are adding items to your master DataGridView. It's been a while, but I don't recall the DataGridView firing selection change events when items are added into it.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,860
Location
Sydney, Australia
Programming Experience
10+
If adding a new row really does select it automatically then maybe the fault is in the code that populates the other grids. Who says you can use an if there to not load data if the first grid has a new row selected?
 
Top Bottom