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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How To Set TabIndex Inside The Gridview Template Fields?

How To Set TabIndex Inside The Gridview Template Fields?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
3 Posts 2 Posters 1 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.
  • P Offline
    P Offline
    Pawan Kiran
    wrote on last edited by
    #1

    Hi How To Set TabIndex inside Each Template Field.. Means On Pageload() i have 10 gridview rows so i want to set focus Gridview1.Rows[i].Cells[0]--as 1 Gridview1.Rows[i].Cells[1]--as 2 Gridview1.Rows[i].Cells[2]--as 3 --- --- --- But I am Getting The Tab For Rows[i].Cells[0]---10times Rows[i].Cells[1]--10times --- -----                  how to get the tabindex for each gridviewrowcell   Horizontally.. Thanks in advance..

    P 1 Reply Last reply
    0
    • P Pawan Kiran

      Hi How To Set TabIndex inside Each Template Field.. Means On Pageload() i have 10 gridview rows so i want to set focus Gridview1.Rows[i].Cells[0]--as 1 Gridview1.Rows[i].Cells[1]--as 2 Gridview1.Rows[i].Cells[2]--as 3 --- --- --- But I am Getting The Tab For Rows[i].Cells[0]---10times Rows[i].Cells[1]--10times --- -----                  how to get the tabindex for each gridviewrowcell   Horizontally.. Thanks in advance..

      P Offline
      P Offline
      Pawan Kiran
      wrote on last edited by
      #2

      Just set tabindex programatically.. It's solved the issue.. short tabindex = 29;                         for (int i = 0; i < GridViewMedicineDetails.Rows.Count; i++)                         {                               DropDownList DdlMedicine = ((DropDownList)(GridViewMedicineDetails.Rows[i].Cells[1].FindControl("MedicineName")));                               TextBox box2 = (TextBox)GridViewMedicineDetails.Rows[i].Cells[2].FindControl("Dosage");                               TextBox box3 = (TextBox)GridViewMedicineDetails.Rows[i].Cells[3].FindControl("Quantity");                               DdlMedicine.TabIndex = Convert.ToInt16(++tabindex);                               box2.TabIndex = Convert.ToInt16(++tabindex);                               box3.TabIndex = Convert.ToInt16(++tabindex);                         } But Remember the Gridrow count...

      T 1 Reply Last reply
      0
      • P Pawan Kiran

        Just set tabindex programatically.. It's solved the issue.. short tabindex = 29;                         for (int i = 0; i < GridViewMedicineDetails.Rows.Count; i++)                         {                               DropDownList DdlMedicine = ((DropDownList)(GridViewMedicineDetails.Rows[i].Cells[1].FindControl("MedicineName")));                               TextBox box2 = (TextBox)GridViewMedicineDetails.Rows[i].Cells[2].FindControl("Dosage");                               TextBox box3 = (TextBox)GridViewMedicineDetails.Rows[i].Cells[3].FindControl("Quantity");                               DdlMedicine.TabIndex = Convert.ToInt16(++tabindex);                               box2.TabIndex = Convert.ToInt16(++tabindex);                               box3.TabIndex = Convert.ToInt16(++tabindex);                         } But Remember the Gridrow count...

        T Offline
        T Offline
        Thabo Pali
        wrote on last edited by
        #3

        Your solution is somewhat correct, but it doesn't work for me cause i generate multiple lines during run time with the same controls so the tab only goes through the first column in the gridview then the others. Please help

        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