I have an application where the user has the ability to save multiple layouts. By default I save a single default layout in the DB. The first time the user logs in, the default layout is used. However this causes a delay in loading.
Each grid in my application has what we call a RepNumber. The filterrow contains the column for repname, which is tied to the repnumber. What I would like to do is create a layout for each user when I save the default layout for the first time.
How can I take an existing layout and create a default that is catered to each specific user? Also, when ever a new user is added to the system, I would need to create the default layout records for that user.
My initial thoughts where to have the db triggers perform these function, but I dont know how to add filters to an existing layout.
By the way I am serializing the layouts with XML...
Thanks
HI Elfmanne,
I created a sample application that creates several different wingrid layouts, each with different filtering conditions. I then apply these layouts to several different grids.
Here is a code snippet to create the layouts with different filtering
UltraGridBand band = ultraGrid1.DisplayLayout.Bands[0]; band.ColumnFilters[0].FilterConditions.Add(FilterComparisionOperator.Equals, 2); ultraGrid1.DisplayLayout.SaveAsXml("Acct2.xml");
band.ColumnFilters[0].ClearFilterConditions(); band.ColumnFilters[0].FilterConditions.Add(FilterComparisionOperator.Equals, 3); ultraGrid1.DisplayLayout.SaveAsXml("Acct3.xml");
Here is a code snippet load the layouts
ultraGrid2.DisplayLayout.LoadFromXml("Acct2.xml"); ultraGrid3.DisplayLayout.LoadFromXml("Acct3.xml"); ultraGrid4.DisplayLayout.LoadFromXml("Acct4.xml"); ultraGrid5.DisplayLayout.LoadFromXml("Acct5.xml");
The sample project is too large to attach to this forum post. I will email it to you directly.
Please review my sample application. You will need to readd the Infragistics references to run this project.
Sincerely,
Matt
Developer Support Engineer
HI,
Just following up on our forum thead.
I hope my sample resolved your issue regarding the multiple layouts with different filtering.
If you have additional questions regarding this issue, please let me know .
Matt,
I have opened a case if you need more detail. It includes an explanation and sample code.
The case is CAS-49666-Q37X30