context menu of GridView

C

CSharpGuy

Is it possible to create a 'context menu' for my GridView?
What I need to when the user clicks on a row in my gridview I need to show a
menu with links to a details page for that row of data.
 
B

Balasubramanian Ramanathan

You can do it in javascript..in onitemdatabound of the gridview for each
row add the required javascript in onmousedown

example


protected override void OnItemDataBound(DataGridItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType
== ListItemType.AlternatingItem))
{
e.Item.Attributes["onmousedown"] =
"javascript:YourMenuFunction();";


write the javascript for displaying the menu in YourMenuFunction()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top