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

AddRow mode in GDBG

Is there a way to put a GDBG into "adding a new row mode" other than by adding a row to the underlying DataView? Adding a row to the DataView does not allow the user to Escape out of the row as they can do if adding a row by typing. My application allows the user to select a new code from a drop down grid by clicking on a dummy button in a cell. This action does not trigger "new row mode" like typing into a cell or selecting from a combox cell. So I have to add a row to the dataView before I can put the selected code into the grid. Regards, Mick

3 Replies

AD Administrator Syncfusion Team October 27, 2004 10:49 AM

Try this to see if it does what you need. The idea is to move to the AddNewRow and set some cell there current and put the value into the Renderer (as if the user typed it.). GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; cc.MoveTo(this.gridDataBoundGrid1.Model.RowCount, 1, GridSetCurrentCellOptions.SetFocus); cc.BeginEdit(); cc.Renderer.ControlText = "someText";


AD Administrator Syncfusion Team October 27, 2004 01:34 PM

Hi Clay, Thanks for the idea but I cannot get text into the dummy cell. I''ve enclosed a small mock-up off what I''m trying to do. In essence, I use a combobox celltype to trigger getting data from elsewhere (a modal form containing a GDBG like the example in forum_6587 which I''ve not included) The combobox cell renderer will only accept data supplied via the dataset. Any more ideas? test_7648.zip


AD Administrator Syncfusion Team October 27, 2004 02:02 PM

This code worked for me in your CellClicked handler without throwing an exception. GridCurrentCell cc = grid.CurrentCell; cc.MoveTo(e.RowIndex, e.ColIndex, GridSetCurrentCellOptions.SetFocus); cc.BeginEdit(); GridComboBoxCellRenderer r = cc.Renderer as GridComboBoxCellRenderer; r.EditPart.Text = "XYZ";

Loader.
Live Chat Icon For mobile
Up arrow icon