Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Datagrid checkbox binding issue
Ranjit Menon
Apr 8 2014 12:23 PM
926
Reply
I have bound the datagrid checkbox column with the property of the dataobject. The value of the property for example is Land,Sea ,Air etc. I need to set the checkbox to checked if it is land. How do I do it. My current code is as follows
<DataGrid.Columns>
<DataGridTextColumn Header="Type" Binding="{Binding Path=Vehicle}" />
<DataGridTextColumn Header="Make" Binding="{Binding Path=Vehicle.Make}" />
<DataGridTextColumn Header="Model" Binding="{Binding Path=Vehicle.Model}" />
<DataGridTextColumn Header="No of Wheels" Binding="{Binding Path=Vehicle.NumberOfWheels}"/>
<DataGridTemplateColumn Header="Road Vechile">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Path=Vehicle.Environment,Mode=OneWay }"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
socket programming in wpf
WPF trim property value before binding