Hi
I have an ultragrid with a parent band having cardview children.
What I would like to do is hide a cardview column if there is no data for that column, while keeping the column for other parent records if the column does have data. (I've attached a picture as it doesn't look like my pasted picture - which might be below - will show)
In initializeRow, for any row in band 2 I tried the following, but it hides the Cost for all child records, not just the cost for the second parent. Is what I'm wanting to do possible?
private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
if(e.Row.Band.Index == 1)
ParentObject parentObject = e.Row.ParentRow.ListObject as ParentObject;
bool showCostColumn = false;
foreach(ChildObject childObject in parentObject.LineItems)
if (childObject.Cost.HasValue)
showCostColumn = true;
}
e.Row.Cells["Cost"].Column.Hidden = !showCostColumn;
Thanks for any advice that you can offer.
Steve
Hi Steve,
The column object applies to the entire band across all islands. So you cannot hide a column under one parent without hiding it under all of them. There's no way to do that.
However, if you just want to hide empty cells in your card, you could set the band.CardSettings.Style to VariableHeight.
Thanks for the amazingly swift reply Mike.
Unfortunately that solution is not going to work for me as I would still like to use merged labels for the cards.
Its not a big issue leaving it as it is though.
cheers
Hello Steve,
I am just checking about the progress of this issue. Let me know if you need our further assistance on it.
Thank you for using Infragistics Components.
Thanks for your reply Milko
What I didn't say in my original question was that I've got 4 different sections of columns that may or may not be displayed, so it would mean 24 different bands to cover all scenarios.
I was hoping to make use of the unused space taken up by the blank cells, but I think the users will just have to get used to how it currently works.
Thanks for taking the time to look into this though.
We are still following this forum thread.
Please feel free to let us know if you still have any questions on this matter.
Thank you for using Infragistics Controls.
Hi Milko
As you suggested, I added this as a possible new product idea.
regards