I have the following flat table structure in my UltraDataSource which is then bound to my UltraGrid.
Now that view is not really useful to a user. I want to be able to organise the data such that the user can view Account->Permission assignments either by Account or by Permission. The Icon is related to the Account - if it is a group or is a user.
I have a combo where the user can select a view. This dynamically changes the SortedColumns. I am using OutlookGroupBy to display the hierarchy. The following code is executed when the user selects a view in the combo:
ultraGrid1.DisplayLayout.Bands[0].Groups.Clear(); ultraGrid1.DisplayLayout.Bands[0].SortedColumns.Clear(); this.ultraGrid1.DisplayLayout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; string column = ultraCombo1.Value == "By User" ? "AccountName" : "PermissionName"; var col = ultraGrid1.DisplayLayout.Bands[0].Columns[column]; var colIcon = ultraGrid1.DisplayLayout.Bands[0].Columns["Icon"]; //ultraGrid1.DisplayLayout.Bands[0].SortedColumns.Add("Icon", false, true); ultraGrid1.DisplayLayout.Bands[0].SortedColumns.Add(column, false, true); this.ultraGrid1.Rows.ExpandAll(true);
This displays the 2 views as follows:
View By User
View By Permission
This all looks ok. However, I want the icon to be displayed alongside the account at all times. I also don't want the summary to display the column name - just the value (and maybe the number of items in it).
Is this the way to do the grouping? Or do I need to create some sort of dynamic multi band layout which would be dependant on the selected view?
I want to add some filtering to the scenario on the account name - so I would have a separate textbox and when the user types characters into it - it filters the accounts listed in the grid.
Thanks
Andez
Hi Andez,
Paul Anderson said:This all looks ok. However, I want the icon to be displayed alongside the account at all times.
What column is displaying the image? Is that the Account column? If so, then why is it displaying an image and not the text in the normal (ungrouped) view?
There's no reason why grouping the grid should have changed the Account column, but since I don't know what you are doing to show the images there in the first place, I can't really guess why it's changing. Maybe you are setting a ValueList on that column and it's getting cleared out for some reason.
Paul Anderson said:I also don't want the summary to display the column name - just the value (and maybe the number of items in it).
Check out the GroupByRowDescriptionMask property.
Paul Anderson said:Is this the way to do the grouping? Or do I need to create some sort of dynamic multi band layout which would be dependant on the selected view?
This seems like a perfectly reasonable approach to the two views you want.
Paul Anderson said:I want to add some filtering to the scenario on the account name - so I would have a separate textbox and when the user types characters into it - it filters the accounts listed in the grid.
The easiest thing to do would be to use AllowRowFilters and FilterUIType to enable the FilterRow. But if you want the filter textbox outside the grid, then you could use the RowFilters collection on the band to add filters to the grid.
Hi Mike,
I've updated the question with the images. I've had to link them from my PhotoBucket. I've checked the preview and they show. However, the Infragistics Web RichText editor allows you to paste in an image - it just doesn't show it.
Regards and thanks,
Paul
There seems to be something missing from your post. You say "I have the following flat table structure in my UltraDataSource which is then bound to my UltraGrid." But then there is no structure or any information following it. So I'm not sure what you are referring to.
It looks like maybe you tried to include images in your post, but if so, they didn't come through. Maybe you could go to the Options Tab and attach a zip file with the images.