I will do my best to explain this senario.
I am using an UltraGrid to display data of which I will have no knowedge of at run time. I am parsing an xml file that will create a list of queries and their relations.
when I run through this squence of events the child bands do not display. Is it possible to add child data to the UltraGrid and display it? Am I doing this out of order somehow? Does the data have to be there before the expand event fires? Can I get any alternate suggestions? My biggest problem seems to be that Data is completely dynamic.
I seem to recall an issue that was fixed a while ago regarding populating the child band in the BeforeRowExpanded event, so depending on your version this may be the same issue. I hacked together a quick test, which seemed to work for me:
private static DataTable GetTable(){ DataTable dt = new DataTable(); dt.Columns.Add("Col 1", typeof(string)); dt.Columns.Add("Col 2", typeof(int)); dt.Columns.Add("Col 3", typeof(decimal)); dt.Columns.Add("Col 4", typeof(bool)); dt.Columns.Add("Col 5", typeof(DateTime)); for (int i = 0; i < 30; i++) { dt.Rows.Add(new object[] { "Row " + i.ToString(), i, i * 1.234m, i % 2 == 0, DateTime.Now.AddYears(i) }); } return dt;}public Form1(){ InitializeComponent(); DataSet ds = new DataSet(); DataTable dt = GetTable(); DataTable dt2 = new DataTable(); dt2.Columns.Add("Col 1"); ds.Tables.Add(dt); ds.Tables.Add(dt2); ds.Relations.Add(dt.Columns[0], dt2.Columns[0]); this.ultraGrid1.DataSource = ds;}private bool hasPopulatedChildBand;private void ultraGrid1_BeforeRowExpanded(object sender, Infragistics.Win.UltraWinGrid.CancelableRowEventArgs e){ if (this.hasPopulatedChildBand) return; DataTable dt = ((DataSet)this.ultraGrid1.DataSource).Tables[1]; dt.Columns.Add("Col 2", typeof(int)); dt.Columns.Add("Col 3", typeof(decimal)); dt.Columns.Add("Col 4", typeof(bool)); dt.Columns.Add("Col 5", typeof(DateTime)); for (int i = 0; i < 30; i++) { dt.Rows.Add(new object[] { "Row " + i.ToString(), i, i * 1.234m, i % 2 == 0, DateTime.Now.AddYears(i) }); } this.hasPopulatedChildBand = true;}
Is this roughly the same approach that you described (ignoring how you're getting your data, since that shouldn't be relevant)? I add a column and the DataRelation at first, but no data, and populate the child band once I try to expand a row. When I do this, the child data correctly shows up. If my approach is the same, then you should try to download the latest service release to see if the issue is resolved in your application.
-Matt
Yes, this almost look like my code, but I am still not showing the child data. I have checked the datasource while debugging and the updates are there in the table. Plus the child band reflects the changes to the columns, but when I check the cells in the row of the child band, its value is null.
I am already using the 2009.1 trial addition.