DataGrid DataBind Source Detect?

Discussion in 'ASP .Net Datagrid Control' started by bdwise, Nov 5, 2003.

  1. bdwise

    bdwise Guest

    I have a datagrid and I want to change behavior if the datasource it
    is binding to is a datatable or dataview. How can my datagrid know
    what the control type is?
    bdwise, Nov 5, 2003
    #1
    1. Advertising

  2. Hi

    > I have a datagrid and I want to change behavior if the datasource it
    > is binding to is a datatable or dataview. How can my datagrid know
    > what the control type is?


    if(dataGrid.DataSource is DataTable)
    {
    .... is datatable ...
    }

    if(dataGrid.DataSource is DataView)
    {
    .... is dataview ...
    }

    Ciao
    Giorgio
    Giorgio Parmeggiani, Nov 5, 2003
    #2
    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. Admin
    Replies:
    0
    Views:
    650
    Admin
    Jul 8, 2003
  2. Jim Heavey

    DataGrid DataBind

    Jim Heavey, Nov 12, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    376
  3. New User
    Replies:
    0
    Views:
    336
    New User
    Jan 7, 2004
  4. Joe
    Replies:
    0
    Views:
    398
  5. Michael
    Replies:
    0
    Views:
    205
    Michael
    Dec 29, 2003
Loading...

Share This Page