PDA

View Full Version : Using selected index to display only certain items


handycam
08-04-2007, 02:44 AM
I have a datagrid displaying an xmllist. If I get the selected indices of this grid, how do I use that to display only those indices of the another grid?

For example:

xmllist1 = "A, "B", "C", "D", and datagrid1's dataprovider is xmllist1

The user clicks "B" in datagrid1, clicks a button and I capture datagrid1.selectedIndex.

xmllist2 = "1", "2", "3", "4".

I have datagrid2. i want to display "2" in this datagrid (the corresponding index item in the second list)

How do I do this?

dr_zeus
08-06-2007, 06:15 PM
I would add a filterFunction to the data provider of the second DataGrid. You can then use the selected indices to determine what must be displayed.

handycam
08-07-2007, 02:59 PM
filterFunctions are transition effects...

Could you be more specific?

dr_zeus
08-07-2007, 05:59 PM
The filterFunction property of an ICollectionView has absolutely nothing to do with transitions. When you set a DataGrid's dataProvider to an XMLList, it gets converted to an XMLListCollection, which implements ICollectionView. By setting a filterFunction on the dataProvider, you can specify which items are displayed in the DataGrid.