Hi All,
I have enabled card view & row layout in my infragistics grid. In my row layout, I have 4 rows per card and each row has 4 columns. All the cells in one row are visible in one card and not in other cards. When all the cells are hidden in one row of a card, I see an empty row. Is it possible to hide this empty row in the cards where all cells of that are hidden?
Thanks
Ponnu
Hi Ponnu,
No, I don't this this is possible. You can try seting the CardSettings.Style to VariableHeight, but I don't think this will work in this case since you are using a RowLayout with multiple columns.
Hi Mike,
Thanks, I need to have the CardSettings style to compressed so I get the collapsed\expanded views, it does not work with VariableHeight like you said because of using RowLayout.
I tried to do it using CustomDrawFilter. The way I see it, if I could reduce the height of RowUIElement and change the locations of CardLabelUIElement & CellUIElement, it should work. But I could not get this working.
I would appreciate your help in this.
That's not going to work. A DrawFilter is intended to deal with drawing. It's a bad idea to try to resize elements in a DrawFilter. If you want to resize UIElements it woud be more appropriate to use a CreationFilter. But this still isn't going to let you do what you want here - at least not in any reasonable way. You could certainly size the CellUIelements to 0, but the grid won't know that you did so and it will not adjust the positions or sizes of any adjacent objects. So you would basically have to re-arrange just about every element in the grid in order to get this to work how you want it - it's really not feasible.
Thanks, CreationFilter did the trick. But I have little problem with an element spanning across vertically in row layout of the card. Once I change the height of the RowUIElement within BeforeCreateChildElements of CreationFilter, it looks like the SpanY gets reset and does not work.
Would appreciate your help reg. the same.
Many Thanks
I don't really understand. Changing the Rect of a UIElement cannot possibly have any effect on the SpanY property.
I have made a small sample to show it to you as mine is pretty huge one.
As you could see I have reduced the height of first row which resulted in Description Cell height change.
This is the code that I use to reduce the height
public bool BeforeCreateChildElements(UIElement parent) { UltraGridRow rowActive = (UltraGridRow)parent.GetContext(typeof(UltraGridRow));
if (parent is RowUIElement && rowActive.Index == 0 && parent.Rect.Height > 170) { parent.Rect = new Rectangle(parent.Rect.X, parent.Rect.Y, parent.Rect.Width, parent.Rect.Height - 20); } return false; }
Hope you could see the problem, I would appreciate your help.
Thanks Mike, I have managed to do it by removing the SpanY as there is no other way.
I'm afraid I have no idea why that's happening. I guess the GridBagLayout is using the row UIelement as the size of the layout area, so this is affecting the size of the elements within the layout. I'm not sure what else you can do about that. As I said, I really don't think what you are trying to do is feasible.