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

Getting row's data as a list

1 Answer 12 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Milad
Top achievements
Rank 1
Milad asked on 05 Jul 2019, 08:35 AM

Hi,

I'm working with VirtualGrid and I would like to send the selected row's data as a list to another page, when the user right clicks on a it.

Here is a simple version of my code:

List<xmlList> xmlListFilter = (xmlListMain.Where(x => x.Net == selectedNet).Where(x => x.Type == selectedType)).ToList();
DataProvider xml = new DataProvider(xmlListFilter);

virtualList.DataProvider = xml;

 

private void VirtualList_MouseRightButtonUp(object sender, MouseEventArgs e)
{
            EditPage editPage = new EditPage("The problem is here... How can I get the Values of the selected row");
            editPage.ShowDialog();
            editPage.Close();
}

 

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Dimitar Dinev
Telerik team
answered on 08 Jul 2019, 02:08 PM
Hi Milad,

Thank you for the code snippet.

Speaking generally, you can obtain the index of the row under the mouse with the approach suggested in the following article: Get the Row or Column Index of the Mouse Position. After that you can use that index in order to find the correct item in the source collection.

I am attaching a sample project demonstrating how to get the item under the clicked row. Please, check it out and let me know, if that is what you were going for.

Regards,
Dimitar Dinev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
VirtualGrid
Asked by
Milad
Top achievements
Rank 1
Answers by
Dimitar Dinev
Telerik team
Share this question
or