scrollable gridview with fixed searched row in datagrid using wpf

谁说我不能喝 提交于 2019-12-11 14:11:37

问题


I'm trying to implement a "find" feature where the user can enter a value in a textbox (outside of the grid) then click a button to find the row that matches the search criteria. if the search item is found in the gridview that searched record has been fixed at top of the gridview and the remaining records are scrollable except the searched record . i need to show this criteria in wpf .please any one suggest me...

Thank you in advance..


回答1:


You will have a data grid on your view (xaml and xaml.cs) where you will bind the ItemsSource to an observable collection on your view model. You will take your input from your text box and put it through your search algorithm. The search algorithm will filter out data in the collection and you can just move the element you want in the collection to the front.




回答2:


It's a hard problem if you want to do it correctly. For freezing rows, see this: http://blogs.msdn.com/b/vinsibal/archive/2008/10/31/wpf-datagrid-frozen-row-sample.aspx



来源:https://stackoverflow.com/questions/12852743/scrollable-gridview-with-fixed-searched-row-in-datagrid-using-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!