Results 1 to 2 of 2

Thread: Dinamic GridView

  1. #1

    Thread Starter
    New Member Visual Programmer AA's Avatar
    Join Date
    Dec 2025
    Posts
    1

    Question Dinamic GridView

    Hi everyone,

    Im recently programming with Visual .net 4.8. I am having trouble with a GridView that has multiple columns. There are 9 columns in total: 4 are always visible, but the others depend on the user's configuration.

    I am using the DataBound event to hide these columns. However, when I export the GridView to a TXT file, all columns appear in the output, including the hidden ones. I only want to export the columns that the user has chosen to see.

    Should I create a copy of the GridView and delete the unwanted columns before exporting, or is there a better way to handle this?
    What do you recommend?

    I paste a piece of my code:

    HTML Code:
     <asp:GridView ID="gridview_xxx"
         runat="server"
         AutoGenerateColumns="false"
         CssClass="table table-condensed"
         Font-Size="11px"
         Width="100%"
         ToolTip="xxx"
         CellPadding="4"
         GridLines="Both"
         ShowHeaderWhenEmpty="false"
         AllowPaging="false"
         PageSize="25"
         DataKeyNames="id,x1,x2,x3,x4,col1,col2,col3,col4,col5"
         OnRowCommand="xxx_RowCommand"
         OnRowDataBound="xxx_RowDataBound">
    Thanks!

    Visual Programmer A.A

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,370

    Re: Dinamic GridView

    Quick question, is this ASP.NET or ASP (classic)?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width