I created an application in Visual Studio (C #) that uses datagridview. Now, when I assign a DataSource to this datagridview, it automatically selects the first row and runs my code to select. Since I often reassign this data source, this is undesirable. Is there a way to change it so that it does not automatically make this first choice and is based only on user settings?
Thanks!
In response to Darshan Joshi's comment: Besides the automatically generated code, the only thing that has changed in the datagridview is to set the AutoGenerateColumns value to false and set the DataSource property. I put MessageBox.Show in my delegate with the selection selected, and it seems that it even gets thrice every time the data source is installed. Once before downloading data and twice after.
I cannot set the value to false at boot time, since the data source is installed after certain user actions, and not during initialization.
source share