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

Do I have to write my own converter for GridViewLength

2 Answers 105 Views
GridView
This is a migrated thread and some comments may be shown as answers.
anthony
Top achievements
Rank 1
anthony asked on 31 Jan 2011, 11:10 PM
I have a xaml file that I have bound a gridviewdatacolum width (GridViewLength) to an app.config file.  I have made the config setting a double, so the width in the xaml is expecting a converter.  It looks like one is built in, but it does not implement IValueConverter.  Am I missing something, or do I have to write my own converter?  If not, can I get an example of how to use the GridViewLengthConverter?

Thanks,

Anthony.

2 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 01 Feb 2011, 10:36 AM
Hi anthony,

You will have to create a IValueConverter in this case which will convert numeric values to our GridViewLength type. The conversion for fixed column width is as simple as:

var length = new GridViewLength(40, GridViewLengthUnitType.Pixel);

Regards,
Milan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
anthony
Top achievements
Rank 1
answered on 01 Feb 2011, 05:25 PM
Thanks.  Exactly what I did.
Tags
GridView
Asked by
anthony
Top achievements
Rank 1
Answers by
Milan
Telerik team
anthony
Top achievements
Rank 1
Share this question
or