Solved

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

Posted on 2014-02-19
3
3,811 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now