Skip to main content

Microsoft Silverlight

Answered Question Setting DataGridTextColumn Width property raises error in BlendRSS Feed

(0)

CraigN
CraigN

Member

Member

352 points

89 Posts

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
CraigN

Member

Member

352 points

89 Posts

Answered Question

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

phil.d
phil.d

Member

Member

18 points

6 Posts

Re: Setting DataGridTextColumn Width property raises error in Blend

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

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities