Hi,
I have a xamdatagrid with three levels of hierarchy. I want to add a search functionality like a text box at top, so when user starts typing it should highlight and scroll to the matched text. It should search for the text in all the parent and child grids. Can someone please suggest how to implement this.
Thanks,
Megha
Hello Megha,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I created a sample project for you with the functionality you want. Basically there is a search box and two buttons for previous and next item. When you click them you select the next matching record, but the hierarchy should be expanded, so that the records could be selected.
Feel free to write me if you have further questions.
Thank you for the solution. I used the same code except instead of having a LibraryBusinessLogic.cs file, I am binding my Xamadatagrid to a sql datasource (dataset). It searches only for the columns which are currently visible in the screen and if I scroll to the right none of the searched text is highlighted. Can you please suggest how can I search for the columns outside of visible screen view. I have approximately 110 columns which are getting generated dynamically through a stored procedure.
Could you please modify the sample I send you before, so it reproduces your issue or send me yours, so I can investigate it further for you because everything seems to work ok on my side.
Looking forward for your reply.
I tried setting the cellvirtualization to false but it is still not working. Can you please provide me a new solution to search text only in column headers and highlight them.
Since the XamDataGrid has a Cell Virtualization by default, the behavior you have is expected. In order to turn off the virtualization and make the sample works correctly you can set the XamDataGrid’s FieldSettings’ AllowCellVirtualization to False. Please let me know if this helps you or you need further assistance on this matter.