Solved

How to apply right click on gridview in asp.net?

Posted on 2014-02-19
3
4,145 Views
Last Modified: 2016-09-15
Sir/Ma'am

How to apply right click on gridview in asp.net?

Thanks in advance
0
Comment
Question by:hc_gupta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39870161
0
 
LVL 10

Expert Comment

by:Monica P
ID: 39873121
Refer :

http://www.c-sharpcorner.com/Blogs/11128/gridview-with-context-menu-in-Asp-Net.aspx

https://sites.google.com/site/spyderhoodcommunity/tech-stuff/jquerypopupcontextmenu

I have come across this code long before., Check whether below concept works ....

Context menu in Gridview (ASP.NET)

To implement contextmenu in asp.net, add this code on rowdatabound.

Protected Sub Grd_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles Grd.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then

e.Row.Attributes.Add("oncontextmenu", "return ShowMenu(" + e.Row.RowIndex.ToString() + ")")
RowIndex = e.Row.RowIndex
End If
End Sub


To popup the context menu, paste this code in header


<script language="javascript" type="text/javascript">
var Div = document.getElementById("DivContextMenu");

function HideMenu() {
Div.style.display = "none";
}
function ShowMenu(RowIndex) {
Div.style.display = "block";
return false;
}

</script>
0
 

Expert Comment

by:Aleksandra Nikolova
ID: 41800997
If you want you can see also shieldui contextmenu - it`s very easy to use
https://demos.shieldui.com/aspnet/contextmenu/basic-usage
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question