DataGridViewCheckBoxColumn as a Check Box
Hi,
I have a DataGridView in my designer with
Column1 as DataGridViewCheckBoxColumn and
Column2 as DataGridViewCheckTextColumn.
DataGridViewCheckBoxColumn should work as a CheckBox i.e. multiple selections are not allowed.
I tried to handle it in EventHandler but of no use.
if I try to click a second check box when one is already checked getting the following error.
---------------------------
DataGridView Default Error Dialog
---------------------------
The following exception occurred in the DataGridView:
System.FormatException: Checked is not a valid value for Boolean. ---> System.FormatException: String was not recognized as a valid Boolean.
at System.Boolean.Parse(String value)
at System.ComponentModel.BooleanConverter.ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, Object value)
--- End of inner exception stack trace ---
at System.ComponentModel.BooleanConverter.ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, Object value)
at System.Windows.Forms.Formatter.FormatObjectInterna l(Object value, Type targetType, TypeConverter sourceConverter, TypeConverter targetConverter, String formatString, IFormatProvider formatInfo, Object formattedNullValue)
at System.Windows.Forms.Formatter.FormatObject(Object value, Type targetType, TypeConverter sourceConverter, TypeConverter targetConverter, String formatString, IFormatProvider formatInfo, Object formattedNullValue, Object dataSourceNullValue)
at System.Windows.Forms.DataGridViewCell.GetFormatted Value(Object value, Int32 rowIndex, DataGridViewCellStyle& cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)
To replace this default dialog please handle the DataError event.
---------------------------
OK
---------------------------
Any help in this context how I can suffice my aim are appreciated.
Thanks & Regards,
Supriya
|