This is a migrated thread and some comments may be shown as answers.

Conditional formatting issue

6 Answers 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 01 Jul 2009, 10:10 AM
Hi,

I have a grid view and want a date column to be conditionally formatted.  It works using the code shown below however the header cell for that column also gets formatted.  How do I prevent only the data getting formatted.  Code follows.

Regards,

Jon

Dim amberFormatting As New Telerik.WinControls.UI.ConditionalFormattingObject("Amber", Telerik.WinControls.UI.ConditionTypes.LessOrEqual, Now(), ""False)  
amberFormatting.CellBackColor = Color.FromArgb(255, 209, 140)  
uxRadGridView.Columns("Due").ConditionalFormattingObjectList.Add(amberFormatting)  
 
Dim greenFormatting As New Telerik.WinControls.UI.ConditionalFormattingObject("Green", Telerik.WinControls.UI.ConditionTypes.Greater, Now(), ""False)  
greenFormatting.CellBackColor = Color.FromArgb(219, 251, 91)  
uxRadGridView.Columns("Due").ConditionalFormattingObjectList.Add(greenFormatting) 

6 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 02 Jul 2009, 11:04 AM
Hi Jon,

The issue is fixed in Q2 2009 release which is to be released within a week. Thank you for your patience.

Sincerely yours,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 02 Jul 2009, 11:12 AM
Hi Nick,

Sounds great - I did get around it using the CellFormatting event in the end.  As it happened the requirement got more complex so I needed more logic in and it made sense to do it a different way.

Re the release next week is that the Beta release of the Q2 for WinForms or is it the full release?

Regards,

Jon
0
Nick
Telerik team
answered on 02 Jul 2009, 02:04 PM
Hi Jon,

The upcoming release is an official release. We have already released a beta of RadDock, but at this stage it is no longer important.

Best wishes,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 02 Jul 2009, 02:32 PM
That's great news - thanks Nick.

Regards,

Jon
0
Jon
Top achievements
Rank 1
answered on 28 Sep 2009, 05:20 PM
I'm using the current build and I still can't get the conditional to fire properly on dates:

Telerik.WinControls.UI.ConditionalFormattingObject conditionalFormattingObject1 = new Telerik.WinControls.UI.ConditionalFormattingObject();  
conditionalFormattingObject1.ApplyToRow = true;  
conditionalFormattingObject1.ConditionType = Telerik.WinControls.UI.ConditionTypes.LessOrEqual;  
conditionalFormattingObject1.Name = "OverDue";  
conditionalFormattingObject1.RowBackColor = System.Drawing.Color.Red;  
conditionalFormattingObject1.TValue1 = "DateTime.Now";  
gridViewDateTimeColumn6.ConditionalFormattingObjectList.Add(conditionalFormattingObject1);  
 

It colors all the rows red not just the ones overdue.
0
Nick
Telerik team
answered on 29 Sep 2009, 01:41 PM
Hi Jon,

Thank you for contacting us. Please change your code to:

... 
conditionalFormattingObject1.TValue1 = DateTime.Now.ToString(); 
... 

It seems to work. Please write me back if you have more questions.

Sincerely yours,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Jon
Top achievements
Rank 1
Answers by
Nick
Telerik team
Jon
Top achievements
Rank 1
Jon
Top achievements
Rank 1
Share this question
or