Iterate DataGrid in Silverlight web application.
-
Hi All, I want to iterate all the rows of the DataGrid in my SilverLight web application.. Can anyone tell me how to iterate? I have googled, but no luck.... Thanks, Sunil G.
The usual way is not to work against the rows, but rather to work against the underlying data. With Silverlight and WPF it pays to stop thinking in the old ways of doing things, and embrace the rich databinding support along with a pattern such as MVVM.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
The usual way is not to work against the rows, but rather to work against the underlying data. With Silverlight and WPF it pays to stop thinking in the old ways of doing things, and embrace the rich databinding support along with a pattern such as MVVM.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
I found an exception to that particular rule. There does not seem to be a reasonable way to bind the SelectedItems of the gridview, I'm iterating them in the code behind and stuffing a list<> in the viewmodel.
Never underestimate the power of human stupidity RAH
-
Hi All, I want to iterate all the rows of the DataGrid in my SilverLight web application.. Can anyone tell me how to iterate? I have googled, but no luck.... Thanks, Sunil G.
Sunil G 3 wrote:
I have googled, but no luck....
Thats b/c is is WRONG, as Pete suggested use the underlying data collection
Never underestimate the power of human stupidity RAH
-
I found an exception to that particular rule. There does not seem to be a reasonable way to bind the SelectedItems of the gridview, I'm iterating them in the code behind and stuffing a list<> in the viewmodel.
Never underestimate the power of human stupidity RAH
You could do it by having an
IsSelected
property and update that if it's selected.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads