2
Answers

Problem with DataGrid control

Administrator

Administrator

22y
6.6k
1
I have a big problem with this control. I have this message when I click an a row header of the DataGrid (No event are bind to the DataGrid so this error is only due to the control itself and not my code). System.IndexOutOfRangeException: index out of range. at System.Windows.Forms.DataGrid.Edit(String instantText) at System.Windows.Forms.DataGrid.Edit() at System.Windows.Forms.DataGrid.OnEnter(EventArgs e) at System.Windows.Forms.Control.NotifyEnter() at System.Windows.Forms.ContainerControl.UpdateFocusedControl() If someone known this problem and have a solution it will make me happier :) Thx.
Answers (2)
0
Administrator
Admin 2.3k 1.3m 22y
I have bind a dataset to the DataGrid. this.dGCampagne.DataSource = this.dSCampaign; this.dGCampagne.DataMember = "Campaign"; It works really very fine but when I have only 1 datarow in the DataSet sometimes I have this error but not all the times. When I have more than 1 datarow there is no problem ! I think it's the control because I really don't see in my code where is the problem, the DataBinding is Ok. And as I say I have bind no event to the DataGrid to see if it can help me.
0
Administrator
Admin 2.3k 1.3m 22y
What data have You bind to DataGrid? What's Your code?