How can I set the SelectedNode.Value in the TreeView control which is inside the ComboBox Item Template from code behind file so it will show the node text in the ComboBox.
In code behind I'm retrieving the data from the database and move it to the corresponding controls on the page and everything fine except the ComboBox. It may need passing a value to JavaScript function from code behind which will do the rest of the job.
I added the following JavaScript function trying to accomplish the behavior
function selectNode(SelectedValue)
{
if (SelectedValue != null)
{
var treevw = $find("<%= RadTreeView1.ClientID %>");
var node = treevw.findNodeByValue(SelectedValue);
node.select();
var comboBox = $find("<%= RadComboBox1.ClientID %>");
comboBox.set_text(node.get_text());
}
}
But it produce the following error
Compiler Error Message: BC30451: Name 'RadTreeView1' is not declared.
Source Error:
|
<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0" dir=rtl>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>
<script type="text/javascript">
function comboLoad(sender, eventArgs)
{
sender.set_text(sender.get_items().getItem(0).get_value());
}
function nodeClicking(sender, args)
{
var comboBox = $find("<%= RadComboBox1.ClientID %>");
var node = args.get_node()
document.getElementById('<%=NodeValue.ClientID%>').value = node.get_value();
comboBox.set_text(node.get_text());
comboBox.trackChanges();
comboBox.get_items().getItem(0).set_value(node.get_text());
comboBox.commitChanges();
comboBox.hideDropDown();
}
function selectNode(SelectedValue)
{
if (SelectedValue != null)
{
var treevw = $find("<%= RadTreeView1.ClientID %>");
var node = treevw.findNodeByValue(SelectedValue);
node.select();
var comboBox = $find("<%= RadComboBox1.ClientID %>");
comboBox.set_text(node.get_text());
}
}
function StopPropagation(e)
{
if(!e)
{
e = window.event;
}
e.cancelBubble = true;
}
function OnClientDropDownOpenedHandler(sender, eventArgs)
{
var tree = sender.get_items().getItem(0).findControl("RadTreeView1");
var selectedNode = tree.get_selectedNode();
if (selectedNode)
{
selectedNode.scrollIntoView();
}
}
</script>
<telerik:RadComboBox ID="RadComboBox1" Runat="server" Height="200px"
Skin="Sunset" Width="348px">
<ItemTemplate>
<div ID="TreeDiv" onclick="StopPropagation(event)" dir=rtl>
<telerik:RadTreeView
ID="RadTreeView1"
Runat="server"
Height="350px"
Width="100%"
OnClientNodeClicking="nodeClicking" Skin="Sunset">
<CollapseAnimation Duration="100" Type="OutQuint" />
<ExpandAnimation Duration="100" />
</telerik:RadTreeView>
</div>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem Text="" />
</Items>
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</telerik:RadComboBox>
<input id="NodeValue" value="0" runat="server" enableviewstate="true" type="hidden" />
<input id="SelectedValue" value="0" runat="server" enableviewstate="true" type="hidden" />
</body>
Thank you
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<section name="securityCryptographyConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.CryptographySettings, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<securityCryptographyConfiguration>
<hashProviders>
<add algorithmType="System.Security.Cryptography.SHA256Managed, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" saltEnabled="false" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="SHA256Managed"/>
</hashProviders>
</securityCryptographyConfiguration>
<cachingConfiguration defaultCacheManager="Cache Manager">
<cacheManagers>
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="2000" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage"
type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Cache Manager" />
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="100" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage"
type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Daily Manager" />
</cacheManagers>
<backingStores>
<add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Null Storage" />
</backingStores>
</cachingConfiguration>
<appSettings>
<add key="Telerik.Skin" value="WWRDefault"/>
<add key="MasterView" value="Default"/>
</appSettings>
<connectionStrings/>
<system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add verb="*" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI" validate="false" />
<add verb="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" />
<add verb="*" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI" validate="false"/>
<add verb="*" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
<add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" />
</httpHandlers>
<httpModules>
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
</compilation>
<authentication mode="Forms">
<forms loginUrl="Membership/Login.aspx" name="CNAuth" requireSSL="false"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<sessionState timeout="30"/>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<location path="Skins">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Membership">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<system.runtime.remoting>
<application>
<channels>
<channel ref="http">
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
<client>
</client>
</application>
</system.runtime.remoting>
</configuration>
| .class1 {text-decoration:underline;color:Red} |
| .class2 {font-weight:bold;font-size:20px} |
| .class3 {font-size:10px;color:Gray} |
| <telerik:RadEditor ID="RadEditor1" Runat="server"> |
| <Tools> |
| <telerik:EditorToolGroup> |
| <telerik:EditorTool Name="ApplyClass" /> |
| </telerik:EditorToolGroup> |
| </Tools> |
| <CssFiles> |
| <telerik:EditorCssFile Value="StyleSheet.css" /> |
| </CssFiles> |
| <CssClasses> |
| <telerik:EditorCssClass Name="" Value="" /> |
| <telerik:EditorCssClass Name="Class one" Value=".class1" /> |
| <telerik:EditorCssClass Name="Class two" Value=".class2" /> |
| </CssClasses> |
| </telerik:RadEditor> |
| <root> |
| <tools> |
| <tool name="FormatCodeBlock"/> |
| <tool name="ApplyClass"/> |
| </tools> |
| <classes> |
| <class name="Class one" value=".class1" /> |
| <class name="Class two" value=".class2" /> |
| </classes> |
| </root> |
| <style> |
| .FeatureTitle {text-align:center;} |
| .StandardText {text-align:center;} |
| .NewText {text-align:center;} |
| </style> |
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Main_Master.master.cs"
Inherits="Web_Master_Pages_Main_Page" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >
<html>
<head id="Head1" runat="server">
<title>Focalpoint - Manager's Compensation Tool</title>
<link id="Link1" runat="server" />
</head>
<body style="margin: 0px; margin-left: 2px; background-color: Gainsboro;">
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="rsm" runat="server">
</telerik:RadScriptManager>
<table cellpadding="0" cellspacing="0">
<tr runat="server" id="WelcomeHeader" visible="false">
</tr>
<tr runat="server" id="MainHeader" visible="True">
<td style="width: 990px">
<table id="Table4" cellpadding="0" cellspacing="0" style="background-color: #96b2ca;
width: 990px;" border="0">
<tr>
<td style="height: 17px;" align="right">
<asp:Label ID="lblMainWelcome" runat="server" Font-Bold="true" Font-Size="12px" ForeColor="White"
Font-Names="Arial" Font-Italic="true"></asp:Label> |
</td>
</tr>
</table>
</td>
</tr>
<%--<tr runat="server" id="WelcomeSection" visible="False">
<td style="width: 990px">
<asp:ContentPlaceHolder ID="WelcomeContent" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>--%>
<tr runat="server" id="MainSection" visible="True">
<td style="width: 990px">
<table cellpadding="0" cellspacing="0" style="background-color: #F0F0F0;">
<tr>
<td>
<telerik:RadSplitter ID="RadSplitter1" Skin="WebBlue" runat="server" Width="990px"
Height="538px">
<telerik:RadPane ID="RadPane1" runat="server" Width="145px" BackColor="#F0F0F0">
<asp:UpdatePanel id="UpdatePanel1" runat ="server">
<ContentTemplate >
<table cellpadding="0" cellspacing="0" style="background-color: #F0F0F0;">
<tr>
<td style="width: 200px; background-color: #f0f0f0;">
<telerik:RadTreeView ID="MenuRadTreeView" SSL="true" runat="server" AutoPostBack="True"
OnNodeClick="MenuRadTreeView_NodeClick">
</telerik:RadTreeView>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</telerik:RadPane>
<telerik:RadSplitBar ID="RadSplitBar1" Width="450px" runat="server" CollapseMode="None" />
<telerik:RadPane ID="RadPane2" runat="server">
<asp:ContentPlaceHolder ID="MainContentPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
</telerik:RadPane>
</telerik:RadSplitter>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width: 990px">
<table id="Table3" style="height: 8px; background-color: #F0F0F0;" cellspacing="0"
cellpadding="0" width="990" border="0">
<tr>
<td style="background-color: white;">
<table id="Table1" style="height: 8px; background-color: #F0F0F0;" cellspacing="0"
cellpadding="0" width="990" border="0">
<tr align="left">
<td align="left" style="height: 20px;">
<asp:Image ID="LoadingImage" runat="server" ImageUrl="~/App_Images/images/saveTrpt.gif"
ImageAlign="texttop" Width="65" Height="13" />
<telerik:RadAjaxLoadingPanel ID="FooterAjaxLoadingPanel" runat="server">
<asp:Image ID="Image1" runat="server" AlternateText="Saving..." ImageUrl="~/App_Images/images/LoadingProgressBar.gif"
ImageAlign="Middle" />
</telerik:RadAjaxLoadingPanel>
</td>
<td align="left" style="height: 20px; padding-left: 10px;">
<asp:Label ID="SaveMessagelbl" runat="server" SkinID="GreenviewSkinLabel" Font-Bold="True"
Font-Size="11px" Style="font-family: Arial;" Width="660px" /></td>
<td align="right" bgcolor="whitesmoke" colspan="2" valign="top">
<asp:Image ID="Image2" runat="server" ImageUrl="~/App_Images/images/LaserBeam.gif" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Content page:
<%@ Page Language="C#" MasterPageFile="~/Web_Master_Pages/Main_Master.master" AutoEventWireup="true" CodeFile="xmlservices.aspx.cs" Inherits="Web_Pages_Dev_xml_xmlservices" Title="" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server">
<script type="text/javascript" src="../../Web_Javascript/Common.js">
</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" ClientEvents-OnRequestStart="xmlservicesconditionalPostback" runat="server" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="PanelXmlservices">
<UpdatedControls >
<telerik:AjaxUpdatedControl ControlID="PanelXmlservices" />
<telerik:AjaxUpdatedControl ControlID="MenuRadTreeView" />
<telerik:AjaxUpdatedControl ControlID="SaveMessagelbl" />
<telerik:AjaxUpdatedControl ControlID="LoadingImage" LoadingPanelID="FooterAjaxLoadingPanel" />
</UpdatedControls >
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<div align="left" style="background-color:White; height:535px;">
<asp:Panel ID="PanelXmlservices" runat="server" BackColor="white">
<table cellpadding="0" align="left" cellspacing="0" border="0" width="100%" style="background-color:white;">
<tr>
<td style="width: 800px;padding-left:20px;padding-top:20px;">
<div align="center" >
<asp:Panel ID="excelPanel" runat="server" Width="100%" >
<fieldset id ="fldexcel" runat ="server" style=" border-right: dodgerblue 1px solid; border-top: dodgerblue 1px solid; border-left: dodgerblue 1px solid; border-bottom: dodgerblue 1px solid; background-color: #ffffff; text-align: center;padding-Left:10px;">
<legend style="font-family:Arial; font-weight:bold; font-size:small; color: #000000;">
Load Spread Sheet</legend>
<table style="width: 781px">
<tr><td align="left">
<asp:Label ID="ccc" runat="server" Text="Template" Font-Names="Arial" Font-Size="Small"></asp:Label></td>
<td align="left" >
<asp:DropDownList ID="drpTemplate" runat="server" Width="150px" SkinID="DropDownSkin" AutoPostBack="True" OnSelectedIndexChanged="drpTemplate_SelectedIndexChanged">
</asp:DropDownList></td>
</tr>
<tr>
<td style="height: 28px" align="left">
<asp:Label ID="lblselectfile" runat="server" Font-Names="Arial" Text="Excel File"
Font-Size="Small"></asp:Label>
</td>
</tr>
<tr>
<td style="height: 28px" align="left">
<asp:Label ID="lblSheet" runat="server" Font-Names="Arial" Text="Sheet Name" Visible="true"
Font-Size="Small"></asp:Label></td>
<td style="height: 28px;" align="left">
<asp:TextBox ID="TxtSheetName" runat="server" Width="145px" Visible="true" ></asp:TextBox>
</td>
</tr>
</table>
<br />
<table>
<tr>
</tr>
<tr>
<td colspan="3">
<asp:Label ID="lblLocationpath" runat="server" Visible="false" Text="Label"></asp:Label>
<asp:Label ID="lblemsg" runat="server" Font-Bold="True" Font-Size="Smaller" ForeColor="Red" Font-Names="Arial"></asp:Label></td>
</tr>
</table>
</fieldset>
<br />
<br />
<table cellpadding="0" cellspacing="0" >
<tr >
<td>
<fieldset id ="fldexcelxml" runat ="server" style=" border-right: dodgerblue 1px solid; border-top: dodgerblue 1px solid; border-left: dodgerblue 1px solid; border-bottom: dodgerblue 1px solid; background-color: #ffffff; text-align: center;">
<legend style="font-family:Arial; font-weight:bold; font-size:small; color: #000000;">
Validate Spread Sheet</legend>
<br />
<telerik:RadGrid ID="Grdxmlvalidate" ShowFooter="True" EnableEmbeddedSkins ="false" runat="server" AllowPaging="true" PageSize= "5"
GridLines="None" AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center"
FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="left" HeaderStyle-Height="15px" EditItemStyle-Width="98%" OnPreRender="Grdxmlvalidate_PreRender" OnItemCommand="Grdxmlvalidate_ItemCommand" OnNeedDataSource="Grdxmlvalidate_NeedDataSource">
<MasterTableView EditMode="InPlace" DataKeyNames="xmlnum" Width="100%">
<Columns>
<telerik:GridTemplateColumn HeaderText="Sheet Name" UniqueName="TemplateColumn7" >
<ItemTemplate>
<asp:Label ID="lblsheetname" runat="server" Text='<%# Eval("sheetname") %>' Width="150px">
</asp:Label>
</ItemTemplate>
<HeaderStyle Width="150px" />
<ItemStyle HorizontalAlign ="left" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Schema" UniqueName="TemplateColumn7" Visible="false">
<ItemTemplate>
<asp:Label ID="lblschemaname" runat="server" Text='<%# Eval("xmlschema") %>'>
</asp:Label>
</ItemTemplate>
<HeaderStyle Width="120px" />
</telerik:GridTemplateColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
<ExpandCollapseColumn Visible="False">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<PagerStyle Mode="NextPrev" />
<ItemStyle Font-Bold ="true" Font-Names ="Arial" Font-Size ="11px" />
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
<HeaderStyle BackColor="#92B4E1" Height="15px" HorizontalAlign="Center" />
<FooterStyle Font-Bold="True" HorizontalAlign="Left" />
<EditItemStyle Width="98%" />
</telerik:RadGrid><br />
<asp:Button ID="btnvalidate" runat="server" Text="Validate" Enabled="false" OnClick="btnvalidate_Click" Font-Size="Smaller" />
</fieldset>
</td>
</tr></table>
<table>
<tr>
<td style="width: 443px">
<asp:GridView ID="GridViewerr" AutoGenerateColumns="false" runat="server" BackColor="White" Width="433px" >
<Columns>
<asp:TemplateField HeaderText="xmlnum" Visible="False">
<ItemTemplate>
<asp:Label ID="lblxmlnum" runat="server" Text='<%# Eval("xmlnum") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Possible errorneous columns">
<ItemTemplate>
<asp:Label ID="lblxmlerr" runat="server" Text='<%# Eval("valerr") %>'>
</asp:Label>
</ItemTemplate>
<HeaderStyle Font-Bold="True" Font-Names="arial" Font-Size="Smaller" ForeColor="White" />
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#2C8FC8" />
</asp:GridView>
</td>
</tr>
</table>
<asp:Label ID="lblerrdatatype" runat="server" SkinID="RedviewSkinLabel"></asp:Label><br />
</asp:Panel>
</div>
</td>
</tr>
</table>
</asp:Panel>
</div>
</asp:Content>
| [OperationContract] |
| public ResultData GetDataAndCount(int startRowIndex, int maximumRows, string sortExpression, string filterExpression) |
| { |
| GridBindingData data = RadGrid.GetBindingData("Waivenet.DataClassesDataContext", "productAttrib", startRowIndex, maximumRows, sortExpression, filterExpression); |
| ResultData result = new ResultData(); |
| //var products = DataClassesDataContext.uspGetProductsByCategory(SessionWrapper.userID); |
| //data.Data = DataClassesDataContext.uspGetProductsByCategory(SessionWrapper.userID); |
| result.Data = data.Data.OfType<DataClassesDataContext.uspGetProductsByCategory(SessionWrapper.userID)>().Select(p => new Product() |
| { |
| productID = p.productID, |
| productCode = p.productCode, |
| name = p.name, |
| description = p.description, |
| quantType = p.quantType, |
| sellPrice = p.sellPrice, |
| uom = p.uom, |
| imageThumb = p.imageThumb, |
| categoryID = p.categoryID |
| }).ToList(); |
| result.Count = data.Count; |
| Debug.WriteLine("row index: " + startRowIndex + ", max rows:" + maximumRows + ", sort expression: " + sortExpression + ", filter expression: " + filterExpression); |
| return result; |
| } |