Hi,
I have an issue with hiding columns in Band(1).
In Band(0), hiding a column can be done by:WebHierarchicalDataGrid1.GridView.Columns(0).Hidden = True
So I tried for Band(1):WebHierarchicalDataGrid1.GridView.Band.Bands(1).Columns(0).Hidden = True
But that doesn't work.
Thanks,Andreas
what do you mean that by you looked at the event?My Visual Studio 2008 insists that e.RowIsland is no member of "System.EventArgs"Regards,
Andreas
I have looked at the event and the object e.RowIsland exists. If you would like an easier approach then you can call the method RefreshBehaviors() available on the WebHierarchicalDataDrid level after you hide the column.
Magued
Hi Magued,
in the RowIslandDataBound event, e.RowIsland does not exist.
It does exist in RowIslandDataBinding. But there this code does not do anything :-/
Can you test it yourself?
Regards,Andreas
I am following up with you and if the issue was resolved.
Hi Andreas,
This is how the WHDG is expected to behave. The row islands are stored in the view state once one is made, so change to the Band will not necessarily automatically be reflected in the row island until it is remade. You can use the following code snippet if you want to hide a column if the data is retrieved when you expand the parent band:
protected void WebHierarchicalDataGrid1_RowIslandDataBound(object sender, RowIslandEventArgs e) { for (int x = 0; x < e.RowIsland.Columns.Count; ++x) { if (x < e.RowIsland.Band.Columns.Count) e.RowIsland.Columns[x].Hidden = e.RowIsland.Band.Columns[x].Hidden; } }
Or if you are initially loading all the child bands you can use the following code snippet:
WebHierarchicalDataGrid1.Bands[0].Columns[2].Hidden = true;
this.WebHierarchicalDataGrid1.RefreshBehaviors();
Please test and send me regarding any questions.