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

Setting 'selectedItem' at button click

2 Answers 244 Views
GridView
This is a migrated thread and some comments may be shown as answers.
aa
Top achievements
Rank 1
aa asked on 25 Mar 2012, 09:54 AM

Hi there,

In my Radgridview, I have populated a list of objects.
I have added a culomn that contains a radButton with content = "Edit".
I have a nother window that will take an object as parameter, and opens it in the new window after clicking on Edit button.

The problem is:
when i click on Edit button inside the radgridview, It always sends the top row in the grid. I'm using "CurrentItem".
the selectedItem is always null unless i select the row by clicking it before pushing the Edit button.

My Question is:
How do i send the current row object (the row where the button was clicked) to the new window?

Thank you...
YSF

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 26 Mar 2012, 07:11 AM
Hello,

 You should the DataContext of the row itself - not the current or selected item. Please check this demo for more info. 

All the best,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
aa
Top achievements
Rank 1
answered on 26 Mar 2012, 08:47 AM
Thank you for the reply,

I have been to the same page before. but it deletes the row immidietly.

what i want, is how to send the object where the button was clicked to another window.
thank you so much..    

Tags
GridView
Asked by
aa
Top achievements
Rank 1
Answers by
Vlad
Telerik team
aa
Top achievements
Rank 1
Share this question
or