General information
Category:
The Mere Mortals .NET Framework
Kevin,
The DataGridView binding is ok. I checked it carefully and did somne tests and found this:
I have the DataGridView object bound to the Biz object, and after Initialize I can call the "GetAllRows" method and it works fine so I get the grid populated with all rows form the databasse table.
But if after that I call the same metodo again (let's say using a any event like a combo SelectedIndexChanged and call the same "GetAllRows" method) I get the error that I reported earlier:
Please notice that I am using the same object method on the already bind grid that worked well just before.
So in order to be more cleara let me show you the code I used to run my test:
public CellDevicesListForm()
{
this.oCellDevice = (CellDevice)this.RegisterBizObj(new CellDevice());
InitializeComponent();
this.oCellDevice.GetAllCellDevices();
this.dgvCellDevices.AutoGenerateColumns = false;
}
private void tscTCellDeviceTypeName_SelectedIndexChanged(object sender, EventArgs e)
{
this.oCellDevice.GetAllCellDevices();
}
Note: When I run the application the form shows the grid with all my rows. After that I change the selection in the combo box just to generate the event.
When the combo event code run I get the following error:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
and the stack trace is the one I already sent you.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only