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. Image for the cookie policy date
close icon

Query regarding Binding properties in GridDataControl

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



1 Reply

MS Mohamed Suhaib Fahad A. Syncfusion Team March 23, 2010 10:23 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon