Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 21st, 2007, 12:13 PM
Registered User
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting Gridview Dynamically

I have a radio button list that I am using for c# visual studio 2005. I am trying to accomplish by selecting a button and hitting retireive, the gridview sqldatasource changes. It does it only once time and doesnt refresh with the new data source. Here is my sampel code can anyone tell me what I a am not doing right???:
  protected void submit(object sender, EventArgs e)
    {
        string //strName = RadioButtonList1.SelectedValue;
          strName = rbl_reports.SelectedItem.Text;
            switch (strName)
        {
            case "1":

                GridView1.DataSourceID = "SqlDataSource1";
                GridView1.DataBind();
               //GridView1.AutoGenerateColumns = true;

                break;
            case "2":

                GridView1.DataSourceID = "SqlDataSource2";
            GridView1.DataBind(); //GridView1.AutoGenerateColumns = true;


                break;
            case "3":

                GridView1.DataSourceID = "SqlDataSource3";
            GridView1.DataBind();

                break;
 
Old February 21st, 2007, 01:28 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi copelanda,

Is this related to the book ASP.NET 2 Instant Results? If so, what chapter / page is this code from?

Otherwise, I suggest you post this in one of the generic ASP.NET categories here at wrox.com.

Cheers,

Imar





Similar Threads
Thread Thread Starter Forum Replies Last Post
setting public strings dynamically havey C# 16 January 20th, 2008 12:04 PM
Setting onChange Event w/Dynamically Created Form rvanandel Javascript How-To 4 June 28th, 2007 08:10 AM
Dynamically Setting X, Y Coordiantes of Element [email protected] Javascript 4 August 21st, 2005 05:01 AM
Subform - Dynamically Setting mnoon Access 14 March 13th, 2005 07:33 PM
Setting stylesheet for dynamically created object tgopal Javascript 2 September 6th, 2004 11:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.