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

How to get all controls inside selectedRow of RadGridView

3 Answers 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ganesh Jagdale
Top achievements
Rank 1
Ganesh Jagdale asked on 14 Jul 2010, 06:17 AM
Hi Telerik,
            I want to access controls inside Selected Row of RadGridView.
what i did in one cell there are two hayperlinks in which I have given visibility converter. then converters works fine.
But when i select one hyperlink i want it's visibility to Collapse(This can be done) and  other hyperlink visibility to Visible.
How I can get other controls object of selcted Row
?

Please help me..
 Waiting for ur answer..


Thanks,
Ganesh 

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Jul 2010, 06:26 AM
Hello,

 You can use ChildrenOfType<>() and ParentOfType<>() methods from your hyperlink click event handler. Both are extension methods in Telerik.Windows.Controls namespace. 

Greetings,
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
0
Ganesh Jagdale
Top achievements
Rank 1
answered on 14 Jul 2010, 07:30 AM
Hi Vlad,
          Thanks for reply..
It wan't work. This may because everyrow contain Hyperlink control if we use ChildrenOfType<HyperlinkButton>() and ParentOfType<HyperlinkButton>() which object  will returns? 
I want on one click event  of hyperlink button , want second hyperlink object?
 
Please let me know whether there is other way to accomplish this..


Thanks,
Ganesh
0
Vlad
Telerik team
answered on 14 Jul 2010, 08:07 AM
Hello,

 As I said in my previous reply you can get the second hyperlink from the first hyperlink click event handler:

           var currentLink = (HyperlinkButton)sender;
            var parentRow = currentLink.ParentOfType<GridViewRow>();
            var otherLink = parentRow.ChildrenOfType<HyperlinkButton>().Where(l => l != currentLink).FirstOrDefault();

Best wishes,
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
Ganesh Jagdale
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ganesh Jagdale
Top achievements
Rank 1
Share this question
or