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

Trying to access a particular cell within a row via a column identifier....

1 Answer 52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
s2uiguy
Top achievements
Rank 1
s2uiguy asked on 18 May 2011, 09:40 PM
Hi,

I have a RadGridView that is bound to a collection of my business objects.

Based on separate data received from the server I sometime need to update things like the foreground color of a cell value for a particular row.

I can do this a brute force way by  accessing the row item and then modifying a specific cell BUT I don't want to make any assumptions about which cell is which.  I would prefer to be able to access the cell by using the row and the column id or something like that in order to get the correct cell.

So, for example, if the grid was the following:

First Name |  Last Name |
---------------------------------
John           | Henry
---------------------------------
Dustin        | Pedroia


and I received some info from the server that required me to change the Last Name to be in red for just Dustin Pedroia.

How can I do something like   rowItem.getColumn(LastName).cellvalue.foreground = "#FFFFFF"?

Does this make sense???

Thanks!

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 19 May 2011, 06:56 AM
Hello fortpointuiguy,

 RadGridView is UI virtual control similar to other items controls like DataGrid, ListBox ,etc and working with UI parts of the grid like cells, rows, etc is highly unrecommended. The grid cells and rows will have different data every time you scroll - more about container recycling can be found here

I strongly suggest you to check our demos related to style and template selectors.

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
s2uiguy
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or