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
WPF trim property value before binding
Apr 8 2014 12:28 PM
I have bound the datagrid Type column with the property called Vehile of the dataobject. The value of the property for example is InventoryService.Car, InventoryService.Boat etc. I need to display only Car or Boat and trim the remaining part that is InventoryService. How do I achieve that. 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 (
1
)
Datagrid checkbox binding issue
Scroll bar of the textblock not working