datagrid data not there, but shows up in webpage

Discussion in 'ASP .Net' started by Narshe, Nov 15, 2005.

  1. Narshe

    Narshe Guest

    I have a datagrid that gets bound, and on itemdatabound, there is no
    data. If I look at datagrid.items, there is no data in the items
    either. When the page is displayed, the datagrid has all the data in
    it.

    What might be causing this?
    Narshe, Nov 15, 2005
    #1
    1. Advertising

  2. Narshe

    Narshe Guest

    I've figured one thing out. It works if the columns are BoundColumns,
    but if they are ItemTemplates, this doesn't work.

    How do I get row data out of rows that are item templates?
    Narshe, Nov 15, 2005
    #2
    1. Advertising

  3. In datagrid_ItemDataBound event you can get data from e.Item.ItemData. For
    example, if you use DataView, DataTable, or DataSet, as data source, you can
    cast e.Item.ItemData to DataRowView object then retrieve each data in the
    DataRowView:

    DataRowView drv = (DataRowView)e.Item.ItemData;
    string desc = drv[“descâ€].ToString();


    HTH

    Elton Wang


    "Narshe" wrote:

    > I've figured one thing out. It works if the columns are BoundColumns,
    > but if they are ItemTemplates, this doesn't work.
    >
    > How do I get row data out of rows that are item templates?
    >
    >
    =?Utf-8?B?RWx0b24gVw==?=, Nov 15, 2005
    #3
  4. In DataGrid did you set AutoGenerateColumns = False or True?
    Patrick


    "Narshe" <> wrote in message
    news:...
    > I've figured one thing out. It works if the columns are BoundColumns,
    > but if they are ItemTemplates, this doesn't work.
    >
    > How do I get row data out of rows that are item templates?
    >
    Patrick.O.Ige, Nov 16, 2005
    #4
    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. =?Utf-8?B?SGVtaWw=?=

    Home page on localhost shows script instead of webpage

    =?Utf-8?B?SGVtaWw=?=, Jan 11, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    726
    Ken Cox [Microsoft MVP]
    Jan 11, 2005
  2. gce
    Replies:
    0
    Views:
    763
  3. damezumari
    Replies:
    5
    Views:
    438
    damezumari
    May 13, 2008
  4. OccasionalFlyer

    Page shows in FIrefox, IE7 but not IE6

    OccasionalFlyer, Dec 4, 2008, in forum: HTML
    Replies:
    4
    Views:
    439
    Chaddy2222
    Dec 5, 2008
  5. Gianni

    IE shows false and Firefox shows true

    Gianni, Jul 10, 2009, in forum: Javascript
    Replies:
    3
    Views:
    448
    Thomas 'PointedEars' Lahn
    Jul 10, 2009
Loading...

Share This Page