Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. selecting a row in gridview

selecting a row in gridview

Scheduled Pinned Locked Moved ASP.NET
csharpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sunil Wise
    wrote on last edited by
    #1

    i have one button and one gridview in that i have filled data using

    public void GetData()
    { SqlConnection con = new SqlConnection(constr);
    string cmd = "select a.errname as ErrorName, m.errortype as ErrorType,
    a.errpointsdeducted as PointsDeduction, convert(varchar,a.createddate,104)
    as CreatedDate from auditerrors a,auditerrormaster m where
    a.errtypeid=m.internalid order by m.errortype";
    SqlDataAdapter da = new SqlDataAdapter(cmd,con);
    DataSet ds = new DataSet();
    DataTable dt = new DataTable();
    da.Fill(ds, "auditerrors");
    dt = ds.Tables["auditerrors"];
    gvAuditErrors.DataSource=ds.Tables[0];
    gvAuditErrors.DataBind();}

    in the same project i have another page with one text box in it. i want user to select a row in the gridview and click on the button to modify the createddate of that particular row (for this i have provided textbox in the other page, i want that selected row's date to be in the textbox control) if anybody got the solution plz do let me know tasks: selecting a row on double clicking the row transfering the content from first page to the other 2 hrs back i have posted the same question to C# forum but i did'nt got any sol. till now anyway my project is related to both the forums regards sunil

    J 1 Reply Last reply
    0
    • S Sunil Wise

      i have one button and one gridview in that i have filled data using

      public void GetData()
      { SqlConnection con = new SqlConnection(constr);
      string cmd = "select a.errname as ErrorName, m.errortype as ErrorType,
      a.errpointsdeducted as PointsDeduction, convert(varchar,a.createddate,104)
      as CreatedDate from auditerrors a,auditerrormaster m where
      a.errtypeid=m.internalid order by m.errortype";
      SqlDataAdapter da = new SqlDataAdapter(cmd,con);
      DataSet ds = new DataSet();
      DataTable dt = new DataTable();
      da.Fill(ds, "auditerrors");
      dt = ds.Tables["auditerrors"];
      gvAuditErrors.DataSource=ds.Tables[0];
      gvAuditErrors.DataBind();}

      in the same project i have another page with one text box in it. i want user to select a row in the gridview and click on the button to modify the createddate of that particular row (for this i have provided textbox in the other page, i want that selected row's date to be in the textbox control) if anybody got the solution plz do let me know tasks: selecting a row on double clicking the row transfering the content from first page to the other 2 hrs back i have posted the same question to C# forum but i did'nt got any sol. till now anyway my project is related to both the forums regards sunil

      J Offline
      J Offline
      John ph
      wrote on last edited by
      #2

      Call Javascript:Window.Open() method on the click of the record by passing the ID of the Selected Row as QueryString and then Query the Database for the neccessary details of the particular Record and show it on the popup page. window.Open("SecondPage.aspx?Id="+val)

      - Regards -
         JON


      Life is not measured by the amount of breaths we take, but by the moments that take our breath away.


      S 1 Reply Last reply
      0
      • J John ph

        Call Javascript:Window.Open() method on the click of the record by passing the ID of the Selected Row as QueryString and then Query the Database for the neccessary details of the particular Record and show it on the popup page. window.Open("SecondPage.aspx?Id="+val)

        - Regards -
           JON


        Life is not measured by the amount of breaths we take, but by the moments that take our breath away.


        S Offline
        S Offline
        Sunil Wise
        wrote on last edited by
        #3

        John Prabhu wrote:

        on the click of the record by passing the ID of the Selected Row as QueryString

        the main problem for me is passing ID of the selected row sir can you please tell me in detail how to pass the ID of the selected row if possible with example regards sunil

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups