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

checkbox and null values

Thread ID:

Created:

Updated:

Platform:

Replies:

18606 Sep 3,2004 07:00 AM Sep 3,2004 08:07 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 3, 2004 07:00 AM

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 08:00 AM

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).
//subscribe 
this.gridDataBoundGrid1.Model.ClearingCells += new GridClearingCellsEventHandler(Model_ClearingCells);
		
//the handler
private void Model_ClearingCells(object sender, GridClearingCellsEventArgs e)
{
	if(e.RangeList.AnyRangeIntersects(GridRangeInfo.Col(2)))
		e.Handled = true;
}

Administrator [Syncfusion]
Replied On September 3, 2004 08:07 AM

thank you

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.

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.

;