Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8166287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:48:40+00:00 2026-06-06T19:48:40+00:00

In a jQGrid , when I double-click a row, I want to open another

  • 0

In a jQGrid, when I double-click a row, I want to open another page that shows more data regarding the selected row. A query would need to be constructed based on the selected row and passed to that page. My jQGrid is dynamically created based on who logs in. I am a software student and I don’t know what to do. I’ve searched online but have got nowhere. Please can you help. If you need more info, please let me know.

<trirand:JQGrid ID="JQGrid1" runat="server" Width="760px" onsearching="JQGrid1_Searching" >         
    <Columns>

    </Columns>

    <PagerSettings ScrollBarPaging="true" PageSize="100" NoRowsMessage="Scroll to bottom to retrieve new page" />
    <AppearanceSettings HighlightRowsOnHover="true" /> 
    <ToolBarSettings ShowAddButton="true" ShowSearchToolBar="true" ShowRefreshButton="true" />
    <AddDialogSettings ReloadAfterSubmit="true" Caption="Add a new row" SubmitText="Add the row" Resizable="false" />   

</trirand:JQGrid>

Functions:

public static DataTable GetAnimalsByClient(Client cli)
{
    DataTable dt = new DataTable();

    try
    {
        MySqlConnection connection = Database.Connect();
        string sql = string.Format("select a.animal_official_tag as AnimalOfficialTag, DATE_FORMAT(a.animal_date_of_birth,'%d/%m/%Y') AS DateOfBirth, a.animal_gender as AnimalGender, a.animal_breed as AnimalBreed, a.animal_jumbo as AnimalJumbo from animal a inner join herd_animal ha on a.animal_id = ha.animal_id join herd h on ha.herd_id = h.herd_id join client c on h.client_id = c.client_id where c.client_id = {0}", cli.ID);
        MySqlDataAdapter adapter = new MySqlDataAdapter(sql, connection);

        adapter.Fill(dt);
        adapter.Dispose();

        Database.Disconnect(connection);
    }
    catch (Exception exp)
    {
        StackFrame stackFrame = new StackFrame();
        MethodBase methodBase = stackFrame.GetMethod();
        Error.SaveError(methodBase.Name, exp.Message);
    }
    return dt;
}


public DataTable GetCurrentStock()
{
    try
    {
        DataTable dt = (DataTable)AnimalDao.GetAnimalsByClient(UserSession.GetClient());

        List<DataColumn> lstCol = new List<DataColumn>();
        foreach (DataColumn col in dt.Columns)
        {
            lstCol.Add(col);
        }

        for (int i = 0; i < dt.Columns.Count; i++)
        {
            JQGridColumn col = new JQGridColumn();
            col.DataField = lstCol[i].ColumnName;
            col.HeaderText = lstCol[i].ColumnName;
            col.Width = lstCol[i].ColumnName.Length;
            col.Visible = true;
            col.Editable = true;
            JQGrid1.Columns.Add(col);
        }

        return dt;
    }
    catch (Exception exp)
    {
        return null;
    }
}

protected void Page_Load(object sender, EventArgs e)
{
    if (!UserSession.LoggedIn())
    {
        Response.Redirect("Default.aspx");
    }

    RefreshGrid();
    JQGrid1.DataSource = GetCurrentStock();
    JQGrid1.DataBind();      
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:48:42+00:00Added an answer on June 6, 2026 at 7:48 pm

    I would just create a javascript function to send a query string with the RowID to a new page.

    You can get the RowID of the selected row by:

    var grid = jQuery("#<%= JQgrid1.ClientID %>");
    var rowKey = grid.getGridParam("selrow");
    

    And then just use this to open a new window while sending the rowID to open the information you want:

    window.open("http://yourwebsite.com?RowID=" + rowKey);
    

    Then all you need to do is connect the double click event to the javascript function:

    <trirand:JQGrid ID="JQGrid1" runat="server" Width="760px"
            onsearching="JQGrid1_Searching"
            ClientSideEvents-RowDoubleClick="[function name]">
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using jqGrid I want to open a cell-editor on double-click , so my code
i have a jqgrid and when i double click a row, i call jquery
My jqGrid that does a great job of pulling data from my database, but
From JQGrid , on Double Click I am trying to navigate the user to
jqGrid tree nodes are read from server using json data. Click in node reads
jQgrid row is edited using inline editing mode. Pressing Enter sends data to server
jqGrid delete action button is used to delete row. This button click calls Edit
If jqGrid row ids (passed as separate id property from json data in server)
i starter in jqgrid, i want implement inline edit in jqgrid i have this
I'm using jqGrid and am having an issue with one cells data. The contents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.