This is a migrated thread and some comments may be shown as answers.

What is the proper way to set column widths in the GridView

1 Answer 72 Views
GridView
This is a migrated thread and some comments may be shown as answers.
anthony
Top achievements
Rank 1
anthony asked on 02 Feb 2011, 03:43 AM
Hi,

We are using a GridView, and I am having difficulty getting the column widths to work how I think they should.  It seems like it should be simple.

I am reading the widths from a config file as a double and calling a converter, and want to save them out there when the app closes.  This is pretty simple.  The issue is that if I bind the column width to the config setting, it gets overwritten as soon as resize happens (but I do get the calls to resize), I believe because ColumnWidth  is set to sizeToHeader for the grid. If I put the binding on the header, I don't seem to get a notification (my converter isn't called) when the column is resized.  I am simply looking for the correct method of setting this up so that when the column is resized, I get notified, and my headers and columns stay in sync.  Let me know if a code sample would help.

Thanks,

Anthony.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Feb 2011, 07:28 AM
Hello,

 I'm not sure what exact approach you've used however if you want you can check this demo to know more how to save/restore various grid settings (including column width). 

Regards,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
anthony
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or