|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Forcing DataView to sort/filter without calling Control.DataBind?I've noticed that applying a Sort and/or RowFilter property to a
DataView does not take effect until you bind the DataView to a control and call the control's DataBind method. I'm sure DataBind does some "magic" internally to apply the sort and filter (perhaps even generating a new DataView). Does anyone know how to force the DataView to sort/filter with calling a control's DataBind? Or even this there is some little-know method for re-generating the view? TIA Nevermind. Shortly after posting this I found what I was doing wrong:
I was (incorrectly) doing this: foreach (DataRow row in dataView.Table.Rows) instead of (correctly) doing this: foreach (DataRowView row in dataView) |
|||||||||||||||||||||||