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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Row\Cell validation in GDBG

Thread ID:





21788 Nov 21,2004 02:57 PM UTC Nov 21,2004 04:41 PM UTC WinForms 1
Tags: GridControl
Gil Kalo
Asked On November 21, 2004 02:57 PM UTC

In GDBG, 1.How can I validate new row before I leave it? Is there a way on "RowLeave" event to ask the grid if the row is valid? 2.Is there a way to remove a new record programmaticly from a grid if "EnableRemove=false"? I don''t want to allow users to remove record from the grid, but if the row is not valid, I would like to remove it! 3.If cell validate is failed, is there a way to get the error message progrmmaticly, and override the default behaviour(A pop up message is displayed) of the grid? Thanks, GilK

Administrator [Syncfusion]
Replied On November 21, 2004 04:41 PM UTC

1) As far as whether cell entries are the proper type (like trying to type ABC into a double cell), the grid''s default behavior is to do this validation on a cell by cell basis for you. So, in RowLeave, the row is always valid (except possibly for the last cell modified - but that will be validated as part of the RowLeave.) Now if you want to do special validation (something other than the default system type checks), then you can do that is RowLeave. But the grid would not know whether the row was valid of not, you would have to add whatever code you needed to test whethee the row is valid. 2) To delete a record, you can try: int pos = this.gridDataBoundGrid1.Binder.RowIndexToPosition(this.gridDataBoundGrid1.CurrentCell.RowIndex); this.gridDataBoundGrid1.CurrentCell.EndEdit(); this.gridDataBoundGrid1.Binder.RemoveRecords(pos, pos); 3) You can handle the grid.ValidateFailed event. In the handler, you can set grid.CurrentCell.ErrorMessage to your string to see your message, or you can set it to the empty string to see no message from teh grid.


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon