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

GridGroupingControl: Unhandled exception in control.

Hello. This can be simply repeated by samples provided with suite. Using Essential Grid Samples Custom Summary sample. Start to fill new row and specify values only for first 2 columns, then press header (as to resort by column), message about NULLs not alowed appears, then press column second time. Exception occures: ************** Exception Text ************** System.InvalidCastException: Object cannot be cast from DBNull to other types. at System.DBNull.System.IConvertible.ToDouble(IFormatProvider provider) at System.Convert.ToDouble(Object value) at CustomSummary.Form1.Table_QueryCustomCount(Object sender, CustomCountEventArgs e) at Syncfusion.Grouping.Table.OnQueryCustomCount(CustomCountEventArgs e) at Syncfusion.Grouping.Record.GetCustomCount()

2 Replies

AD Administrator Syncfusion Team June 23, 2004 05:40 AM

By the way, how to disable the feature (header sorting) for whole control.


AD Administrator Syncfusion Team June 24, 2004 11:22 AM

Hi Vadim, thanks for reporting the problem with the exception when clicking twice on the column header. This is a bug and we''ll get that fixed. Regarding the question how to disable clicking on the column header try this: this.gridGroupingControl1.TableControlCellClick += new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCellClick); private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e) { Element el = e.TableControl.Table.DisplayElements[e.Inner.RowIndex]; if (el is ColumnHeaderRow) e.Inner.Cancel = true; }

Loader.
Live Chat Icon For mobile
Up arrow icon