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
250
Forcing UltraWinGrid to update
posted

Hello,

 I'm populating an UltraWinGrid with a DataSource:

sourceDataTable = new DataTable("Client");
OleDbDataAdapter adaptation = new OleDbDataAdapter("select * from Client", strConn);
adaptation.Fill((System.Data.DataTable)sourceDataTable);

this.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.memberGrid)).BeginInit();
 this.memberGrid.DataSource = ((System.Data.DataTable)sourceDataTable);
((System.ComponentModel.ISupportInitialize)(this.memberGrid)).EndInit();
this.ResumeLayout(false);

And then immediately afterwards, I want to group by a particular column:

this.memberGrid.DisplayLayout.Bands[0].SortedColumns.Add("Surname", false, true);

This fails. My debugger shows that this.memberGrid.Rows.Band.Columns.Count evaluates to 0. However, after some "time", the UltraWinGrid is succesfully populated by the the datasource.

How can I force the UltraWinGrid to be populated by the DataSource? Is there something that I'm forgetting?

 Thanks in advance,

Indika

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    There's really not much here to go on. This could be caused by any number of things. Is the grid on a form? 

    The best thing to do would probably be to add the sorted column in the InitializeLayout event. 

Children