Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6610429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:50:23+00:00 2026-05-25T19:50:23+00:00

I am using an Asp:GridView with AutoGenerateColumns property set to true to display all

  • 0

I am using an Asp:GridView with AutoGenerateColumns property set to true to display all the fields.
But I am struck with a problem here.
I need to show only few columns not all..but I do not know them until run-time, like which fields to bind.

So, There are 2 sets of columns coming for me one with Prefix B_ and the other with Prefix R_
I need to show either B_ or R_ based on the radio button selection.

But I do not want to make separate call to the DB on radio button selection, So I am pulling all the data at once, when I am binding to the grid.

But the problem as I said it is showing all the columns but initially I want the grid to display only columns with prefix B_

Is there a way can I achieve this, Please do help me..

Thanks and appreciate your feedback.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:50:24+00:00Added an answer on May 25, 2026 at 7:50 pm

    I’d recommend loading them into two different sets of objects, and changing the value of the ItemsSource DataSource property when different radio button values are selected.

    EDIT: Replaced ItemsSource with DataSource, getting my ASP.NET and WPF mixed up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using asp.net 3.5 Gridview control, visual studio 2008. I have played with all the
I am using the ASP.NET3.5 gridview control in a new project. My problem is
I am facing a strange problem when using the gridview control in ASP.NET. I
I Have a and ASP.NET GridView which is set so <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False
<asp:GridView ID=grdUploadedFiles runat=server AutoGenerateColumns=False AllowPaging=True PageSize=7 DataKeyNames=ID OnRowEditing=grdUploadedFiles_RowEditing OnRowUpdating=grdUploadedFiles_RowUpdating OnRowCancelingEdit=grdUploadedFiles_RowCancelingEdit OnRowDeleting=grdUploadedFiles_RowDeleting ShowFooter=True ForeColor=Black GridLines=Vertical
I am using ASP.NET Membership and Linq. I have a problem here: I show
<asp:GridView ID=grid1 runat=server AutoGenerateColumns=False> <Columns> <asp:BoundField DataField='id' HeaderText=Id Visible=False /> <asp:BoundField DataField='Name' Visible=True HeaderText=Full
<asp:GridView ID=gvGrid runat=server AutoGenerateColumns=False DataSourceID=dsDataSource AllowPaging=True PageSize=20 > <Columns> <asp:BoundField DataField=Field1 HeaderText=Field1 SortExpression=Field1 />
Here is my ASP code: <asp:GridView ID=WagerTable runat=server AutoGenerateColumns=False CssClass=basix > <columns> <asp:BoundField DataField=GameName
I am using a multi page gridview to display bunch of data. Here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.