Binding DataGrid with DataViewManager

Discussion in 'ASP .Net Web Controls' started by Jiho Han, Feb 18, 2004.

  1. Jiho Han

    Jiho Han Guest

    I have a dataset with multiple tables in it. If I want to utilize
    DataViewManager to bind to the datagrid, how would I do that?
    I guess I am looking for the correct binding expression.

    For example, if I have an xml such as below:

    <associations>
    <association>
    <associationid>123</associationid>
    <fromid>a1</fromid>
    <fromobjecttypecode>1</fromobjecttypecode>
    <toid>b1</toid>
    <toobjecttypecode>2</toobjecttypecode>
    </association>
    <account>
    <accountid>a1</accountid>
    <name>Infinity Info</name>
    </account>
    <contact>
    <contactid>b1</contactid>
    <fullname>Jiho Han</fullname>
    </contact>
    </associations>

    Then I read it into the dataset and set default sort:

    XmlTextReader xtr = new XmlTextReader(dataXml, XmlNodeType.Element, null);
    dsAssociations.ReadXml(xtr);
    viewManager = new DataViewManager(dsAssociations);
    foreach (DataViewSetting dvs in viewManager.DataViewSettings)
    dvs.ApplyDefaultSort = true;

    Now when I come to bind it, what is the correct expression to get the
    "fullname" of the contact given accountid a1? I assume I need to apply a
    rowfilter somewhere first though.
    Thanks.
     
    Jiho Han, Feb 18, 2004
    #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. Jordan
    Replies:
    2
    Views:
    2,548
    Jordan
    Feb 10, 2004
  2. martin
    Replies:
    0
    Views:
    380
    martin
    Apr 21, 2004
  3. ack95
    Replies:
    0
    Views:
    2,021
    ack95
    Dec 14, 2006
  4. Using DataViewManager with a WebControls.DataGrid

    , Jun 16, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    167
    Teemu Keiski
    Jun 20, 2005
  5. Using DataViewManager with a WebControls.DataGrid

    , Jun 15, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    120
Loading...

Share This Page