Bind Repeater's DataRow to GridView's DataSource

Discussion in 'ASP .Net' started by wardemon, Nov 30, 2006.

  1. wardemon

    wardemon Guest

    Hi All,
    I was just wondering if the following is possible? To bind a
    GridView's datasource to the Repeater's current DataRow value.

    I tried creating a dataset, then load the datarowview inside it,
    however, this method would require a lot of things to do like, create a
    table, create columns for it, etc..

    I was wondering if there is more of a direct way to feed GridView's
    ..DataSouce to the Repeater's e.Item.ItemType's data.

    Thanks,
    Henry :)




    public void Main_OnItemDataBound(object sender,
    RepeaterItemEventArgs e)
    {
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    ListItemType.AlternatingItem)
    {

    ((GridView)e.Item.FindControl("gvwColumnDescriptions")).DataSource =
    ((DataRowView)e.Item.DataItem);

    ((GridView)e.Item.FindControl("gvwColumnDescriptions")).DataBind();

    }

    }
     
    wardemon, Nov 30, 2006
    #1
    1. Advertisements

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. guoqi zheng
    Replies:
    1
    Views:
    3,515
    Teemu Keiski
    Jun 10, 2005
  2. Nathan Sokalski
    Replies:
    5
    Views:
    5,978
    Elton Wang
    Sep 25, 2005
  3. RSH
    Replies:
    2
    Views:
    2,459
  4. Kieran
    Replies:
    0
    Views:
    457
    Kieran
    Dec 11, 2006
  5. Nathan Sokalski

    Accessing the current DataRow of the DataSource from ItemDataBound

    Nathan Sokalski, Sep 22, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    5
    Views:
    351
    Elton Wang
    Sep 25, 2005
  6. HelpPlease

    Datarow can't bind to datagrid...I need a workaround

    HelpPlease, Feb 11, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    1,067
    Marshal Antony
    Feb 12, 2004
  7. Nathan Sokalski

    Accessing the current DataRow of the DataSource from ItemDataBound

    Nathan Sokalski, Sep 22, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    310
    Elton Wang
    Sep 25, 2005
  8. bind a DataRow

    , Jan 5, 2007, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    234
Loading...