Null Column Error while binding Grid.

Hi, I am binding Essential Grid with my DataTable source. This datatable source has some Blank(Null) values in specific columns for certain rows while other rows has value for that column. I am able to loop through datatable but when i try bind to Grid control it is giving error. Code Snippet:- ----------------- Dim test As New ReportData Trace.Warn("Report Count : " & test.BindData(dtReportList, dtMyReportList, Utilities.REP_TYPE.Datatable).Rows.Count) Dim dt As DataTable = test.BindData(dtReportList, dtMyReportList, Utilities.REP_TYPE.Datatable) Trace.Warn("Report Row Count : " & dt.Rows.Count) Trace.Warn("Report Column Count : " & dt.Columns.Count) Dim j As Integer = dt.Rows.Count Dim k As Integer = dt.Columns.Count Dim i, l As Integer For i = 0 To j - 1 For l = 0 To k - 1 Trace.Warn(dt.Rows(i)(l)) Next Next Me.GridGroupingControl1.DataSource = dt Me.GridGroupingControl1.DataBind() =================================== Error Msg :- "Value cannot be null. Parameter name: viewName " Stack Trace: [ArgumentNullException: Value cannot be null. Parameter name: viewName] System.Web.UI.DataSourceView..ctor(IDataSource owner, String viewName) +2038891 System.Web.UI.WebControls.ReadOnlyDataSource.System.Web.UI.IDataSource.GetView(String viewName) +65 System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +226 System.Web.UI.WebControls.DataBoundControl.OnLoad(EventArgs e) +16 Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.OnLoad(EventArgs e) +114 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061 Regards, Manoj Singh

1 Reply

AD Administrator Syncfusion Team June 29, 2006 06:18 PM UTC

Hi Manoj, This error is because of our ''GridGroupingControl'' expects its DataMember to be set to a valid value. so you will have to specify DataMember="DefaultView" in your code as follows. [vb] Me.GridGroupingControl1.DataMember = "DefaultView" This can also be null value in our upcoming versions and will not be mandatory there after. Regards, A.Sivakumar

Loader.
Up arrow icon