I am working with the DataGridView in VB.Net2005. I am having problems with the way that it loads and displays the data. I have added it to my form and set several properties at design time and runtime, however the column and row headers are not displaying properly when I set my datasource and the data loads twice before it displays, causing a huge load time (with large numbers of rows). Here are my questions:
1. Why does the datagridview load the data twice when I set dgv.Datasource = datatable? Is there a better way to load all of my data? Is there a setting I can set to keep this from happening? This is causing a horrible load time when I have several thousand records, and this is a small set for me.
2. Why won't the column headers use the defaultColumnHeaderStyle? I have tried setting values for this both at design time and runtime and I still cannot get it to work. I would like my column headers alignment = centered, but it will only display left justified. I have tried catching several events and putting code in, but still nothing will change it.
3. Why won't the row headers display their value? I need to display the row number in the row header and so I have tried setting the row header value and the changing the forecolor, but still the value will not be displayed.
Thanks,
mHos
1. Why does the datagridview load the data twice when I set dgv.Datasource = datatable? Is there a better way to load all of my data? Is there a setting I can set to keep this from happening? This is causing a horrible load time when I have several thousand records, and this is a small set for me.
2. Why won't the column headers use the defaultColumnHeaderStyle? I have tried setting values for this both at design time and runtime and I still cannot get it to work. I would like my column headers alignment = centered, but it will only display left justified. I have tried catching several events and putting code in, but still nothing will change it.
3. Why won't the row headers display their value? I need to display the row number in the row header and so I have tried setting the row header value and the changing the forecolor, but still the value will not be displayed.
Thanks,
mHos