Hey,
I have this event for binding child grid to the row which is clicked to expand.
void whdgData_RowIslandsPopulating(object sender, ContainerRowCancelEventArgs e) { e.Cancel = true;
int ID = Convert.ToInt32(e.Row.DataKey[0]); DataView dvTest = new DataView(dsData.Tables["Details"], "ID ="+ID, "", DataViewRowState.CurrentRows);
ContainerGrid childGrid = new ContainerGrid(); e.Row.RowIslands.Add(childGrid);
childGrid.DataSource = dvTest.ToTable(); childGrid.DataBind(); //childGrid.Columns[2].Width = 100; //childGrid.Columns[2].Header.Text = "Date"; }
I have to format the grid header and widths of the child grid. Please help with that.
I have tried e.Row.RowIslands[0].Columns.count but it is 0. Somebody please help on setting the width and header text for this container grid.
Thanks and Regards,
Parthiban Sekar
Hello Parthiban,
I’m just following up to see if you’ve been able to resolve your issue. If you have any questions or concerns or if you need further assistance please let me know.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Thank you for posting in our forum.
When the container grid is created it has the default settings for the grid. So it has AutoGenerateColumns is set to true by default. When that’s set to true the grid generated the columns based on the data source ,however they’re not added to the Columns collection so it will remain empty. You could set that property to false and manually create the columns with the settings you want and add them to the container grid’s columns collection. For example:
Please refer to the attached sample that demonstrated this and let me know if you have any questions.
Developer Support Engineer II