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
830
Grid "cloning"
posted

For  a purpose of Copy to clipboard or export to excel, I need to create a grid and set it's data source from a DataTable.

The problem I'm facing is that after I do: ultraGrid.DataSource = dt  then the ultraGrid.Rows.Count still return 0.

It's like the grid is ignoring my data source.

For the testings that I've done, I can make it use my data source only if I add the ultraGrid to the form (this.Controls.Add(ultraGrid).

This is off course not what I need.

 

How can I force the ultraGrid that I create on runtime to accept my data source?

 

Thanks.

Parents
No Data
Reply
  • 17259
    Verified Answer
    Offline posted

    It's eccepting it, but since it has no display, rows are not being created. I tried some refreshing methods and saw that grid.Rows.ExpandAll(true) can do the work.

Children