I am using Telerik RadGrid, i add a new button in the grid but how can i write an event for this button (Buy) for example when the user press (Buy) it will add this item to his cart with its price in order to calculate his bill.
regards
I am using Telerik RadGrid, i add a new button in the grid but
Share
You need to listen for the ItemCommand event:
In your codebehind
You may also need to set the
CommandArgumentduring theItemCreatedorItemDataboundevents, or get it using something likerg.MasterTableView.DataKeyValues[e.Item.Index]["ItemId"].ToString();after settingClientDataKeyNames="ItemId"in your MasterTableView settings part in the ascx file (if it is databound).