Binding DataGrid with DataViewManager

J

Jiho Han

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,099
Messages
2,570,626
Members
47,237
Latest member
David123

Latest Threads

Top