or
| Dim objDT As System.Data.DataTable |
| Dim objDR As System.Data.DataRow |
| Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource |
| objDT = Session("Cart") |
| RadGrid1.DataSource = objDT |
| End Sub |
| Protected Sub RadGrid1_ItemDeleted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles RadGrid1.ItemDeleted |
| ' Some code to delete |
| End Sub |
| Private Sub makeCart() |
| If IsNothing(Session("Cart"))Then |
| objDT = New System.Data.DataTable("Cart") |
| objDT.Columns.Add("ID", GetType(Integer)) |
| objDT.Columns("ID").AutoIncrement = True |
| objDT.Columns("ID").AutoIncrementSeed = 1 |
| objDT.Columns("ID").Unique = True |
| objDT.Columns.Add("Quantity", GetType(Integer)) |
| objDT.Columns.Add("ProductName", GetType(String)) |
| objDT.Columns.Add("ProductID", GetType(Integer)) |
| objDT.Columns.Add("Cost", GetType(Decimal)) |
| Session("Cart") = objDT |
| End Sub |
| <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GridLines="None" ShowFooter="True" AllowPaging="True" AllowAutomaticDeletes="True" PageSize="20" AllowAutomaticUpdates="True" OnNeedDataSource="RadGrid1_NeedDataSource"> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <MasterTableView DataKeyNames="ID" HorizontalAlign="NotSet" AutoGenerateColumns="False"> |
| <Columns> |
| <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> |
| <ItemStyle CssClass="MyImageButton" /> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridBoundColumn Aggregate="Count" DataField="ID" HeaderText="Product ID" |
| FooterText="Total products: " UniqueName="ID"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="ProductName" HeaderText="Product name" SortExpression="ProductName" |
| UniqueName="ProductName"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn Aggregate="Sum" DataField="Cost" HeaderText="Unit price" |
| FooterText="Total unit price: " UniqueName="Cost"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn Aggregate="Sum" DataField="Quantity" HeaderText="Qty" |
| FooterText="All units in stock: " UniqueName="Quantity"> |
| </telerik:GridBoundColumn> |
| <telerik:GridCalculatedColumn HeaderText="Total Price" UniqueName="TotalPrice" DataType="System.Double" |
| DataFields="Quantity, Cost" Expression="{0}*{1}" FooterText="Total Price: " |
| Aggregate="Sum" /> |
| <telerik:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" |
| UniqueName="DeleteColumn"> |
| <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> |
| </telerik:GridButtonColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
See a great url bellow
https://demo.magentocommerce.com/customer/account/create/
press submittbutton with out filling any any feilds
validation script are executing[ i dont think that it is going to server side]
how can i simulate this using telerik controls
| protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridEditFormItem && e.Item.IsInEditMode) |
| { |
| GridEditFormItem editFormItem = (GridEditFormItem) e.Item; |
| RadComboBox cmbRoles = editFormItem.FindControl("RoleCombo") as RadComboBox; |
| if (cmbRoles != null) |
| { |
| usersGrid.Controls.Add( |
| new LiteralControl("<script type='text/javascript'>window['RolesComboId'] = '" + |
| cmbRoles.ClientID + |
| "';</script>")); |
| } |
| } |
| function SetRoleVisibility(item) { |
| var cmbRoles = $find(window['RolesComboId']); |
| } |