OT: Infragistics Grid question

OT: Infragistics Grid question

Old forum URL: forums.lhotka.net/forums/t/721.aspx


ajj3085 posted on Tuesday, July 25, 2006

Hi,

Trying to evalutate the grid. I have a LineItem class, which represents a single line item in the order / quote.  Each line item may contain one or more Products, which have basically the same information as a line item.  I've gotten the indenting to the same level for both, so it appears on the UI as if there is no difference between the two.  The only part I need now is to NOT have the column headers repeat after the Products of the first line item and before the second line item.

How do I turn those off?

Thanks
Andy

CaymanIslandsCarpediem replied on Tuesday, July 25, 2006

If memory serves, you'll need to get the band (UltraGridBand) of the level you don't want to show column headers for.  Then the band should expose a property called "ColHeadersVisible" that you can set to false.

ajj3085 replied on Tuesday, July 25, 2006

I found that property on the band, but it hides the column headers completely.  I only want to hide the ones that occur in the 'middle' of the grid.

Andy

jlazanowski replied on Tuesday, July 25, 2006

Andy,

Cayman was correct. The column headers are configured for each band that you're working with. I'm making an assumption here but sounds like you have a parent band and two child bands that have the same data.

The easiest way to do this would be to turn the column headers off in the InitializeLayout event of the grid

something like

e.Layout.Bands[2].ColHeadersVisable = false;

You can also call it by the band name if you're unsure of the index

e.Layout.Bands["MyBand"].ColHeadersVisable = false;

HTH,

Justin

ajj3085 replied on Tuesday, July 25, 2006

Justin,

I don't have three bands, only two.  The Grid displays like so:

Description         UnitPrice       Qty       ExtPrice <--- I want to keep this header
LineItem1               1                1           1                  (this is of type LineItem, in band 0)
Product1                1                1           1                  (this is in LineItem1.Products collection)
Product2                1                1           1                  (this is in LineItem1.Products collection)
Description         UnitPrice       Qty       ExtPrice <--- I just want to remove this col. header
LineItem2               1                1           1                  (this is of type LineItem, in band 0)
Product3                1                1           1                  (this is in LineItem2.Products collection)
Product4                1                1           1                  (this is in LineItem2.Products collection)

Hopefully that will make things more clear.  As you can see, I have the column headers repeating just before LineItem2 and its children are displayed.  I don't want to have no column headers, i just want them to appear once at the top.

Thanks
Andy

jlazanowski replied on Tuesday, July 25, 2006

Andy,
It's been over a year since I've used the grid in a hierarchical binding scheme so I'm sure I'm a little rusty on this but if I recall correctly ....
I just went back to look at some old code but it's all 1.1 and using datasets so things might be a little different, however here is what I could discern
My structure looked something like this
Band A
   Band B
    Band C
   Band B
    Band C
  Band B
    Band C
Column Headers would only on the first row of a given band as long as it was not broken by another band In my case I only had one column header for Band B but as I drilled out Band C I would have multiple column headers because there was a band in between them (Band B) If there were more than one line items in the Band C before the next band B I would only get one column header

I guess the point is that the column headers are setup on the specific band, thus you can only shut them off on the band. If you're getting repeating headers something probably wrong with the binding of your item(s) to the grid.

I do remember specifically that I emailed Infragistics about a feature request to the grid, at the time it wouldn't allow something that I wanted, I think it was multiple bands to bind to a parent band, at the time I think you could only have a 1:1 relation if the band was already a child itself, don't remember the specifics and don't know if it's an issue anymore. I've put a screen shot of what I'm talking about here so that this post makes a little more sense

You can also e-mail Infragistics, even if you haven't purchased the product, then will try and help you.

Justin

 

ajj3085 replied on Wednesday, July 26, 2006

I've been posting on their forum as well, and I'm getting the behavior you describe; expand so that Band C is seen, and the headers for band B repeat. 

In my case, i'm trying to make it invisible to the user that there are actually two bands; the only want they'd know they were working with another band would be that they couldn't perform some operations which they may with do with items in band B.

I'll see if I can't talk to them directly to see if I can do what I want.  Thanks for posting.

Andy

Copyright (c) Marimer LLC