Hello,
I am using an ultragrid in my application. I am also allowing the end users to change column width, cell font name, font size, horizontal alignment, vertical alignment, column caption etc.
Right now, I am saving all these settings in the format of string for each column (like key-value pairs) but as the number of columns are getting increased, it is becoming quite difficult to implement more and manage.
I am looking at better ways and found that SQL Server has XML datatype and Grid has methods like SaveToXML() and LoadFromXML(). If I use this way, If I use SaveToXML() will it save all the settings (apperance settings) which I discussed above or only a part of it.
Let me know whether this works in my case or not and also I appreciate if there are any better ways.
Thanks
Nagarjun.
Yes, that is exactly what the SaveAsXml/LoadFromXml methods were designed for.
Is there any example relating to it in KB?
You mean you want a single header to span multiple columns?
There are a couple of ways you can do this, but which one you use depends on exactly what you want.
The best thing to do would be to use Groups, either in the normal layout or a GroupLayout.
Is there any way to do colspan in header? If so, can you give me an example.
nag4054 said:What is the best way to compare one appearance object of one column to another appearance object?
The Equals method will just compare instances, so that will not work. There's no easy way to compare two appearances. You will have to check every property and compare each one individually.
nag4054 said:How to fix two columns so that if you try to move one column, both the columns needs to move accordingly. Is this possible?
There is no functionality to link to columns in the grid. What you could do is handle the AfterColPosChanged event and fix up the column's positions after the user moves a column. But you will probably need to use an anti-recursion flag to prevent the event from firing continuously.
How to fix two columns so that if you try to move one column, both the columns needs to move accordingly. Is this possible?
What is the best way to compare one appearance object of one column to another appearance object?
Infragistics.Win.AppearanceBase FirstColumnApp = PrintGrid.Selected.Columns[0].Appearance; for (int i = 1; i <= PrintGrid.Selected.Columns.Count - 1; i++) { if (PrintGrid.Selected.Columns[i].Appearance.Equals(FirstColumnApp))
Appearance1.Equals(Appearance20 not working.
What is the best way for it?