Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
No datarows showing in WebDataGrid
posted

Hi I am new to using the Infragistics controls, just trying out with the WebDataGrid.

I am dynamically populating the WebDataGrid by setting the DataSource to a asp:DataTable.

Assembly Version - Infragistics35.Web.v10.3, Version=10.3.20103.1013

DataTable dataTable;

dataTable = CreateColumns(xmetadatadoc, dataTable);     //Dynamically populates the columns
dataTable = BuildDataSource(xresultsdoc, dataTable);    //Dynamically populates the rows

webDataGrid.DataSource = dataTable;
webDataGrid.DataBind();

After the databind, I see no records showing in the page. Only the header and footer rows are shown.

Can someone help with this?

  • 315
    Verified Answer
    posted

    I got it working now. I missed populating the Columns into the WebDataGrid control. Hope this helps someone....

    DataTable dataTable;

    dataTable = CreateColumns(xmetadatadoc, dataTable);     //Dynamically populates the columns


    for (int i = 0; i < dataTable.Columns.Count; i++)        //Populate DataTable columns into WebDataGrid
       {
             this.AddColumns(dataTable)                              //AddColumn is provate method loops through all columns in the dataTable and adds them as BoundDataField to the WebDataGrid
       }

    dataTable = BuildDataSource(xresultsdoc, dataTable);    //Dynamically populates the rows

    webDataGrid.DataSource = dataTable;
    webDataGrid.DataBind();