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.
Syncfusion Feedback

Passing value into a parent grid cell

Thread ID:

Created:

Updated:

Platform:

Replies:

32629 Aug 4,2005 04:21 PM UTC Aug 4,2005 05:33 PM UTC Windows Forms 3
loading
Tags: GridControl
Igor Kashtelyan
Asked On August 4, 2005 04:21 PM UTC

Hello, I am having a problem of inconsistent update of a parent cell. The parent grid is a GDBD which has some cells of drop-down celltype. The drop down form contains a grouping grid with buttons OK and Cancel. When a use performs certain actions the grouping grid displays a total in a summary row. On button click the total should be displayed in a parent cell (which is int the gdbg). Sometimes, the value does not get into the parent grid. it always does it for the first time, but if a user opens the same DD and edit entered hours, the total (which is updated correctly) soed not get displayed in the parent grid - sometimes it is just the old value, but in some cases simply gets empty. I am using version 2.0.5.1 Could you please advise on how to resolve this issue. I attach a code snippet that handles OK button. Thanks. if( this.ddActivityForm.ShowDialog() == DialogResult.OK ) { this.Grid.BeginUpdate(); this.Grid.Model[rowIndex, colIndex].Text = this.ddActivityForm.TotalActivityHrs; this.Grid.EndUpdate(); this.Grid.Refresh(); }

Administrator [Syncfusion]
Replied On August 4, 2005 04:44 PM UTC

Try adding these calls: this.Grid.CurrentCell.EndEdit(); this.Grid.Binder.EndEdit(); this.Grid.BeginUpdate(); this.Grid.Model[rowIndex, colIndex].Text = this.ddActivityForm.TotalActivityHrs; this.Grid.EndUpdate(); this.Grid.Refresh(); to see if this will resolve this problem. When the currentcell is editing, setting a value into the style does not necessarily affect the actively editing value. The idea is to make sure teh currentcell is not actively editing when you try to set its value.

Igor Kashtelyan
Replied On August 4, 2005 04:59 PM UTC

Sorry, Clay, It is not working...Binder is not even a public property of a Grid in this case... What would be the right way to pass a value into a parent cell in general? May be I will be able to modify original code to update the parent cell?... Thanks. >Try adding these calls: > > >this.Grid.CurrentCell.EndEdit(); >this.Grid.Binder.EndEdit(); > > >this.Grid.BeginUpdate(); >this.Grid.Model[rowIndex, colIndex].Text = this.ddActivityForm.TotalActivityHrs; >this.Grid.EndUpdate(); >this.Grid.Refresh(); > >to see if this will resolve this problem. When the currentcell is editing, setting a value into the style does not necessarily affect the actively editing value. The idea is to make sure teh currentcell is not actively editing when you try to set its value.

Administrator [Syncfusion]
Replied On August 4, 2005 05:33 PM UTC

>>Binder is not even a public property of a Grid in Is this Grid, the Grid property of the renderer class? If so, you can cast it to a GridDataBoundGrid provided the parent grid is a GridDataBoundGrid. Normally, in a derived renderer, you override OnSaveChanges, and there you set Grid.Model[RowIndex, ColIndex] to be the changed value. To make sure OnSaveChanges is called, make sure the CurrentCell.IsModified is set true when the value changes in your renderer. I think this is what the dropdownusercontrol sample we ship uses. Since this is a GridDataBoundGrid, you also have teh option of trying to set teh value directly into the DataSource if you know enough about it.

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.

Warning Icon 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.Close Icon

;