Hello:
I have an UltraGrid bound to an object of mine, let's call it MainObject. It has a bunch of properties that are mostly primitives e.g. Name string, ID int. It also has a child object called ChildObject that has other fields e.g. ChildName or ChildId.
What I'm seeing after loading the dataset for MainObject onto the grid is a set of columns bound normally to the primitives and an extra column 'ChildObject'...that displays during runtime as simply "Namespace.ChildObject'.
How can I configure the column to show a particular field of ChildObject e.g. ChildID? I've been poking around for hours and all I can see is that it keeps treating that object as a primitive and can't let me control the actual value shown.
Hello Borong,
The mentioned behavior is expected, but maybe one possible way to achieve desired behavior could be if you are using Unbound column into your grid. This Unbound column will display desired information from your ChildObjectIf you want you could hide the coulmn that display your "Namespave.ChildObject".Please take a look at the code below and attached video for more details.
// Create Unbound Column ultraGrid1.DisplayLayout.Bands[0].Columns.Add("MyKey", "MyUnboundColumn");ultraGrid1.DisplayLayout.Bands[0].Columns["MyKey"].DataType = typeof(string);
// Handle InitializeRowprivate void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e){ e.Row.Cells[MyKey].Value = ((MntTaskCode)e.Row.Cells[2].Value).Description;}
Please let me know if you have any questions.Regards
Have you been able to resolve your issue ? If you still have any concerns or questions I will be glad to help. If you need any additional assistance don’t hesitate to ask.
Regards
Thanks. I might look at that solution you've given, but currently in order to keep everything defined at the designer page I did a workaround that is enough for me for now.
I basically only needed one field in the child object ("item descriptor"-thingy), so I created a 'getter' property in the parent pointing directly to that field, which showed up on the designer. Worked well enough =)
Thanks for your response. If you have any further questions, do not heistate to write us