Using Same Datagrid for Different Data

Discussion in 'ASP .Net Datagrid Control' started by Jim Mitchell, Jun 30, 2003.

  1. Jim Mitchell

    Jim Mitchell Guest

    I am able to use the same datagrid to show two different sets of data.
    These seemed efficient to me.

    But what if I want the first column to be a "Select Button" for one set of
    data. For the second set of data I want only column 3 to be a "Select
    Button". In other words, I want the user to be able to pick an item from
    column 1 to view the bound text boxes in view 1 and I want the user to click
    on column 3 to view the data for bound textboxes in my alternate view.

    Can I set whether a colum is just data or used to select the row at run
    time?

    Thanks in advance.

    Jim

    Select Case page_name

    Case "Contacts"

    sql_string = "Select Contact, Phone from tblContacts where
    CompanyID=" & txtID.Text

    Case "Opportunities"

    sql_string = "Select OppName, OppValue, Probability from tblOpps
    where ID<200"

    End Select

    daAccountPages = New SqlClient.SqlDataAdapter(sql_string, Me.SqlConnection1)

    daAccountPages.Fill(dsAccountPages)

    dgAccountPages.DataSource = dsAccountPages

    dgAccountPages.DataBind()
     
    Jim Mitchell, Jun 30, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alexander N. Spitzer
    Replies:
    21
    Views:
    1,832
    Randolf Richardson
    Aug 16, 2004
  2. Fabrizio Pollastri
    Replies:
    2
    Views:
    352
  3. Christopher Brewster
    Replies:
    5
    Views:
    360
    John Machin
    Nov 14, 2008
  4. bluebaron
    Replies:
    3
    Views:
    773
    Jonathan N. Little
    Nov 4, 2009
  5. Guest
    Replies:
    2
    Views:
    194
    Foo Man Chew
    Dec 29, 2003
Loading...

Share This Page