views:

2341

answers:

2

I currently have an ASP.NET GridView that displays a few columns to the user with one of them being a link to view the details for the specific record. From the details page, the user has the ability to access other pages for adding new records (for example from the contact record page, you can click a link to add a new vehicle purchase).

What I think would be great is if there was a MouseOver or right click menu that would come up over the GridView row or any item really that would allow the user to go directly to the add new vehicle purchase page. I'd like to try and reduce the number of clicks of the mouse and page hits it takes to perform specific actions.

Are there any free components or code samples that can be provided for this? I know that I've seen it in some web apps before, just don't' want to re-invent the wheel.

The application I am working with is ASP.NET 3.5 and is already setup for jQuery use if that is needed for the solution... Below is a brief view of the code for my Grid. The first column is actually a hyperlink, but I removed it for this sample.

<asp:GridView ID="gvResults" runat="server" DataKeyNames="PERSONID" AutoGenerateColumns="False"
    CellPadding="4" ForeColor="#333333" OnSelectedIndexChanged="gvResults_SelectedIndexChanged"
    Width="100%" OnRowDataBound="gvResults_RowDataBound" meta:resourcekey="gvResultsResource1">
    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    <Columns>
        <asp:BoundField DataField="PERSONID" HeaderText="PERSON ID" meta:resourcekey="BoundFieldResource1" />
        <asp:BoundField DataField="FNAME" HeaderText="FIRST NAME" meta:resourcekey="BoundFieldResource2" />
        <asp:BoundField DataField="LNAME" HeaderText="LAST NAME" meta:resourcekey="BoundFieldResource3" />
        <asp:BoundField DataField="DOB" HeaderText="DATE OF BIRTH" HtmlEncode="False" meta:resourcekey="BoundFieldResource4" />
    </Columns>
    <EditRowStyle BackColor="#999999" />
    <EmptyDataTemplate>
        <span style="color: Red;">
            <asp:Literal ID="litErrorNoResultsFound" runat="server" EnableViewState="False" meta:resourcekey="litErrorNoResultsFoundResource1"
                OnInit="litErrorNoResultsFound_Init"></asp:Literal>
        </span>
    </EmptyDataTemplate>
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#3494CC" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
</asp:GridView>
+1  A: 

here is a very nice jQuery context menu.

http://abeautifulsite.net/notebook/80

demo: http://abeautifulsite.net/notebook_files/80/demo/jqueryContextMenu.html

Jon Erickson
How do you reckon one would append the row ID or Data Key to the link? For example on the edit... editperson.aspx?id=######
RSolberg
was able to do this with some hidden fields and windows.location =....
RSolberg
A: 

You could also try the sample code in the following approach. We can load the menu items dynamically too.

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

Kartik Sehgal