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

Blinking cells of GridDataControl

I want my GridDataControl to have the color change on increase/decrease functionality that is implemented in the performance demo - Trader Grid.

I want to use the features of GridDataControl such as sorting,filters, hidden columns etc so I do not want to derive from GridControlBase

It appears that GridDataControl inherits from ContentControl, not GridControlBase so I cannot override OnPrepareRenderCell by subclassing GridDataControl.


How should I proceed with implementing the blink functionality on the GridDataControl?

4 Replies

DP Dhinesh Pandiyan M Syncfusion Team December 30, 2009 11:19 AM UTC

Hi John,

Thanks for using Syncfusion products.
We can get the blink functionality on the GridDataControl using conditional formatting, INotifyProperty. Please download the sample from the below link.

http://www.syncfusion.com/uploads/redirect.aspx?file=Forum92232_448b0ad3.zip&team=development

Conditional formatting allows to format the grid cells based on the certain conditions and we can apply the special style for these cells. In this sample we use the condition 'Less Than 0' to the column 'Change' and set the new style. This style is getting into cells when the condition get satisfied.

You can also refer the below link for User's Guide.

http://help.syncfusion.com/ug_74/gridwpf/defaultWPF.html

Please let us know if you have any questions.

With Regards,
Dhinesh Pandiyan


JW John Warner December 31, 2009 03:49 PM UTC

I went ahead and did a GridDataConditionalFormat on my grid, which is bound to a datatable object.

I am getting an error saying is not a member of type System.Data.DataRowView

In your example it works fine but not with my datatable. The column it is blowing up on does exist. I have also tried other column names but I still get the same error.


JW John Warner December 31, 2009 10:24 PM UTC

I can get conditional formatting to work by attching a handler to gridDataControl.Model.QueryCellFormattedText

However how does conditional formatting allow me to implement the blink functionality. With conditional formatting how do I test if a value in a cell has increased or decreased?

I want my cells to blink green and red if their values go up and down.


DP Dhinesh Pandiyan M Syncfusion Team January 4, 2010 01:07 PM UTC

Hi John,

Thanks for using Syncfusion products.

This sample explan the blink functionality in GridDataControl using conditional formatting. Please download the sample from below link.

http://www.syncfusion.com/uploads/redirect.aspx?file=Forum92232_4e713f35.zip&team=development

We add two properties OldChange, Flag for maintain old data and weather data gets incresed or decreased. We set the values of those properties while seting the value to Property which we need to blink [Change ]. And In conditional formatting display the cell as green when Flag is true [latest value is greater then old value] otherwise red [latest value is lesser then old value].

We can use the similar technique for DataTable source. We can maintain the property and update the values using ListChanged event and the conditional formating display the style based on the existing condition [Green for Increase and Red for Decrease].

Please let us know if you have any questions.

With Regards,
Dhinesh Pandiyan

Loader.
Live Chat Icon For mobile
Up arrow icon