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

checkbox and null values

Thread ID:





18606 Sep 3,2004 11:00 AM UTC Sep 3,2004 12:07 PM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On September 3, 2004 11:00 AM UTC

Im using GridDataBoundGrid with DataTable as datasource. One of the field of datatable has bool datatype and doesn''t allow null. I connected this field to checkbox in grid. If I press "del" on keybord and move to another row I get exception. Where can I handle this exception without loosing form? For example I can use string data type for field and textbox as style for column and I will receive normal message from grid, without any exception and loosing form. What am I doing wrong? I''m using such code for checkbox: GridBoundColumn col; col=new GridBoundColumn(); col.HeaderText="Import"; col.MappingName="bIsImport"; col.StyleInfo.CellType = "CheckBox"; col.StyleInfo.CellValueType = typeof(bool); col.StyleInfo.CheckBoxOptions = new GridCheckBoxCellInfo(true.ToString(), false.ToString(), "", true);

Administrator [Syncfusion]
Replied On September 3, 2004 12:00 PM UTC

We will try to fix this. Until we have a release with it corrected, you can avoid the problem by handling grid.Model.ClearingCells and cancel the clearing if your user is trying to delete the checkbox column. You could also display a message there or you could do some special action like setting the checkbox to false in teh handler (to simulate clearing them).
this.gridDataBoundGrid1.Model.ClearingCells += new GridClearingCellsEventHandler(Model_ClearingCells);
//the handler
private void Model_ClearingCells(object sender, GridClearingCellsEventArgs e)
		e.Handled = true;

Administrator [Syncfusion]
Replied On September 3, 2004 12:07 PM UTC

thank you


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