Hi ! I wish to do a customization for my dashboard, which will print a label and then clear the grid. I have issue in clear the grid. I coded “myGrid.datasource = null”, then it does clear everything including column headers.
Is there another method to clear the grid without clearing its column headers?
Hi ! I’ve added this line of code but I got an error as below;
‘Infragistics.Win.UltraWinGrid.RowsCollection’ does not contain a definition for ‘Clear’ and no extension method ‘Clear’ accepting a first argument of type ‘Infragistics.Win.UltraWinGrid.RowsCollection’ could be found (are you missing a using directive or an assembly reference?)’
It seems I missed an assembly reference. May I know which one should I add in?
Clearing the grid is not really the appropriate action here you are breaking the Epicor Binding.
Have you considered @Chris_Conn 's suggestion of adding a row rule or a filter the grid to hide the rows as they print?
Another option is to flag a field when the label prints which automatically removes it from your BAQ. Then refresh your dashboard.
I’ve tried to add these methods, and put into button method to call these methods when the button is clicked.
It did clear all the rows, but it will clear the columns also. When I refresh the dashboard, the columns will come out again but it will lose its initial column properties (bold text, wrap text).
Sorry that I did not explain my objective clearly. Before users print the label in dashboard, users will call out a list of item and then select one of them to print out. My attempt is once users click on “Print” button, it will clear all the rows in the grid. We require users to input criteria and refresh if they want to print next label.
Therefore, if I got to use filter rule to hide all the rows in dashboard, I may need to use a loop to set all the rows hidden so it seems clear all the rows.
Am I missing a method that can hide all rows in one time?
Do you mean that we could call Clear Tool method in customization? I was trying to look for the code but so far I didn’t find any of it. I agree with you that this is the proper way to do that. I will continue to search for it. Let me know if you have the code, I would really appreciate it !