Reputation: 1082
Im currently using grid control of devexpress and i tried to get the width of the column in grid control but it sees its returning "NaN" value this is my code for
XAML
<dxg:GridColumn FieldName="Order.Order.Comment" Header="Comment" HorizontalHeaderContentAlignment="Left" ReadOnly="True" Name"TestColumn">
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<dxe:MemoEdit x:Name="PART_Editor" ShowIcon="False" EditMode="Standalone" IsReadOnly="True" IsTextEditable="False" PopupFooterButtons="Close" InvalidValueBehavior="AllowLeaveEditor" PopupMaxWidth="250" MemoTextWrapping="Wrap" MemoVerticalScrollBarVisibility="Auto" ShowBorder="False"/>
</DataTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
i name the column "TestColumn"
And i have tried to get it on back end
C#
var width = TestColumn.width;
but the return value is "NaN" did i miss anything on my code? is there a possible way to get the width of a certain column?
Upvotes: 0
Views: 524
Reputation: 2002
I don't know devexpress but I suppose there is a TextColumn.ActualWidth
property that returns the value you're expecting.
Having a Width
set to NaN
is something common in WPF and simply means that the width is not an absolute value, but can vary depending on the layout.
Upvotes: 2