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. BoundFiled/GridView

BoundFiled/GridView

Scheduled Pinned Locked Moved ASP.NET
question
4 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.
  • M Offline
    M Offline
    Muc_
    wrote on last edited by
    #1

    Have some questions: Until now edit it so that when you click on the edittemplate appears. See Picture Is it possible to change it in such a way that the EditItemTemplate appears when you click on the BoundField ?

    P 1 Reply Last reply
    0
    • M Muc_

      Have some questions: Until now edit it so that when you click on the edittemplate appears. See Picture Is it possible to change it in such a way that the EditItemTemplate appears when you click on the BoundField ?

      P Offline
      P Offline
      PunkIsNotDead
      wrote on last edited by
      #2

      Hi! i've seen that you've solved your row sorting problem! nice! ;) but now your problem is? you have to read the RowUpdating event and also use the RowCommand event! if you click the 'edit' command, c# runs in RowUpdating event and then fires RowCommand (using e.CommandName as "Edit"). using this you can hide or make visible the columns. ex.

      foreach (GridViewRow r in GV_ServiciosDetalles.Rows)
      {
      ((Panel)r.FindControl("Panel1")).Style.Remove("display");//Make column visible true
      ((Panel)r.FindControl("Panel2")).Style["display"] = "none";//Make column visible false
      }

      So in panel 1 you have a label with Text='<%#Eval("YourBoundField")%>' and in panel 2 you have a textbox with same thing. good luck

      M 1 Reply Last reply
      0
      • P PunkIsNotDead

        Hi! i've seen that you've solved your row sorting problem! nice! ;) but now your problem is? you have to read the RowUpdating event and also use the RowCommand event! if you click the 'edit' command, c# runs in RowUpdating event and then fires RowCommand (using e.CommandName as "Edit"). using this you can hide or make visible the columns. ex.

        foreach (GridViewRow r in GV_ServiciosDetalles.Rows)
        {
        ((Panel)r.FindControl("Panel1")).Style.Remove("display");//Make column visible true
        ((Panel)r.FindControl("Panel2")).Style["display"] = "none";//Make column visible false
        }

        So in panel 1 you have a label with Text='<%#Eval("YourBoundField")%>' and in panel 2 you have a textbox with same thing. good luck

        M Offline
        M Offline
        Muc_
        wrote on last edited by
        #3

        Im usin a GridView, Edit, Update, Delete and Cancel are already exist. Below the Header: SkillGroup is the BoundField and i try to click of the Boundfield. i aint have no labels. Just boundfield visible ="true"

        P 1 Reply Last reply
        0
        • M Muc_

          Im usin a GridView, Edit, Update, Delete and Cancel are already exist. Below the Header: SkillGroup is the BoundField and i try to click of the Boundfield. i aint have no labels. Just boundfield visible ="true"

          P Offline
          P Offline
          PunkIsNotDead
          wrote on last edited by
          #4

          Using a css class

              .hiddencol /\*Make invisible the column\*/
              {
              	display:none;
              }
              
              .visiblecol /\*Make visible the column\*/
              {
              	display:block;
              }
          

          To hide / show the columns

          <asp:ButtonField ButtonType="Link" CommandName="Save" ItemStyle-CssClass="hiddencol" />
          <ItemTemplate>

          <ItemStyle CssClass="hiddencol" />
          </ItemTemplate>

          <ItemTemplate>

          <ItemStyle CssClass="visiblecol" /&;gt;
          </ItemTemplate>

          ;
          </ItemTemplate>

          then in your RowCommand you can change the 'visiblecol' style by 'hiddencol' and 'hiddencol' by 'visiblecol' like I've posted before

          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