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
375
Ultragrid will not display data
posted

I have manually defind a schema for a grid and specified that it will be bound at runtime. At runtime I fill a data table using a SQL statement being sure that the grid column keys match the data field names and then set the grid datasource to the datatable with the SetDataBindings method. I have also tried just setting the datasource. After the datasource is set, I can query the rows and columns of the grid in the immediate window and they contain data, the row count for the grid is correct and the keys and captions are correct. The problem is that all that displays on the grid is a blue background. No columns and no data.

I'm an old vb6 coder but new to .NET and the Ultragrid control so I assume I missed something in the setup. Can someone help, please?

 

 

Parents
  • 469350
    Offline posted

    If the grid is showing no columns, then it's not able to get a structure from the data source. That seems very odd if you are binding to a DataTable.Even if the data structure you defined at design-time did not match up to the DataTable you are binding to at run-time, what would happen is that the grid would throw away the design-time layout in favor of it's new data source. So if the grid is completely blank, then the only way that could happen is if the DataTable has no columns.

    The only other way that this could happen that I can think of is that you turned off the grid's painting by calling BeginUpdate on the grid and you never called EndUpdate.

    Have you tried binding the same DataTable to the DataGridView control? If not, it might be worth trying it just to see what happens.

     

Reply Children