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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

AddRow mode in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

20892 Oct 27,2004 02:01 PM UTC Oct 27,2004 06:02 PM UTC WinForms 3
loading
Tags: GridControl
Mick Speake
Asked On October 27, 2004 02:01 PM UTC

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

Administrator [Syncfusion]
Replied On October 27, 2004 02:49 PM UTC

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";

Administrator [Syncfusion]
Replied On October 27, 2004 05:34 PM UTC

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

Administrator [Syncfusion]
Replied On October 27, 2004 06:02 PM UTC

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";

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

;