Hey guys,
I'm doing something new to me in that I'm binding an ultragrid to a dataset rather than binding it to a strongly typed collection, so I'm dealing with some issues I haven't had to before. My situation is that I have a dataset that consists of parent datatable and many other datatables that are linked to the parent datatable using data relations.
So far so good... when I bind I get my parent rows and columns that are setup correction and I can expand to see children of each parent row. The problem is that there is no relationship between the columns of the parent row to the columns of the child row. I've tried:
DisplayLayout.Override.AllowColSizing = AllowColSizing.Synchronized
This doesn't seem to have any affect on the table. The parent rows and child rows have exactly the same columns and groups. still, they are unaffecting of each other and I need them to be tied together.
Any advice for this situation? Basically I just need a way to get the child band columns tied to the parent band columns of the same name/key.
Thanks!
Hi,
I'm not sure what you are trying to do here. What kind of effect are you expecting the parent columns and the child column to have on each other?
You seem to be talking about the width of the columns. But the grid linked up the column widths and keeps them in synch by default - you don't have to do anything. The property that controls this is the AllowColSizing property and setting it to Synchronized will keep the columns widths synchronized - but you usually don't have to set this property, since it defaults to Synchronized, anyway.
If the column widths are not synchronized, then my best guess is that something else in your code is setting the AllowColSizing to something other than Synchronized. Perhaps you are loading a Layout or a Preset into the grid?
For reference, here is the grid, fully loaded. I have turned off group headers and column headers on the child band. If I don't use Groups in EITHER band, the columns line up, but once I add the groups, it looks like this:
I'm definitely not loading any layouts or presets into the grid. All the grid setup is done in code and at the point that the data is bound, no settings have been made to the grid. You're right in that I'm trying to get the column widths tied together so that the child bands correlate to the parent bands.
The only difference in this app verses the many others I've done using UltraGrids that had child bands is that this app uses groups in both bands. I removed the groups from all bands and the columns do line up, but they don't when I have groups... is there something else I should do to get the groups to line up?