We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Does GridDataControl support cutomized right click menu?

Thread ID:

Created:

Updated:

Platform:

Replies:

95659 Jul 22,2010 08:03 PM UTC Oct 12,2010 10:12 AM UTC WPF 5
loading
Tags: GridControl
sgonline
Asked On July 22, 2010 08:03 PM UTC

Hi there,

I'm now doing something to bind a datatable to the GridDataControl, and I want to achieve the functionality that when I right click on a certain row of the grid control, a context menu will pop up and the user could select the entries to perform the according actions.

Is it possible to have that customizez context menu and their viewmodel in the grid?

Thank you very much.

Muthulakshmi N [Syncfusion]
Replied On July 23, 2010 11:35 AM UTC

Hi,

Thank you for your interest in our Syncfusion products.

By listening and handling” PreviewRightMouseButtonDown” event, you can achieve your requirement. Here we have prepared sample which illustrates your request. Please download the sample from the below location.

Link:
DataTableDemo.zip

Let us if you face any issue.

Thanks,
Muthulakshmi

Jimmy Ji
Replied On July 27, 2010 08:58 PM UTC

Thank you for you help.

But it seems that the attached file link is broken, I cannot download the sample from that link.

Could you please fix that? Thank you very much.

Muthulakshmi N [Syncfusion]
Replied On August 2, 2010 01:23 PM UTC

Hi,

Sorry for the broken link.
Please download the sample from the below link.

Link:
http://www.syncfusion.com/uploads/redirect.aspx?file=DataTableDemo_5b51536d_a33a198d.zip&team=development

Let us know if you need any details.

Thanks,
Muthulakshmi.N

John Baer
Replied On August 6, 2010 04:11 PM UTC

So I have two follow up questions on this post:

1) In multi-row selection mode, how do we prevent the right-click from changing the visible selection?

2) How do we detect that the right-click occurs only in the data area and not the header row or blank are below the data rows?

In the sample code provided in the post above, the following line of code is provided in an attempt to detect that the proper area has been clicked in. However, this code does not allow for detecting that a header row has been clicked and when clicking in the white space the last data row is used to popualte rci.

RowColumnIndex rci = dataGrid.Model.Grid.PointToCellRowColumnIndex(e.GetPosition(this.dataGrid));

Jeraldes J [Syncfusion]
Replied On October 12, 2010 10:12 AM UTC

Hi John,

Thanks for your patience.

1. We have an issue in this, when the multi selection is done and then by right clicking on the selected are it deselects. For this we request you to post an Incident in the Direct-Trac, we will surly update you with the solution.

2. To check whether the right click is done in the data cell or in the header cell, we have to check with the CellType. Through that the action can be performed.

Please refer the code snippet and sample from the following.

[Code Snippet]
RowColumnIndex rci = dataGrid.Model.Grid.PointToCellRowColumnIndex(e);
if (!rci.IsEmpty && this.dataGrid.Model[rci.RowIndex,rci.ColumnIndex].CellType=="TextBox")
{
}

[Sample Link]

http://www.syncfusion.com/uploads/redirect.aspx?file=GDC-PreviewMouseDown-95659_2c861cbd.zip&team=development

Let us know if you need any other details.

Regards,
Jeraldes J



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;