It seems that the Width property of the DataGridTextColumn class can't be set in the XAML file. The change documentation notes that setting it programmatically requires some code changes to support the new DataGridLength data type. However setting it in
XAML results in the error "The TypeConverter for "DataGridLength" does not support converting from a string." under Blend.
e.g. <DataGridTextColumn Width="100"/>
Update: I've checked the source to the DataGridLength class using Reflector and it correctly specifies
DataGridLengthConverter using the TypeConverter attribute. The method DataGridLength.CanConvertFrom(Type) also allows for conversion from string, so I don't see why Blend is having an issue.
CraigN
Member
352 Points
89 Posts
Setting DataGridTextColumn Width property raises error in Blend
Jun 10, 2008 12:22 PM | LINK
I originally posted this under .NET Programming forum (http://silverlight.net/forums/t/17666.aspx) but I believe it belongs here.
It seems that the Width property of the DataGridTextColumn class can't be set in the XAML file. The change documentation notes that setting it programmatically requires some code changes to support the new DataGridLength data type. However setting it in XAML results in the error "The TypeConverter for "DataGridLength" does not support converting from a string." under Blend.
e.g. <DataGridTextColumn Width="100"/>
Update: I've checked the source to the DataGridLength class using Reflector and it correctly specifies DataGridLengthConverter using the TypeConverter attribute. The method DataGridLength.CanConvertFrom(Type) also allows for conversion from string, so I don't see why Blend is having an issue.Anyone know why or a workaround?
Silverlight 2 beta 2
CraigN
Member
352 Points
89 Posts
Re: Setting DataGridTextColumn Width property raises error in Blend
Jun 11, 2008 11:45 AM | LINK
phil.d
Member
18 Points
6 Posts
Re: Setting DataGridTextColumn Width property raises error in Blend
Jun 11, 2008 12:46 PM | LINK
Hi Craig, Yes, hitting this in Expression as well. Vote placed as requested. Cheers