Hello
I am migrating from 11.1 to 13.2 and I need yo get the active row band.
I previously did it like this: mygrid.DisplayLayout.ActiveRow.Band
But now I don't know how to obtain the data I need.
Thank you!
Hello,
WebHierarchicalDataGrid has different architecture from the UltraWebGrid. In WHDG you can get the active cell from the Activation behavior and access the row containing this cell like this:
GridRecordItem cell = WebHierarchicalDataGrid1.Behaviors.Activation.ActiveCell;
GridRecord row = cell.Row;
Here you can find more information about WHDG structure: http://help.infragistics.com/Doc/ASPNET/2013.2/CLR4.0/?page=WebHierarchicalDataGrid_About_WebHierarchicalDataGrid.html
If you have any further questions, please let me know.
Yes, I am aware of that.
I was asking how to get which band is the one containing the selected row, since in my hierarchical data grid I can have multiple band and each one of that band has multiple rows.
I need to know in which band the selected row is contained.
Thank you
Hi Nicole,
You can get the band like this:
string key = ((ContainerGrid)e.CurrentSelectedRows[0].Owner.ControlMain).Key;
var band = WebHierarchicalDataGrid1.Bands[key];
If you have other questions, please let me know.
Hi,
If you need any further assistance with this case, please let me know.
Maybe I have tested with a different version. Try this, it's working in v13.2:
string key = ((ContainerGridRecordCollection)e.CurrentSelectedRows[0].Owner).ControlMain.Key;
Note, that if the clicked row is in the root grid, you won't be able to get it from the Bands collection. However, you can get the root band and compare the keys like this:
if(key == WebHierarchicalDataGrid1.GridView.Key) //etc.
Hope this helps.
I tried:
string key = ((ContainerGrid)e.Row.Owner.ControlMain).Key;
but I am getting this error:
The property or indexer 'Infragistics.Web.UI.GridControls.ControlDataRecordCollection.ControlMain' cannot be used in this context because the get accessor is inaccessible
plus, I don't have a CurrentSelectedRows in my RowEventArgs