Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
regex to allow alphanumeric characters and \ 2 26
getting id from database 5 24
Create XML 5 34
Adjust the position 3 14
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

12 Experts available now in Live!

Get 1:1 Help Now