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

OnValidating event in a combobox added to a GDBG cell

Thread ID:





44295 May 19,2006 10:52 AM UTC May 22,2006 07:42 AM UTC WinForms 2
Tags: GridControl
Asked On May 19, 2006 10:52 AM UTC

Hi, I have a GridDataBoundGrid and i want to use a particular Combobox (inherited from System.Windows.Forms.ComboBox) to edit the value of one of the comlumns. Since i want the combobox (which is binded to a field of the GDBG datasource) only to be shown when the row is being edited i use this code in Model_QueryCellInfo event: if (e.RowIndex == iRowBeingEdited && e.ColIndex == 1){ e.Style.CellType = "Control"; e.Style.Control = cboSubcuentas; cboSubcuentas.Visible = true; } else e.Style.Control = null; My problem is that i have overriden combo''s OnValidating event, but when i leave the cell this event doesn''t get triggered. Am i doing anything wrong? I use VS2005 and version Thanks in advance.

Administrator [Syncfusion]
Replied On May 19, 2006 12:55 PM UTC

Hi Borja, You need to handle grid''s CurrentCellValidating event for validating the Control cell type. But it does n''t fire internally. You need to handle CurrentCell.IsModified flag properly. Without setting the CurrentCell.IsModified = true, your saveCellInfo is not called when you leave the cell the control which means your changes were not being saved in the grid. SaveCellInfo event fires the CurrentCellValidating Event. Please try this code in CurrentcellMoving Event. private void gridDataBoundGrid1_CurrentCellMoving(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellMovingEventArgs e) { GridCurrentCell cc =this.gridDataBoundGrid1.CurrentCell; if(cc.RowIndex == 1 && cc.ColIndex == 1) { cc.IsModified = true; } } private void gridDataBoundGrid1_CurrentCellValidating(object sender, System.ComponentModel.CancelEventArgs e) { //Validate the comboBox here. MessageBox.Show(e.ToString()); } Here is a sample. http://www.syncfusion.com/Support/user/uploads/dataBoundCombo_a138d1cf.zip Let me know if you have any more questions. Regards, Haneef

Replied On May 22, 2006 07:42 AM UTC

Thank you Haneef, it''s a little bit tricky, but it worked. I''ve seen the attribute IsModified in other posts, but i haven''t realized its right use. I have a few more questions, but, probably, it would be better to create new posts (since are not related to this one). Thank you again.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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