Solved

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

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

724 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