We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

error with add new row in gridDatabounGrid

I have two gridDataboudGrids. First grid is master for second grid. Both grids have property EnableAddNew set to true. Second grid shows data when I choose one row in first grid and I enter in second grid. Or I do double click in first grid. When I want add new row in second grid and I fill first field in new row then I load data to next fields. Then another row is added to grid and that is wrong. This doesn''t happen always. Help mi, please. I send example. WindowsApplication27_1469.zip

5 Replies

AD Administrator Syncfusion Team March 4, 2004 03:21 PM UTC

I am having a difficult time running the sample. I had to add calls to grid.Binder.OptimizeListChangedEvent to all your grids, or else the code throw exception in the InitializeConponent code. What version of our libraries are you running? Anyway, once I coudl get teh grids to display, I could never leave teh first row of the top grid even though the first cell was occupied. I worked around that problem by adding a cc.IsEditing check to both your RowLeave handlers. //pnr if (cc.IsEditing && cc.Renderer.ControlText.Trim().Length == 0) and //kbnr if (cc.IsEditing && cc.Renderer.ControlText.Trim().Length == 0){ Once that was done, I was able to click arond the top grid and then click to the bottom grid and see the row added. One other thing I saw was that you had code like cc.Renderer.ControlText = ""; cc.CancelEdit(); when you set e.Cnacel = true in currentcellvalidating. Noramlly, you would not do this. You would only set e.Cancel = true, and then the grid should take you back to the cell with it exactly as it was when you tried to leave it.


AD Administrator Syncfusion Team March 5, 2004 05:20 AM UTC

Sorry that I didn''t write version. Our version is 1.6.1.0. And I send this sample with libraries of syncfunsion. There isn''t event grid.Binder.OptimizeListChangedEvent in our version WindowsApplication27_4214.zip


AD Administrator Syncfusion Team March 5, 2004 08:33 AM UTC

Is there some reason you are not using the 1.6.1.8 version that is available through Direct Trac from your support home page on our website? I keep getting exception thrown in your code. For example, in your gbgPNROverview_CurrentCellMoved handler, why are you indexing this.gbgPNROverview with cc.RowIndex when cc.RowIndex is the value from the currentcell in the this.gbgKBNR grid. Do you expect the rows in gbgPNROverview to always be as many as there are in gbgKBNR? I do not see this. If I bring up your sample, and click on row 2 of the top grid, and then click on the first empty row in the bottom grid, I see an exception thrown at this point because there are not 2 rows in the bottom grid. To handle the above exception, I assumed you wanted cc to point to teh current cell on teh bottom grid when you were setting the values. Making this change allowed the clicked row in the bottom grid to be populated without adding a two empty rows.


JA Jaris March 5, 2004 10:28 AM UTC

Thank you very much, my mistakes, I''m sorry. I corrected my code and I have problem. When I enter new row in bottom grid and I fill first field and I move to field ''cena'',then I press key Up arrow, new row is created in bottom grid. It is wrong. We don''t use version 1.6.1.8 because when we installed this version, it didn''t work right. There were exceptions in aplication, probably caused by licence. thank you


AD Administrator Syncfusion Team March 5, 2004 01:18 PM UTC

In 1.6.1.0, I see an exception being thrown saying "Column ''PnrID'' does not allow nulls." when I do what you described. This problem does not occur for me in 1.6.1.8. No exception is thrown, and the extra row does not get added. If you are getting a license violoation error when you try to use 1.6.1.8, here is a link that should explain how you can correct it. http://www.syncfusion.net/squiffler/patches/v1618/lic_update.htm

Loader.
Live Chat Icon For mobile
Up arrow icon