Austrian Pine
04-07-2008, 11:28 PM
I'm a newbie. I have a DataGrid backed by XML data. As the user selects a category of data, I need to filter what's seen in the list.
One option is to bind the data grid to an XMLList variable, and simply overwrite the XMLList reference via a simple xpath statement. In other words, the user selects a category, and I run an event handler that runs a single xpath select on the original XML. This returns a new XMLList which I assign to the bound field -- very clean and simple.
The alternative is to use a XMLListCollection for the grid's dataProvider and update it via a filterFunction. I.e., when the user selects a category, I'd run refresh on the XMLListCollection, which would fire my filterFunction.
So it looks like there are two ways to do the same thing. Which is better?
One option is to bind the data grid to an XMLList variable, and simply overwrite the XMLList reference via a simple xpath statement. In other words, the user selects a category, and I run an event handler that runs a single xpath select on the original XML. This returns a new XMLList which I assign to the bound field -- very clean and simple.
The alternative is to use a XMLListCollection for the grid's dataProvider and update it via a filterFunction. I.e., when the user selects a category, I'd run refresh on the XMLListCollection, which would fire my filterFunction.
So it looks like there are two ways to do the same thing. Which is better?