TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ranjit Menon
NA
8
7.7k
Datagrid checkbox binding issue
Apr 8 2014 12:23 PM
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>
Reply
Answers (
2
)
socket programming in wpf
WPF trim property value before binding