Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Setting DataGridTextColumn Width property raises error in Blend
4 replies. Latest Post by g.k. on July 10, 2008.
(0)
CraigN
Member
352 points
89 Posts
06-09-2008 2:36 PM |
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?
Yi-Lun L...
All-Star
25052 points
2,747 Posts
06-11-2008 3:57 AM |
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...
06-11-2008 4:43 AM |
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.
aganariman
2 points
7 Posts
06-12-2008 4:28 AM |
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.
16 points
9 Posts
07-10-2008 6:33 PM |
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