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

How to access InvalidBorder of GridView Row, in Q1 2010?

1 Answer 10 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Virendra
Top achievements
Rank 1
Virendra asked on 17 Mar 2010, 09:28 AM
Hi,
How can i access InvalidBorder of the row in Q1 2010 release?
In older release i used to do 

void DataGrid_RowLoaded(object sender, RowLoadedEventArgs e)
{
Rectangle rect = e.Row.ChildrenOfType<Rectangle>() 
                  .Where(c => c.Name == "InvalidBorder")
                  .First() as Rectangle;

But in Q1 2010 release this statement gives exception 
 "Expression cannot contain lambda expressions"
exception message says "Sequence contains no elements"

thx
virendra

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Mar 2010, 11:28 AM
Hi Virendra,

This Rectangle was changed to Border - here is an example how to access this:

        private void RadGridView1_RowLoaded(object sender, RowLoadedEventArgs e)
        {
            var invalidElement = e.Row.ChildrenOfType<Border>()
                  .Where(c => c.Name == "Background_Invalid")
                  .FirstOrDefault();

            if (invalidElement != null)
            {
            
            }
        }

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
Virendra
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or