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.
ADAdministrator 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.Renderer.ControlText = "someText";
ADAdministrator Syncfusion Team October 27, 2004 01:34 PM
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?
ADAdministrator 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);
GridComboBoxCellRenderer r = cc.Renderer as GridComboBoxCellRenderer;
r.EditPart.Text = "XYZ";