cannot use DataRowView in ONItemBound event if datagrid datasource is Datareader?

Discussion in 'ASP .Net Web Controls' started by rockdale.green@gmail.com, Jun 7, 2006.

  1. Guest

    private void dgrid_OnItemDataBound(object sender,
    System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    if(e.Item.ItemType ==ListItemType.Item||e.Item.ItemType
    ==ListItemType.AlternatingItem)
    DataRowView drv = (DataRowView)e.Item.DataItem;

    it caught error.


    but if I change the datasource to DataTable then it is ok.


    Is it true we cannot use DataRowView in ONItemBound event if datagrid
    datasource is Datareader?


    thanks
    -Rockdale
     
    , Jun 7, 2006
    #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. Jake S
    Replies:
    2
    Views:
    1,696
    KathyB
    Jul 6, 2003
  2. trinitypete

    DataGrid OnItemBound find control

    trinitypete, Aug 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    931
    trinitypete
    Aug 1, 2003
  3. MS
    Replies:
    0
    Views:
    3,219
  4. Henri
    Replies:
    0
    Views:
    594
    Henri
    Aug 3, 2004
  5. rockdale
    Replies:
    0
    Views:
    519
    rockdale
    Jun 7, 2006
Loading...

Share This Page