Hi all.
I have a problem. I need to lookup a record in another DataTable when i do a rowinsert in a grid.
But if i create a event for RowInsert this events gets fired to many times when the grid is being populated. (I get my data from a progress db og all my data is in "dataset.tables[0]."
For instance. If i have a datatable with 5 rows in it i would like this event to be fired for each 5 rows. this does not happend. It fires this event for empty rows without any binding and when openting the form. Why? and how can i make the code so that the event only fires if valid data is to be shown?
//Create a few extra fields in my datagrid. (must be done in grid. The binding table must be untouched)
//new columns
int newIndex;
newIndex = this.dgvSelectedTable.Columns.Add("Code", "Code");
newIndex = this.dgvSelectedTable.Columns.Add("Description", "Description");
Datagrid1.DataSource = progressDataSet.Tables[0]; //this dataset has only one table with columns "ProductObj,ContractObj"
How can i prevent this event to be fired if row is empty or not binded to a table?
Thanks.