We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Query regarding Binding properties in GridDataControl

Thread ID:

Created:

Updated:

Platform:

Replies:

93591 Mar 23,2010 05:58 AM Mar 23,2010 06:23 AM WPF 1
loading
Tags: GridControl
akjoshi
Asked On March 23, 2010 05:58 AM

Hi,

I am binding a GridDataControl with a Collection of objects(Custom entity, say Employee); I have added various columns and Mapped them with properties of Employee object like this -

x:Name="employeeListGrid"
ItemsSource="{Binding EmployeeList}"
ShowAddNewRow="False"
AutoPopulateColumns="False"
AutoPopulateRelations="False"
ShowColumnOptions="False"
AllowDelete="True"
AllowEdit="False"
AllowGroup="True"
AllowSelection="Row"
ExcelLikeCurrentCell="False"
ShowGroupDropArea="True"
ShowRowHeader="False"
ActivateCurrentCellBehavior="None"
ColumnSizer="None"
ShowCurrentCell="False"
AllowSort="True">


MappingName="Name"
Width="190"
HeaderText="Employee Name"
AllowFilter="True"
AllowResize="True"
AllowSort="True">

IsThemed="False"
Foreground="Black"
PredicateType="And" />



HeaderText="Status"
Width="95"
MappingName="Status"
AllowResize="False"
AllowFilter="True">



Width="20"
Source="{Binding CellBoundValue, Converter={Converters:StatusToImageConvertor}}" />










Now, I am facing following issues -

1. Whenever status of an employee changes change notification is fired, but the value never gets updated in grids column( converter doesn't gets caled).

2. I want to change the ForeColor of Employee name based on its Status i.e. Show Name in Red if status is Resigned else Green etc. But I am not sure how can I bind more then one property of my Employee entity in a single column!

I am more intrested in a XAML solution instead of code behind. A simple sample will be really helpful.

Thanks,
Abhishek



Mohamed Suhaib Fahad A. [Syncfusion]
Replied On March 23, 2010 06:23 AM

Hi Abhishek,

Thanks for the details.

1) If you have INotifyPropertyChanged interface implemented, then you need to set the "NotifyPropertyChanges=true" property in the grid. This would refresh the grid.
2) You can use ConditionalFormatting feature that the grid supports. Simply define the conditions and apply the GridStyleInfo to that particular cell,











Likewise, You can also have this used to set CellType with images etc., We also have a sample in our install that explains the Conditional Formatting.

Please let us know if you need any more details.

Thanks,
Fahad

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;