Hello Rolando,
Thank you for the detailed description of the issue. I suggest that you modify the Editing using popup menu example in the following manner:
1) Handle the ASPxClientGridView's ContextMenu event:
[ASPx]<ClientSideEvents ContextMenu="ShowContextMenu" />
2) Show the ASPxPopupMenu based on the coordinates of the event-related mouse pointer position relative to an end-user's screen using the event's e.htmlEvent parameters:
[JScript]function ShowContextMenu(s, e) { var x = ASPxClientUtils.GetEventX(e.htmlEvent); var y = ASPxClientUtils.GetEventY(e.htmlEvent); gridMenu.ShowAtPos(x, y); }
Thanks,
Mike
--------------------
Check if Search Engine is able to answer questions faster than I do!
--------------------
Hi There!
I tried follow your instructions but it didn't work for me :(
What I did?:
- I downloaded the example from http://www.devexpress.com/Support/Center/e/E38.aspx
- I comented the line of code
<dxwgv:GridViewDataColumn VisibleIndex="0">
<EditFormSettings Visible="false" />
<DataItemTemplate>
<a onclick="ShowContextMenu(this, <%# Container.VisibleIndex %>)" href="#">Edit</a>
</DataItemTemplate>
</dxwgv:GridViewDataColumn>
- I added <ClientSideEvents ContextMenu="ShowContextMenu" /> after tag </Columns>
- I Changed for js function ShowContextMenu
function ShowContextMenu(s, e) {
var x = ASPxClientUtils.GetEventX(e.htmlEvent);
var y = ASPxClientUtils.GetEventY(e.htmlEvent);
gridMenu.ShowAtPos(x, y);
}
- I added the ClientInstanceName="gridMenu" to ASPxPopupMenu
- After that i tried run the example and it doesn't work :(
After my that I downloaded the next http://www.devexpress.com/Support/Center/e/E723.aspx related with context menu on header columns but it doesn't work either... very strange because i don't need change anything for this code example.. are there problems with my machine?
The attached file is the same what located in http://www.devexpress.com/Support/Center/e/E723.aspx
Note: As you see i change some properties on this issue: (now I m working on win7 + vs2008)
Hello Rolando,
Thank you for the response. If you run the Editing using popup menu example under version 9.3.x, it's necessary to manually register the ASPxClientUtils scripts in the following manner:
[VB.NET]DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterUtilsScript(Page)
I've attached a sample project based on the Editing using popup menu example, illustrating how to implement the required functionality.
Thanks,
Mike
Thank you for your quick answer! :)
In relation with the example located in http://www.devexpress.com/Support/Center/e/E38.asp :
It's working the context menu in any place of the row, but now the option edit and delete are not doing anything :(. I supose is because the editingVisibleIndex is not seted by the grid or something like that...
What I should do to set the editingVisibleIndex??
Please let me know if you need more information from my side to reproduce my question :)
Note: if you prefer we can close this issue and start a new one:)
Hello Rolando,
Thank you for the response. In my previous post, I've attached a sample project where the ASPxGridView editing features are implemented. Please take a look at the attached video. It illustrates how these features work.
Concerning the editingVisibleIndex variable: it's necessary to store the active row's visibleIndex before showing the ASPxPopupMenu control. After that, it's necessary to pass the stored active row's visibleIndex to the corresponding ASPxClientGridView's method (such as the ASPxClientGridView.DeleteRow or StartEditRow) that requires visibleIndex as a parameter.
See Also:
ASPxClientGridView.Methods
Thanks,
Mike
Hi Mike,
I saw your video/example and now it's working well in my dev-pc :=)!!!
What is your sugestion is order don't show the first column?
dx:GridViewDataColumn VisibleIndex="0">
<EditFormSettings Visible="false" />
<DataItemTemplate>
<a onclick="ShowContextMenu(this, <%#Container.VisibleIndex%>)" href="#">Edit</a>
</DataItemTemplate>
</dx:GridViewDataColumn>
any choice?
I seted the property visible=False for the first GridViewDataColumn
something like that
<dx:GridViewDataColumn VisibleIndex="0" Visible="False">
<EditFormSettings Visible="false" />
<DataItemTemplate>
<a onclick="ShowContextMenu(this, <%#Container.VisibleIndex%>)" href="#"></a>
</DataItemTemplate>
</dx:GridViewDataColumn>
I think it's working.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+