I have javascript code that I want to run for a number of different grids in our product. Some of these grids are hierarchical, and some aren't. I'm running into a bug on a non-hierarchical grid because I assumed that all non-hierarchical grids would only have a single band. But this particular table happens to come from a DataSet that has a relation between this table and another. So even though I'm setting the view type to not be hierarchical, and even though no grid appears on the UI, the grid.Bands.length is coming back as 2.
I didn't see a getViewType method on the client side or anything like isHierarchical. I do see an getExpandable, but that's returning a 1, even though I don't seem to ever be able to expand this band. Any tips?
Never mind. I'm a dope. I was setting the ViewType to Flat, but a later section of code was setting it back to Hierarchical. grid.Bands.length seems to do the trick.
Well, this is probably just because I did something stupid, but that was the first thing I tried, and the thing that wasn't working. I'm fairly confident that (a) the view type is not set (i.e. I never set it to hierarchical), and that there is a data relation in the data set attached to the table I'm trying to display. Here's what I'm seeing:
grid.Bands.length is coming back as 2.
grid.Bands[1].Visible = true (even though I don't see any band).
grid.Bands[0].Visible = true
grid.Bands[0].getExpandable = 1 (even though I don't think it is).
Sorry for not understanding the issue properly
Hi,
I think grid.Bands.length could be used to get this information.
Try this code:
function IsHierarchical()
{
var grid = igtbl_getGridById("<%= UG1.ClientID %>");
//alert(grid.Bands.length);
if (grid.Bands.length > 1)
return true;
}
return false;
Let me know if this works for you.