$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
GridView Row Command Items in ASP.NET AJAX
Home > How to > Grid Command Items

The CommandItem is a function button for commands that can do some action on the selected/all items. Kettic asp.net Grid control provide rich command items:
  • EditSelect: edit and update for a select item
  • Insert: add a new record to grid control
  • Refresh: refresh grid to view a new graphs
  • Rebind: rebind data to grid after change the data items
  • Export: export grid data to Word, PDF, Txt and CSV
  • Cancel: cancel the changes made by current user
  • Save: save the changes made by current user

Add Command Item to Gridview

Command Item is a row in the front of the headers. There are some action on the item, such as add new items, edit selected items, delete selected items and so on. For example, you can click the add row button to insert a new data grid row to the end of current rows, this client operation will postback to our grid component through javascript, and our web grid view control will add a new row for you.

<kettic:KaxGrid ID="KaxGrid1" runat="server" DataSourceID="SqlDataSource1"
AllowPaging="true" AlternatingItemStyle-BackColor="#dddddd">
<AlternatingItemStyle />
<MasterTableView Width="100%" CommandItemDisplay="Top" DataSourceID="SessionDataSource1"
<div style="padding: 5px 5px;">
Custom command item template&nbsp;&nbsp;&nbsp;&nbsp;
<asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'>
<img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" />Edit selected</asp:LinkButton>&nbsp;&nbsp;
<asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='&lt;%# RadGrid1.EditIndexes.Count > 0 %>'>
<img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.gif" />Update</asp:LinkButton>&nbsp;&nbsp;
<asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='&lt;%# RadGrid1.EditIndexes.Count > 0 ||
RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.gif" />Cancel editing</asp:LinkButton>&nbsp;&nbsp;
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'>
<img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />Add new</asp:LinkButton>&nbsp;&nbsp;
<asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'>
<img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" /> Add this Customer</asp:LinkButton>&nbsp;&nbsp;
<asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected suppliers?')"
runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" />
Delete selected customers</asp:LinkButton>&nbsp;&nbsp;
<asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;"
alt="" src="Images/Refresh.gif" />Refresh customer list</asp:LinkButton>
set grid view command item of row in asp.net ajax using c#