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

drop downs

I''m using the newest version of your grid. I have a drop down menu as a column in a summary row. How can my code access the new value of the cell (i.e.: the value the user changed the cell to from the drop down choices)? I''m trying to access it during the grid_TableControlCurrentCellCloseDropDown event. I also notice that when the user tries to change a value in a drop down the value in the cell does not change. How can I correct this problem? Thanks.

5 Replies

AD Administrator Syncfusion Team January 25, 2005 07:11 PM UTC

Anthony, you can get the current cell value from e.TableControl.CurrentCell.Renderer.ControlValue or the display text: e.TableControl.CurrentCell.Renderer.ControlText if you want to commit pending current cell changes into the underlying cell style you could call e.TableControl.CurrentCell.ConfirmChanges(); Stefan


AA Anthony Avella January 26, 2005 02:32 PM UTC

I''m having a problem with the summary cell updating with the new value. After the first change in the combobox, the value does not change. When I change it a second time, the first change appears in the summary cell. How do I correct this?? Here is the code I''m using in the event handler: if(gs.TableCellIdentity.DisplayElement is CustomCaptionRow) { strColumnName = gs.TableCellIdentity.SummaryColumn.DataMember; objNewCellValue = e.TableControl.CurrentCell.Renderer.ControlValue; //the commented out function call updates the detail rows under this summary row for this column //UpdateGroupDetailRecords(gs.TableCellIdentity.DisplayElement.ParentGroup, strColumnName, objNewCellValue); e.TableControl.CurrentCell.Renderer.StyleInfo.CellValue = e.TableControl.CurrentCell.Renderer.ControlText; e.TableControl.CurrentCell.ConfirmChanges(true); } Thanks. >Anthony, > >you can get the current cell value from > >e.TableControl.CurrentCell.Renderer.ControlValue > >or the display text: > >e.TableControl.CurrentCell.Renderer.ControlText > >if you want to commit pending current cell changes into the underlying cell style you could call > >e.TableControl.CurrentCell.ConfirmChanges(); > >Stefan >


AD Administrator Syncfusion Team January 26, 2005 04:12 PM UTC

Does e.TableControl.CurrentCell.Renderer.ControlText; return the correct value? You could add a Console.WriteLine and check it. The line e.TableControl.CurrentCell.Renderer.StyleInfo.CellValue = e.TableControl.CurrentCell.Renderer.ControlText; is not needed. You only need e.TableControl.CurrentCell.ConfirmChanges(true); Once you call ConfirmChanges your SaveCellInfo handler should be hit and in that handler you should then save the value in your custom array that you have implemented in your group. Stefan


AA Anthony Avella January 26, 2005 04:42 PM UTC

Yes it does return the correct value. I did not notice before (because I didn''t try to do it) that when I leave the summary cell after changing the value, the correct (new) value appears in the cell when it should. How can I make this happen without leaving the cell? >Does > >e.TableControl.CurrentCell.Renderer.ControlText; > >return the correct value? You could add a Console.WriteLine and check it. > >The line >e.TableControl.CurrentCell.Renderer.StyleInfo.CellValue = e.TableControl.CurrentCell.Renderer.ControlText; > >is not needed. You only need > >e.TableControl.CurrentCell.ConfirmChanges(true); > > >Once you call ConfirmChanges your SaveCellInfo handler should be hit and in that handler you should then save the value in your custom array that you have implemented in your group. > > >Stefan >


AD Administrator Syncfusion Team January 26, 2005 06:16 PM UTC

e.TableControl.CurrentCell.ConfirmChanges(true); or e.TableControl.CurrentCell.EndEdit() will force saving the ControlText into the underlying style and your SaveCellInfo handler should get hit. Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon