I have used the ultragrid extensively in my application, but have only now come accross these two issues:
Issue 1 :
I have 2 grids on the same windows usercontrol contained in 2 panels.
Each is bound to a different datatable in the same dataset.
I populate my dataset then .DataSource = dataset.datatable and .DataBind() each grid.
I am using a fixed add row at the top of each grid. When I add a record to the first grid, the new record reflects in the corresponding source datatable. But if I then go to the second grid to add a row there the new record does not appear in the datatable. But on the second try the record appears. Jump back to the first grid the same happens: the first row is not added to the datatable, but the second one is
I have 2 grids on other forms in my app as well with no issues. What is the problem? It seems like some kind of focus problem?
Issue 2:
Another of my grids has a cell button column, a string column with a valuelist attached, a string column, then a double column using a numericeditor. When I click on the button a modal form pops up from which a selection is made, then values are populated into the 2 string columns of my grid (I tried using both .value = and .Setvalue() ). If I then press enter to add the record is does not get added to my datasource datatable. It only gets added if (either manually or in code) edit the double column of my grid. Please advise as to what the cause could be
armandsmit said:It seems like some kind of focus problem
You could be right about this. UserControls have had many focus issues in DotNet in the past. When you leave a UserControl, you don't always get all the Leave or LostFocus events that you would expect, so this could certainly be causing an issue.
If you can duplicate the problem in a small sample project, the best thing to do is Submit an incident to Infragistics Developer Support so they can check it out.
Mike
My second issue is solved using ".ActiveRow.ParentCollection.AddRowModifiedByUser = true;". Thanks.
My first issue persists though. I will try to replicate the problem in a project, but interesting to note that
those grids' ".ActiveRow.ParentCollection.AddRowModifiedByUser" are both true without my intervention, but
still do not add the rows. The only way they are related is that both their datasources come from the same
dataset, but different data tables. The data contained in the tables are also unrelated. Neither contain relations to other tables or anything like that.
I will attach the project shortly if I don't achieve any success
Hi,
1) Are the two tables related? I can't see any reason why this would happen. Can you duplicate this in a small sample project?
2) The cells in the fixed add row are probably not marked dirty unless modified by the user. But I think you can force. What you do is set the AddRowModifiedByUser property on the rows collection to true. So if you have the row, you would do something like this:
row.ParentCollection.AddRowModifiedByUser = true;