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. How to access grid elements, on click event of Different button.

How to access grid elements, on click event of Different button.

Scheduled Pinned Locked Moved ASP.NET
csstutorialannouncement
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.
  • J Offline
    J Offline
    Jax_qqq
    wrote on last edited by
    #1

    I have used a datagrid in it's every column i used textboxes to be edit... but i don't want to use update button on this.... That's why i used a save button. On It's click event i want to save the information of Grid's text box...but not getting.... i have tried this - TextBox t1 = Page.FindControl("DataGrid_TextBox1"); but not working... Anuj Kamthan Software Developer

    R 1 Reply Last reply
    0
    • J Jax_qqq

      I have used a datagrid in it's every column i used textboxes to be edit... but i don't want to use update button on this.... That's why i used a save button. On It's click event i want to save the information of Grid's text box...but not getting.... i have tried this - TextBox t1 = Page.FindControl("DataGrid_TextBox1"); but not working... Anuj Kamthan Software Developer

      R Offline
      R Offline
      Rajiya
      wrote on last edited by
      #2

      Hi, In ur .aspx file, make the first column of ur datagrid as: Then in ur .aspx.vb file write functions to make the code functional. Private Sub DataGrid1_Edit(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.EditCommand setSessionValue("ProdId", e.Item.Cells(1).Text) DataGrid1.EditItemIndex = e.Item.ItemIndex DataGrid1_DataBind() End Sub //Here cell(6)in the datagrid is made editable. Private Sub DataGrid1_Update(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.UpdateCommand Dim pVendors As New ProductVendor() pVendors.setEnv(getDBConnectString, getUserLogin) pVendors.UpdatePreference(getSessionValue("ProdId"), CType(e.Item.Cells(6).Controls(0), TextBox).Text()) DataGrid1.EditItemIndex = -1 DataGrid1_DataBind() End Sub //In this way u can make any of the columns of ur datagrid editable by specifying the cell no of the column of the datagrid. Private Sub DataGrid1_Cancel(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.CancelCommand DataGrid1.EditItemIndex = -1 DataGrid1_DataBind() End Sub Try it out. Regards, Rajiya -- modified at 6:52 Thursday 9th March, 2006

      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