Hello,
I want to have multiple bands in ultrawingrid but all binded to one table. how can i achieve this kind of hierearchy?
thanks Mike, i've never used the ultradatasource class before. if i copy my "entire data into it" will i maintain my realtime update capabilities? prob not a quick change for me but i'll start looking into it. Datatable for me at this point is not an option.
AL
Thanks for your idea
Hi,Yes, you are correct. If you need to have different columns displayed for different types, then you would have to create a new data structure of some kind. There are a couple of approaches you could take.You would need to have a table of some sort for each type which essentially defined the columns for that type. You could use UltraDataSource for this and either populate the UltraDataSource all at once by copying your entire set of data into it, or else you could use the load-on-demand functionality of UltraDataSource so you define the structure up front but load the data as needed.Another option would be to try to build a DataSet with a single root table that lists the product types and then has multiple child bands (presumably one for each product type) that has only the columns you need for that type. Each parent row would essentially then have a child band for each type, but only the type that matches the parent row would display since there would not exist any child rows for the other types. This is something of an inefficient option, especially if you have a lot of product types. If you have 5 to 8 types, it would be okay, but if you have hundreds of types, this approach probably won't work.
Thanks Mike. that makes sense and i was able to do that. however my use case is slightly different. i have basically one flat/large table that logically holds many different product types. many fields are inapplicable to certain products etc. ...
what i have to do is have my grid show different columns depending on the product types. at the start i would not need child bands. i would have all bands at top level. One band for cars shows Make/Model another band at the same level shows boats group by city,state.
these 2 bands display different columns and drill down to different details.
am i making sense?
i think i need bands for this.
Hi Al,
If you are binding the grid to a flat list, you could use the grid's OutlookGroupBy feature to create grouping without modifying your data source. It basically groups the data by the values of a particular field and creates GroupBy Rows under which the normal data rows appear.
Grouping is tightly tied to sorting. So to group by a particular field, you do something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; layout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; band.SortedColumns.Add("Int32 1", false, true); }
This displays the GroupByBox so that the user can changed the groupings by default. They just drag and drop columns to or from the GroupByBox at the top of the grid. If you want to turn that off, just add this;
layout.GroupByBox.Hidden = true;