Hi,
I have a xamdatagrid which is bound to a collection.
My requirement is i should be able to restrict adding any new rows to the grid after i add 5 items in the Grid.
So i should be able to add only 5 rows in the grid.
Which event of grid i should write this code to restrict adding new rows after 5 items.
Please provide some code samples.
Thanks in advance
SNA
Then, you would have to check the count of the records/items in the CanExecute handler and return false if it is greater than 5.
Hi Alex,
But there is a problem here .I need to add items in the collection (for adding new row) in a command bound to a Context Menu.
So Command fires and the event RecordAdding never getting fired.
Please suggest.
Thanks
Thanks Alex ,
It helped.
Hello,
You can use the RecordAdding event and cancel that if you the count of the records in your data source is more than 5.
Hope this helps.