Page view counter
Setting DataGridTextColumn Width property raises error in Blend Subscribe to this thread
Last post 06-11-2008 8:46 AM by phil.d. 2 replies.
Sort Posts:
06-10-2008 8:22 AM
Setting DataGridTextColumn Width property raises error in Blend

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?


Microsoft Xbox MVP

CraigN

Loading...
Joined on 05-11-2007
South Africa
Posts 89
06-11-2008 7:45 AM
Marked as Answer
Re: Setting DataGridTextColumn Width property raises error in Blend
I've logged this on Connect, please vote for it (https://connect.microsoft.com/Expression/feedback/ViewFeedback.aspx?FeedbackID=350446).

Microsoft Xbox MVP

CraigN

Loading...
Joined on 05-11-2007
South Africa
Posts 89
06-11-2008 8:46 AM
Re: Setting DataGridTextColumn Width property raises error in Blend

Hi Craig, Yes, hitting this in Expression as well. Vote placed as requested. Cheers

phil.d

Loading...
Joined on 04-01-2008
Posts 6
Microsoft Communities