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

[Solved] Single click on a row, to update some usercontrol

2 Answers 99 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.
Jingying Wu
Top achievements
Rank 1
Jingying Wu asked on 07 Jul 2009, 09:52 PM
I'm trying to achive the following.
Click on a row, another user control will be updated with the corresponding data.
And the CurrentItem is not getting the current clicked row.
I tried using CurrentRecord. same issue too.

It's always on the second call, that the currentItem becomes the correct clicked row.
Please help.
thanks.

 

void RadGridViewIndicator_RowLoaded(object sender, RowLoadedEventArgs e)

 

{

 

foreach (var cell in e.Row.Cells)

 

{

 

if (cell is GridViewHeaderCell)

 

 

continue;

 

cell.MouseLeftButtonDown +=

new System.Windows.Input.MouseButtonEventHandler(cell_MouseLeftButtonDown);

 

}

}

 

void cell_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)

 

{

 

object currentRecord = RadGridViewIndicator.CurrentItem;
}

2 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 08 Jul 2009, 07:55 AM
Hi Jingying Wu,

The CurrentItem is updated on mouse up - you just have to use the MouseLeftButtonUp event and you should be fine.

Best wishes,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jingying Wu
Top achievements
Rank 1
answered on 08 Jul 2009, 05:21 PM
Changing to cell.MouseLeftButtonUp sure fixed the issue.
Thanks.
Tags
GridView
Asked by
Jingying Wu
Top achievements
Rank 1
Answers by
Milan
Telerik team
Jingying Wu
Top achievements
Rank 1
Share this question
or