or
| <telerik:radscriptblock runat="server" ID="radScriptBlock"> |
| <script type="text/javascript"> |
| function openCustomerLookupWindow() |
| { |
| var txtNo = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>"); |
| var txtCoNam = $find("<%= txtExistingCustomerSearchCompanyName.ClientID %>"); |
| var txtCPN = $find("<%= txtExistingCustomerSearchContactPerson.ClientID %>"); |
| var txtCity = $find("<%= txtExistingCustomerSearchCity.ClientID %>"); |
| var cboState = $find("<%= cboExistingCustomerSearchState.ClientID %>"); |
| var oWnd = window.radopen('../../Lookups/NavCustomerLookup.aspx?navco=<%=session("SP_SearchCustomerNavCompany")%>&no=' + txtNo.get_value() + '&conam=' + txtCoNam.get_value() + '&cpn=' + txtCPN.get_value() + '&city=' + txtCity.get_value() + '&state=' + cboState.get_value() + '',"winCustomerLookup"); |
| //oWnd.argument = combo.get_value(); |
| oWnd.Center(); |
| //oWnd.SetSize(800,500); |
| } |
| function clientShow(sender, eventArgs) |
| { |
| //var txtDate = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>"); |
| //sender.argument = txtDate.get_value; |
| //sender.argument = document.getElementById('<%=txtExistingCustomerSearchCustomerNo.ClientID%>').innerText; |
| } |
| function clientClose(oWnd,args) |
| { |
| var txtNo = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>"); |
| var txtCoNam = $find("<%= txtExistingCustomerSearchCompanyName.ClientID %>"); |
| var txtCPN = $find("<%= txtExistingCustomerSearchContactPerson.ClientID %>"); |
| var txtCity = $find("<%= txtExistingCustomerSearchCity.ClientID %>"); |
| var cboState = $find("<%= cboExistingCustomerSearchState.ClientID %>"); |
| //get the transferred arguments |
| var arg = args.get_argument(); |
| if(arg) |
| { |
| var CustomerNo = arg.CustomerNo; |
| var CompanyName = arg.CompanyName; |
| var ContactPersonName = arg.ContactPersonName; |
| var CustomerCity = arg.CustomerCity; |
| var CustomerState = arg.CustomerState; |
| txtNo.set_value(CustomerNo); |
| txtCoNam.set_value(CompanyName); |
| txtCPN.set_value(ContactPersonName); |
| txtCity.set_value(CustomerCity); |
| cboState.set_value(CustomerState); |
| document.getElementById('pnlCustomerInfoCustomerData').style.display = 'none'; |
| } |
| document.forms[0].submit(); |
| } |
| </script> |
| </telerik:radscriptblock> |
| <telerik:radajaxpanel runat="server" LoadingPanelID="LoadingPanel" ID="AjaxPanel" Wrap="False" EnableAJAX="False"> |
| <asp:Panel ID="pnlCustomerInfoCustomerData" runat="server"> |
| </asp:Panel> |
| </telerik:RadAjaxPanel> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" |
| AutoGenerateColumns="False" GridLines="None" AutoGenerateDeleteColumn="False" |
| AutoGenerateEditColumn="False" Width="100%" Skin="Office2007"> |
| <AlternatingItemStyle BackColor="#EAF2FF" /> |
| <MasterTableView CommandItemDisplay="Top" DataKeyNames="BranchID" OverrideDataSourceControlSorting="true"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <CommandItemSettings AddNewRecordText="Add new Branch" /> |
| <Columns> |
| <telerik:GridTemplateColumn DataField="NotifyFlag" HeaderText="Notify?" SortExpression="NotifyFlag" |
| UniqueName="NotifyFlag" Visible="False"> |
| <EditItemTemplate> |
| <asp:CheckBox runat="server" ID="cbNotify" Checked='<%#convertBool(DataBinder.Eval(Container.DataItem, "Notifyflag"))%>' /> |
| </EditItemTemplate> |
| <ItemStyle HorizontalAlign="Left" /> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn DataField="Email" HeaderText="Email" SortExpression="Email" |
| UniqueName="Email" Visible="false"> |
| <ItemTemplate> |
| <%#DataBinder.Eval(Container.DataItem, "Email")%> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadTextBox runat="server" ID="txtEmail" Width="280px" Text='<%#DataBinder.Eval(Container.DataItem, "Email")%>' /> |
| <asp:RequiredFieldValidator runat="server" ID="rfvEmail" ControlToValidate="txtEmail" |
| Display="Dynamic" ErrorMessage="Email address required" Enabled="false"></asp:RequiredFieldValidator> |
| <asp:RegularExpressionValidator runat="server" ID="revEmail" Display="Dynamic" ControlToValidate="txtEmail" |
| ErrorMessage="Valid email required" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" /> |
| </EditItemTemplate> |
| <ItemStyle HorizontalAlign="Left" /> |
| </telerik:GridTemplateColumn> |
| <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Edit" Text="Edit" |
| UniqueName="EditColumn"> |
| <ItemStyle HorizontalAlign="Center" /> |
| </telerik:GridButtonColumn> |
| <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete" Text="Delete" |
| ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this Branch?" /> |
| </Columns> |
| <EditFormSettings ColumnNumber="1" CaptionFormatString="" FormTableItemStyle-HorizontalAlign="Left" |
| FormTableAlternatingItemStyle-HorizontalAlign="Left"> |
| <EditColumn ButtonType="PushButton" CancelText=" Cancel" UpdateText=" Save" |
| InsertText=" Save" UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| <FormMainTableStyle CellPadding="3" CellSpacing="0" BackColor="White"></FormMainTableStyle> |
| <FormCaptionStyle></FormCaptionStyle> |
| <FormTableItemStyle Wrap="False"></FormTableItemStyle> |
| <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> |
| <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> |
| </EditFormSettings> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <script type="text/javascript"> |
| function emailChanged(obj) { |
| if (obj.checked != true) { |
| var hiddenBox = document.getElementById("hdnRFV"); |
| var theRFV = document.getElementById(hiddenBox.value); |
| alert("Here1: " + hiddenBox.value); |
| ValidatorEnable(theRFV, false); |
| } else { |
| var hiddenBox = document.getElementById("hdnRFV"); |
| var theRFV = document.getElementById(hiddenBox.value); |
| alert("Here1: " + hiddenBox.value); |
| ValidatorEnable(theRFV, true); |
| } |
| } |
| </script> |
| Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound |
| ' sets the status of the validator based on the value of the NotifyFlag column |
| If (TypeOf e.Item Is GridEditableItem) AndAlso (e.Item.IsInEditMode) Then |
| Dim edititem As GridEditableItem = DirectCast(e.Item, GridEditableItem) |
| Dim myCheckBox As CheckBox = DirectCast(edititem("NotifyFlag").Controls(1), CheckBox) |
| myCheckBox.Attributes.Add("onclick", "emailChanged(this);") |
| Dim cntrl As HiddenField = DirectCast(FindControl("hdnRFV"), HiddenField) |
| cntrl.Value = DirectCast(edititem("Email").Controls(3), RequiredFieldValidator).ClientID |
| End If |
| End Subhelp |
| protected void gv_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| DataTable dt = new DataTable(); |
| dt.Columns.Add("Date"); |
| dt.Columns.Add("Double"); |
| dt.Rows.Add(new object[] {"14/08/2009","1.1" }); |
| dt.Rows.Add(new object[] { "20/08/2009", "10.1" }); |
| dt.Rows.Add(new object[] { "10/09/2009", "2.1" }); |
| dt.Rows.Add(new object[] { "25/09/2008", "2.1" }); |
| dt.Rows.Add(new object[] { "25/11/2009", "2.1" }); |
| dt.Rows.Add(new object[] { "1/1/2009", "2.1" }); |
| rg.DataSource = dt; |
| } |
| <telerik:RadGrid ID="rg" runat="server" AutoGenerateColumns="false" OnNeedDataSource="gv_NeedDataSource" |
| AllowSorting="true"> |
| <MasterTableView> |
| <Columns> |
| <telerik:GridBoundColumn DataType="System.DateTime" HeaderText="Date" DataField="Date" |
| UniqueName="Date" DataFormatString="{0:MM/yyyy}"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataType="System.Double" HeaderText="Double" DataField="Double" |
| ItemStyle-HorizontalAlign="Right"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
<telerik:RadListBox ID="lstOptions" runat="server" AllowDelete="True"
AllowReorder="True"
Skin="WebBlue" DataTextField="OptionText" DataValueField="FormattedValue"
Height="200px" Width="385px" AutoPostBack="False"
>
<ButtonSettings ReorderButtons="Common"></ButtonSettings>
<EmptyMessageTemplate>
<span style="color:Red;" > No options added! </span>
</EmptyMessageTemplate>
</telerik:RadListBox>