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

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"/>

Anyone know why or a workaround?

 

Microsoft Xbox MVP

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Answered Question

Re: Setting DataGridTextColumn Width property raises error in Blend

Hello, this looks like a problem in the designer... You should be able to set ColumnWidth in XAML. Can you run the application successfully? I've tested this scenario:

<System_Windows_Controls:DataGrid ColumnWidth="200" x:Name="dg"/>

At runtime, it works fine. But I did get the error message in Expression Blend, and the designer stopped working. I'll verify that with our Expression Blend team...

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

CraigN
CraigN

Member

Member

352 points

89 Posts

Re: Setting DataGridTextColumn Width property raises error in Blend

I wasn't actually referring to the DataGrid ColumnWidth property itself, but to a single column's width.

Hopefully this issue and the numerous others that exist in Blend get fixed soon.

Microsoft Xbox MVP

aganariman
aganariman

Member

Member

2 points

7 Posts

Re: Re: Setting DataGridTextColumn Width property raises error in Blend

I got the same error. There is no problem with Width property of DataGridTextColumn or ColumnWidth property of DataGrid in Vstudio but when I open xaml file in Blend(june) type converter error occurs.

g.k.
g.k.

Member

Member

16 points

9 Posts

Re: Re: Setting DataGridTextColumn Width property raises error in Blend

aganariman:

I got the same error. There is no problem with Width property of DataGridTextColumn or ColumnWidth property of DataGrid in Vstudio but when I open xaml file in Blend(june) type converter error occurs.

 

I have the same problem. It works in VS and in practice but not in blend. Blend isn't very good yet Sad

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities