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

[Solved] Problem in accessing cells in a GridView Row

1 Answer 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mathan lal
Top achievements
Rank 1
Mathan lal asked on 31 Dec 2009, 10:23 AM

Hi ,

I am using RadGridView in my silverlight application. Grid is created with static and dynamic cloumns as well. I have written some validations on  grdView_CellValidating event. To do the validation i want to access all the cells of the of the current row. Right now i am doing that with the following satement at the Cell validating event.

         e.Cell.ParentRow.Cells

Here i can't acees the one of the cell that is not viewable in the screen. I mean i have to scroll horizantally to see the cell. Actually the grid having 10 cells but e.Cell.ParentRow.Cell.Count is only 9 ( Last cell is excluded ).

But when i Edit the particular cell and fire the Cellvalidating event by pressing tab from the cell e.Cell.ParentRow.Cell.Count is returning Count as 10.

Please tell me that e.Cell.ParentRow.Cells is the right way to access all the cells of the current row ? or tell me what could be the
problem?

1 Answer, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 04 Jan 2010, 02:47 PM
Hello Mathan lal,

Due to horizontal virtualization some cells are not created until they do not come into visible area. I suggest you to use underlying data item which can be get as a DataContext of the e.Cell object. Another option is to disable horizontal virtualization with a code like this:

<telerik:RadGridView EnableColumnVirtualization="False">


Best wishes,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Mathan lal
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Share this question
or