Hi all !I've created an example with a WebGrid with hierarchical data as described in the article
http://help.infragistics.com/NetAdvantage/NET/Current/CLR2.0/?target=WebGrid.html
The example works fine, but when trying to access the child band, an exception will be thrown.
this.UltraWebGrid1.Band[0].Columns.All // works fine this.UltraWebGrid1.Band[1].Columns.All // throws an exception
It seams, that the child band is absolute unknown for the WebGrid, because calling
this.UltraWebGrid1.Bands.Count returns 1, and not 2 !
Any hint or idea is welcome. Thanks in advance.
Regards,Claus
The link you've provided leads to a landing page, so I'm not sure which article you're using as your guide.
When are you checking this value? Are you databinding the grid?
Most likely, at the time you're checking this value, the second band may not exist yet.
Hi !
Sorry, the correct link is:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebHierarchicalDataSource_Getting_Started_with_WebHierarchicalDatasource.html
In the Page_Load event I tried to access the root band and child band. But the child band doesn't exist in WebGrid.
protected void Page_Load(object sender, EventArgs e) {
if (!Page.IsPostBack) { // this.UltraWebGrid1 this.UltraWebGrid1.Bands[0].Columns[0].Hidden = true; this.UltraWebGrid1.Bands[1].Columns[0].Hidden = true; } }
if (!Page.IsPostBack) { // this.UltraWebGrid1 this.UltraWebGrid1.Bands[0].Columns[0].Hidden = true; this.UltraWebGrid1.Bands[1].Columns[0].Hidden = true; }
}
Regards.
Claus