buttons on gridview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mala mary
    New Member
    • Mar 2012
    • 4

    buttons on gridview

    i have a gridview with more than ten columns. I just have to display only a few selected columns for the user as soon as he opens the website. Once a button is clicked, all those ten columns should be displayed in either grid veiw or in the form of a tree. can you pls help me out on this?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You could use CSS to accomplish this.
    Set the columns so that they have a style of "display:no ne" and when the user clicks the button either use JavaScript to change the style or post back to the server and remove the style there.

    -Frinny

    Comment

    • mala mary
      New Member
      • Mar 2012
      • 4

      #3
      Thank you for your reply. but what i actually wanted is to place a button inside a gridveiw but i am not able to write a code for that.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        You can use a TemplateField column to display a column with a button in it.

        Or you could use a CommandField to generate a column with Select or Edit or Delete button/link in it.


        -Frinny

        Comment

        • mala mary
          New Member
          • Mar 2012
          • 4

          #5
          Is there a way where, on clicking a button, only that particlar row data get displayed on another page with the data being displayed one after the other(like in rows not in columns)?

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Yes, this solution requires JavaScript.

            When clicking the row, you would use JavaScript to open another window and pass it the information necessary to display the data in the other screen. You could pass this information via the JavaScript, or you could have the window display another page in your application and pass the ID of the information to display via the QueryString/URL...or you could use cookies ....

            Look into the JavaScript window opener property.
            There are too many possible ways to display the data, so try something that makes sense to you.

            -Frinny

            Comment

            Working...