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. select an item in gridview

select an item in gridview

Scheduled Pinned Locked Moved Web Development
sysadminhelp
2 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.
  • P Offline
    P Offline
    ptvce
    wrote on last edited by
    #1

    I have a gridview with a checkbox column, i select a checkbox in a row and click edit button after that, edit button click_event i wrote this: grvWorkDetail.DataKeys[grvWorkDetail.SelectedIndex].Values["WorkTimeID"].ToString() but it has error, and i cant access to "WorkTimeID" my codebehind is :

    <asp:TemplateField ItemStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center">
    <HeaderTemplate>
    <asp:CheckBox ID="chk_SelectAll" runat="server" />
    </HeaderTemplate>
    <ItemTemplate>
    <asp:CheckBox ID="chk_Select" runat="server" />
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField ItemStyle-HorizontalAlign="Center"

    L 1 Reply Last reply
    0
    • P ptvce

      I have a gridview with a checkbox column, i select a checkbox in a row and click edit button after that, edit button click_event i wrote this: grvWorkDetail.DataKeys[grvWorkDetail.SelectedIndex].Values["WorkTimeID"].ToString() but it has error, and i cant access to "WorkTimeID" my codebehind is :

      <asp:TemplateField ItemStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center">
      <HeaderTemplate>
      <asp:CheckBox ID="chk_SelectAll" runat="server" />
      </HeaderTemplate>
      <ItemTemplate>
      <asp:CheckBox ID="chk_Select" runat="server" />
      </ItemTemplate>
      </asp:TemplateField>
      <asp:TemplateField ItemStyle-HorizontalAlign="Center"

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Please do not post the same question in multiple forums.

      One of these days I'm going to think of a really clever signature.

      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