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
Hi Milko
As you suggested, I added this as a possible new product idea.
regards
Hello Steve,
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.
After working on hiding the card view columns for columns without data while retain merged labels and doing some research, idea has been determined to be a new product idea. You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
There are many benefits to submitting a product idea:
-Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
Log into the Infragistics Product Idea site at http://ideas.infragistics.com (creating a new login if needed).
Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)
Add your product idea and be sure to be specific and provide as much detail as possible.
- Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!
- Include a link to this thread in your idea so product management will be able to look back at this case.
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Thank you for contacting Infragistics.
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.
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.