Hello,
I'm returning a dataset containing 2 DataTables, add relation and bind it to the grid at the run-time
Hiding a column from the 'parent' is not a problem:
uhgrdReportsF.GridView.MainGrid.Columns[...].Hidden = true;
But how would I go about doing the same for a column from the child DataTable?
Thank you in advance,
Alex.
I agree with you but e.Row.Items accept only int and not string. This also works for you? For level problem I'll try directly with your example to see if it does the same.
Thanks,
i don't know why does your code return 0 for child band it should return 1 for your child band.
anyway according to performance point of view we should not use e.Row.Items.FindItemByKey("columnName") in initilize row b'coz InitilizeRow event get execute for each row. internally it looping through for all rows to find a particular column, means if there is 10 rows then
InitilizeRow will execute 10 times. if InitilizeRow
event is executing for first row then it try to find-out a column from number of columns available in grid.
then again it will do the same process for 2nd row to till the number of rows available in the grid.
Thanks for your reply. I believe there is still something wrong. I did as you said but in my case ((ContainerGridRecord)e.Row).Level is always 0 for parent and child row. Anyway the code works
e.Row.Items.FindItemByKey("columnName").Column.Hidden = true;
e.Row.Items.FindItemByKey("columnName1").Column.Header.Text = "Column name";
I use 11.1.20111.1006 version. Regards
we can not hide autogenerate column from server side as well as from RowsIslandPopulating event
but we can hide autogenerate column from InitilizeRow Event.
Write code like this
protected void WebHirahicalSummaryGrid_InitializeRow(object sender, RowEventArgs e) { if (((ContainerGridRecord) e.Row).Level == 1) e.Row.Items["ColumnName"].Column.Hidden = true; }
Hi. I have same problem. As explain in your sample 'Manual load on demand' I have wrote the code in RowsIslandPopulating event:
e.Cancel = true;
DataRowView currentRow = (DataRowView) ((Infragistics.Web.UI.Framework.Data.DataSetNode) e.Row.DataItem).Item;
DataView dvRighe = currentRow.CreateChildView("relOrd");
ContainerGrid child = new ContainerGrid();
e.Row.RowIslands.Add(child);
child.DataSource = dvRighe;
child.DataBind();