I originally posted this question in the MSDN WPF forums but since my questions were specific to the WPF Datagrid I thought I'd repost it here. Any help would be highly appreciated.
1) I use this datagrid in one of my applications and I use its ItemSource property to bind it to a collection. The datagrid properly displays all properties exposed by the object represented by the collection. However, is there a way to prevent
the datagrid from displaying certain properties as columns? For example, I use a marker property to determine if I need to highlight a particular row but the datagrid ends up displaying that property too as a column. How can I avoid this?
2) Is there a way I can push up a few rows to the very top of the datagrid? I have implemented a Find functionality which might take a partial input and highlights any row whose primary key matches the partial input. Initially I thought I'd
simply highlight the relevant items (which is why I use that marker property I mentioned in the previous point). The only problem happens when some rows are not in the visible area of the datagrid. If they are somewhere way down, obviously the
user will have to scroll down and see the hits. Therefore I was wondering if I could retrieve all the matching rows and move them to the top of the datagrid. Is this possible?