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

Editing a row by showing RadWindow when being double click

2 Answers 52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert Peter
Top achievements
Rank 1
Robert Peter asked on 04 Sep 2014, 03:01 PM
Editing a single row by showing a RadWindow with the data of a row on its fields. I want to do that by double clicking a row of RadGridView.

Here is my code snippet for EventHandler when double clicking:

1.private void grdProducts_MouseDoubleClick(object sender, MouseButtonEventArgs e)
2.{
3.  Product product = (sender as "not-sure-what-to-use-here-as-sender") as Product;
4.  ShowProductWindow(product);
5.}


Here is my code snippet for calling the RadWindow:
01.private void ShowProductWindow(Product product)
02.{
03. if (product != null)
04.    {
05.   ProductWindow productWindow = new ProductWindow(product, amazonContext);
06.   productWindow.Closed += ProductWindowClosed;
07.   productWindow.ShowDialog();
08. }
09.}


Can anyone help me to accomplish this? It would be a great help.

Regards,
RPM

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 08 Sep 2014, 11:17 AM
Hello,

You can subscribe for the RowActivated event of RadGridView and show RadWindow once the event is raised. Please note this event will be raised every time you double click or hit an Enter on a row.

As another option, I can suggest you to use the approach from the Click Events WPF demo. 

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Robert Peter
Top achievements
Rank 1
answered on 08 Sep 2014, 02:38 PM
I just solved my problem. What I did is:

Product product = grdProduct.SelectedItem as Product;
ShowProductWindow(product);
Tags
GridView
Asked by
Robert Peter
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Robert Peter
Top achievements
Rank 1
Share this question
or