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

Format Rows without using Conditional Formatting object or RowFormatting Events?

3 Answers 227 Views
GridView
This is a migrated thread and some comments may be shown as answers.
rjmorton
Top achievements
Rank 1
rjmorton asked on 03 Feb 2009, 09:16 PM
Hi all,

Just been doing a search on this and I think I'm stuck...

Is there really no way to programatically format a row other than use the Conditional formatting object or the RowFormatting Events?

In any other grid out there, I would be able to do something like:
myGrid.Rows(3).Backcolor = Color.Maroon;
Seems slightly short sighted if I can't do the same thing with the RADGrid control

I notice with RADGrid, I can do 'myGrid.Rows(3).VisualElement.Backcolor = Color.Maroon;', but VisualElement is only the rows that are currently scrolled into view.

The reason I ask is because I want to format certain rows based on a series of criteria that isn't anything to do with the value of the cells, so ConditionalFormatting is out and RowFormatting event would be very cludgy for this.
Surely there must be a simple way to programatically format certain rows?

Thanks,
Richard.

3 Answers, 1 is accepted

Sort by
0
Fabien
Top achievements
Rank 2
answered on 04 Feb 2009, 09:19 AM
Hi,

please take a look on here
I provided the way to do this.

Any questions? Don't hesitate.

Best regards,

Fabien
0
rjmorton
Top achievements
Rank 1
answered on 04 Feb 2009, 06:03 PM
Thanks Fabien,
I'll take a look.
0
Jack
Telerik team
answered on 05 Feb 2009, 01:39 PM
Hi Richard,

I understand your concerns.

You are correct in your suspicions. There are two ways to customize cells in grid. The one is to use conditional formatting objects and the other is to process the CellFormatting object. You can't access the VisualElement of non visible cells, because of the virtualization used in RadGridView. Here you can find more about this.

Actually, you are the first to request a different approach to customize cells. We will consider your suggestion when developing our future versions. Feel free to give us more details on the behavior you want to achieve.

Should you have any other questions, please do not hesitate to write me back.

Regards,
Jack
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
rjmorton
Top achievements
Rank 1
Answers by
Fabien
Top achievements
Rank 2
rjmorton
Top achievements
Rank 1
Jack
Telerik team
Share this question
or