Protected Sub btnCreateRates_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCreateRates.Click If txtCards.Text = Nothing Then MsgBox("Please type number of cards, in order to continue.", MsgBoxStyle.OkOnly, "ERROR") Exit Sub Else 'Confirmation() dtValues = DirectCast(Session("tblPendingOrders"), DataTable) ' retrieve DataTable from session Dim drValues As DataRow = dtValues.NewRow() GridID = grdData.MasterTableView.Items.Count + 1 drValues("ID") = GridID drValues("Address1") = txtAddress1.Text drValues("Address2") = txtAddress2.Text drValues("Address3") = txtAddress3.Text drValues("Cards") = txtCards.Value drValues("CardType") = "Virtual" drValues("CareOf") = txtCareOf.Text drValues("Charge") = txtCards.Value * GetCharge() drValues("City") = txtCity.Text drValues("Country") = txtCountry.Text drValues("MasterOf") = cbVessels.SelectedItem.Text drValues("Notes") = txtNotes.Text drValues("OrderRef") = txtOrderRef.Text drValues("Owning") = txtOwning.Text drValues("Price") = GetCharge() drValues("Provider") = cbProviders.SelectedItem.Text drValues("Units") = cbUnits.SelectedItem.Text drValues("Vessel") = cbVessels.SelectedItem.Text drValues("VesselID") = cbVessels.SelectedValue drValues("ZipCode") = txtZipCode.Text dtValues.Rows.Add(drValues) dtValues.AcceptChanges() Session("tblPendingOrders") = dtValues 'store DataTable in session grdData.Rebind() grdData.MasterTableView.IsItemInserted = False grdData.MasterTableView.Rebind() lblPendingOrders.Text = "Pending CCC Orders: " & grdData.MasterTableView.Items.Count End IfEnd SubProtected Sub grdData_ItemDeleted(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles grdData.ItemDeleted Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) Dim id As String = item.GetDataKeyValue("ID").ToString() If Not e.Exception Is Nothing Then e.ExceptionHandled = True SetMessage("Product with ID " + id + " cannot be deleted. Reason: " + e.Exception.Message) Else SetMessage("Product with ID " + id + " is deleted!") End IfEnd SubPrivate Sub SetMessage(ByVal message As String) gridMessage = messageEnd SubProtected Sub grdData_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles grdData.NeedDataSource dtValues = New DataTable() dtValues.Columns.Add("ID") dtValues.Columns.Add("CardType") dtValues.Columns.Add("Provider") dtValues.Columns.Add("Vessel") dtValues.Columns.Add("VesselID") dtValues.Columns.Add("Units") dtValues.Columns.Add("Cards") dtValues.Columns.Add("Price") dtValues.Columns.Add("Charge") dtValues.Columns.Add("Address1") dtValues.Columns.Add("Address2") dtValues.Columns.Add("Address3") dtValues.Columns.Add("CareOf") dtValues.Columns.Add("City") dtValues.Columns.Add("Country") dtValues.Columns.Add("MasterOf") dtValues.Columns.Add("Notes") dtValues.Columns.Add("OrderRef") dtValues.Columns.Add("Owning") dtValues.Columns.Add("ZipCode") If Session("tblPendingOrders") IsNot Nothing Then ' retrieve DataTable from session dtValues = DirectCast(Session("tblPendingOrders"), DataTable) End If grdData.DataSource = dtValues Session("tblPendingOrders") = dtValuesEnd SubProtected Sub grdData_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdData.ItemDataBound If TypeOf e.Item Is GridHeaderItem Then Dim header As GridHeaderItem = DirectCast(e.Item, GridHeaderItem) End If If TypeOf e.Item Is GridDataItem Then Dim dataItem As GridDataItem = CType(e.Item, GridDataItem) Price += dataItem("Price").Text Charge += dataItem("Charge").Text Cards += dataItem("Cards").Text End If If (TypeOf e.Item Is GridFooterItem) Then Dim footerItem As GridFooterItem = CType(e.Item, GridFooterItem) footerItem("Price").Text = Price footerItem("Charge").Text = Charge footerItem("Cards").Text = Cards footerItem("Provider").Controls.Add(New LiteralControl("<span style='color: Black; font-weight: bold;'>Totals:</span> ")) End IfEnd Sub
_updateFlipUI: function() { var horiz = this._flipHorizontal; var vertical = this._flipVertical; var filters = this._image.filters; //Moz TEMP if (!filters) return; filters.item("flipH").enabled = horiz ? 1 : 0; filters.item("flipV").enabled = vertical ? 1 : 0; },
_updateRotationUI: function()
{
var image = this._image;
//If IE
var filters = image.filters;
if (filters)
{
var filter = filters.item("DXImageTransform.Microsoft.Matrix");
if (filter)
{
//deg input defines the requested angle of rotation.
var deg = this._rotationAngle;
var deg2radians = Math.PI * 2 / 360;
var rad = deg * deg2radians;
var costheta = Math.cos(rad);
var sintheta = Math.sin(rad);
filter.M11 = costheta;
filter.M12 = -sintheta;
filter.M21 = sintheta;
filter.M22 = costheta;
}
}
}
//Will be different in different browsers _customInitialize: function() { //Set all filters to the image (TODO: the matrix filter in the future too) this._image.style.filter = "flipH flipV progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=100) progid:DXImageTransform.Microsoft.Matrix(M11='1.0', sizingmethod='auto expand')"; },<
telerik:RadComboBox ID="ddlFilterType" runat="server"
EnableEmbeddedSkins="false" DropDownWidth ="95px" Skin="MyBlack" BorderColor="Gray"
BorderWidth="1px" Width="120px" OnSelectedIndexChanged ="ddlFilterType_SelectedIndexChanged"
AutoPostBack ="true" AppendDataBoundItems ="true">
<Items>
<telerik:RadComboBoxItem runat="server" Height ="20" Text="State" Value="1" />
<telerik:RadComboBoxItem runat="server" Height ="20" Text="Provider" Value="2" />
<telerik:RadComboBoxItem runat="server" Height ="20" Text="Faculty" Value="3" />
</Items>
</telerik:RadComboBox>
div.RadToolBar .rtbUL { width: 100%; }div.RadToolBar .rightButton { float: right; }
I have a RadGrid that uses a GridTemplate column along with two Gridbutton columns called Edit and Delete and one link to ADD NEW RECORD.When I click on 'add new record' link to enter new record.In insert mode,treeview along with some textboxes get displayed with validation.What I want that onclick of Save button,it validate all textboxes along with treeview if it is enabled otherwise it should validate only textboxes.On 'PerformInsert' command ,I try to enable or disable that validator depending on the status of treeview.but it is not working.I try to change the Validation group also but still it is not working.
<telerik:RadGrid ID="radgridUserMgt" GridLines="None" runat="server" AllowAutomaticDeletes="true" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowSorting="true" AutoGenerateColumns="false" OnSortCommand="radgridUserMgt_SortCommand" OnItemCommand="radgridUserMgt_ItemCommand"> <mastertableview commanditemdisplay="TopAndBottom" datakeynames="UserID" itemstyle-horizontalalign="Left" alternatingitemstyle-horizontalalign="Left" autogeneratecolumns="false" editmode="EditForms" insertitemdisplay="Top"> <ItemStyle Font-Size="11px" /> <AlternatingItemStyle Font-Size="11px" /> <Columns> <telerik:GridTemplateColumn HeaderText="Email" UniqueName="Email" SortExpression="Email" ColumnEditorID="EmailColumnEditor" DataField="Email" > <ItemTemplate> <asp:Label runat="server" ID="lblEmail" Text='<%# AntiXss.HtmlEncode(Eval("Email").ToString())%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox MaxLength="100" runat="server" ID="txtEmail" Width="100px" Text='<%# Bind("Email") %>' ></asp:TextBox><span style="color: Red ;"><asp:RequiredFieldValidator ID="valReqFieldEmail" ControlToValidate="txtEmail" ErrorMessage="*" runat="server" Width="10px" ValidationGroup="ValidationGrp1" > </asp:RequiredFieldValidator><br /> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Business Email" UniqueName="BusinessEmail" SortExpression="BusinessEmail" ColumnEditorID="BusinessEmailColumnEditor" DataField="BusinessEmail" ItemStyle-Width="10px" > <ItemTemplate> <asp:Label runat="server" ID="lblBusinessEmail" Text='<%# AntiXss.HtmlEncode(Eval("BusinessEmail").ToString())%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox MaxLength="100" runat="server" ID="txtBusinessEmail" Width="100px" Text='<%# Bind("BusinessEmail") %>' ValidationGroup="ValidationGrp1" ></asp:TextBox><span style="color: Red;"><br /> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="SelectPartner" HeaderText="Select Partner" Visible="false" ColumnEditorID="SelectPartnerColumnEditor"> <ItemTemplate> <asp:Label runat="server" ID="lblSelectPartner" Text="Select Partner"></asp:Label> </ItemTemplate> <EditItemTemplate> <span> <telerik:RadTreeView ID="radSelectPartner" runat="server" CheckBoxes="True" Height="150px" TriStateCheckBoxes="true" CheckChildNodes="true" OnLoad="radSelectPartner_Load" ValidationGroup="ValidationGrp1"> </telerik:RadTreeView></span> <asp:RequiredFieldValidator ID="valReqFieldSelectPartner" runat="server" ErrorMessage="*" ControlToValidate="radSelectPartner" Width="10px" ValidationGroup="ValidationGrp1" EnableClientScript="true"> </asp:RequiredFieldValidator> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridButtonColumn HeaderText="Edit" CommandName="Edit" Text="Edit" ItemStyle-HorizontalAlign="Center" ButtonType="ImageButton" UniqueName="EditCommandColumn" ImageUrl="~/OneViewImages/edit.png"> </telerik:GridButtonColumn> <telerik:GridButtonColumn HeaderText="Delete" ButtonType="ImageButton" Text="Delete User" UniqueName="DeleteColumn" > </telerik:GridButtonColumn> </Columns> <EditFormSettings ColumnNumber="3"> <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="LightBlue" Width="100%" /> <FormTableStyle CellSpacing="0" CellPadding="2" Height="80px" Width="100%" BackColor="LightBlue" /> <FormTableAlternatingItemStyle Wrap="False" ></FormTableAlternatingItemStyle> <EditColumn ButtonType="ImageButton" InsertText="Add User" UpdateText="Update" UniqueName="EditCommandColumn1" CancelText="Cancel" > </EditColumn> <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> </EditFormSettings> </mastertableview> <ValidationSettings CommandsToValidate="PerformInsert,Update" ValidationGroup="ValidationGrp1" />