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.
Unfortunately, activation email could not send to your email. Please try again.

error with add new row in gridDatabounGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

11386 Mar 4,2004 08:15 AM Mar 5,2004 08:18 AM Windows Forms 5
loading
Tags: GridControl
Jaris
Asked On March 4, 2004 08:15 AM

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

Administrator [Syncfusion]
Replied On March 4, 2004 10:21 AM

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.

Administrator [Syncfusion]
Replied On March 5, 2004 12:20 AM

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

Administrator [Syncfusion]
Replied On March 5, 2004 03:33 AM

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.

Jaris
Replied On March 5, 2004 05:28 AM

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

Administrator [Syncfusion]
Replied On March 5, 2004 08:18 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;