Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
129 views
Hi,

How to display the "Successfully Deleted" message at top of grid instead of at bottom of grid?

The following code add the new control at bottom of the grid but i want this to be added at top of grid as first row.

RadGrid1.Controls.Add(new LiteralControl("<span class='gridAlertMsg'>" + Convert.ToString(this.GetLocalResourceObject("fooo")) + "</span>"));


Thanks
Tapinder
Tapinder
Top achievements
Rank 1
 answered on 31 Jul 2009
2 answers
250 views
Dera Telerik Support,

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:

Line 31:        if (SelectedValue != null)
Line 32:        {
Line 33: var treevw = $find("<%= RadTreeView1.ClientID %>");Line 34:         var node = tree.findNodeByValue(SelectedValue);
Line 35:         node.select();

The following the ASPX page Code:

<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

Web Services
Top achievements
Rank 2
 answered on 31 Jul 2009
2 answers
98 views
Hi

I have a grid bound to an sqldatasource that displays a list of wines. No insert or update involved.
One of the fields contains the number of bottles per unit of sale: eg 1, 6 or 12.
I want display in that field, instead of the numbers, some words that correspond to these numbers eg:

Database value              Show text
 1                                  '1 bottle'
 6                                  'Case of 6 bottles'
 12                                'Case of 12 bottles'

Can you suggest how I could go about achieving this is the most efficient way?

Thanks

Clive
Clive Hoggar
Top achievements
Rank 1
 answered on 31 Jul 2009
2 answers
78 views

Hi,

After I upgraded my Rad controls to the latest version - Q2 2009, suddenly I started having issues. The solution is compiled without any errors. When I run the code I have the message: "A Runtime Error has occurred. Do you wish to Debug? Line:3 Error: Syntax Error". When I answer 'Yes', I see this line of code, that I believe is generated dynamically:
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');

If I disable all RadControls, I do not have this problem. I checked my web.config file and it seems to be in order. But I definately could've missed something.

Please help!

Here is my web.config file:

<?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>

DW Web Team Member
Top achievements
Rank 2
 answered on 31 Jul 2009
7 answers
214 views
Hello,

The datasource for my grid can can return from ten to tens of thousands records. I am using paging with 15 records per page and filtering. In a typical scenario, user gets first 15 records, then, depending on the number of records, locates the records he needs by paging and/or filtering. For cases of tens of thousands records, it makes sense to use customized paging with returning records for the current page only. I am not sure how it is going to work with filtering. My impression is that for filtering to work I need my datasource to return the full set of records, is that right?

What is the recommended way of filtering with customized paging?

Alternatively, how else can I optimize performance in my scenario?
Pavlina
Telerik team
 answered on 31 Jul 2009
2 answers
113 views
Hi,

I am using RadControls "Prometheus", version 2007.3.1425.35. With the RadEditor control, I am trying to control the styles that appear in the dropdown list for the "ApplyStyles" tool  button.  I point to an external CSS file using the <CssFiles> node in the RadEditor control, and all of the styles appear in the dropdown list.  However, when I try to restrict the ones that appear, and alias them with different names, using the <CssClasses> node, all of the classes in the CSS file still appear, and their names are not aliased.

Here is my CSS file:
.class1 {text-decoration:underline;color:Red} 
.class2 {font-weight:bold;font-size:20px} 
.class3 {font-size:10px;color:Gray} 

And here is my RadEditor:
        <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> 


As I understand things, the <CssClasses> node should restrict the control to only showing ".class1" and ".class2", and they should be aliased with the names "Class one" and "Class two" in the dropdown.  However, then I look at the dropdown that appears for the "ApplyClass" tool when I run the page, I still see all three styles, with their original names (class1, class2, and class3).

I have also tried this putting the <CssClasses> information in the ToolsFile.xml, as shown below, with the same results.  Here is the tools files I used:

<root> 
  <tools> 
    <tool name="FormatCodeBlock"/> 
    <tool name="ApplyClass"/> 
  </tools> 
  <classes> 
    <class name="Class one" value=".class1" /> 
    <class name="Class two" value=".class2" /> 
  </classes> 
 
</root> 

I noticed a similar post was made to the forum previously:

I downloaded the sample project and ran it  The referenced style sheet "EditorTestStylesheet.css" was missing from the download, so I just put the following classes in the Default.aspx page:

    <style> 
        .FeatureTitle {text-align:center;} 
        .StandardText {text-align:center;} 
        .NewText {text-align:center;} 
    </style> 

Once again,  the ones listed in the <CssClasses> node of the RadEditor were not aliases, and the one that was in the CSS but not in the <CssClasses> node still appeared.  The screen shot from that forum post also shows that the css classes were not aliased.  

My question is: how do I restrict which classes in the CSS file appear in the ApplyClasses dropdown, and how do I alias them with user-friendly names?

I would appreciate any assistance you could give me in the matter.  Thank you so much for your help.

Joe

Joseph Alfano
Top achievements
Rank 1
 answered on 31 Jul 2009
1 answer
146 views
Hi,

in my project i used masterpage and content page, in masterpage i have treeview ,when i click treeview the masterpage treeview also geeting postback, how to avoid master page postback?

Masterpage:

<%@ 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>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;|
              </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;">
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <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;">
             &nbsp;<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>

 

 

Pavlina
Telerik team
 answered on 31 Jul 2009
1 answer
130 views
Hi,

By default sort icons are placed to the right of column header text. Is it possible to place some of the sort icons to the left of text and other to the right? That would look better when some column headers are left aligned and other right aligned.
Pavlina
Telerik team
 answered on 31 Jul 2009
3 answers
190 views
Hi I have a web service I am trying to get working to bind data to grid:
 [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; 
        } 
the above doesnt work, anyone have an example of a working WCF webservice that is bound from a stored procedure?
Nikolay Rusev
Telerik team
 answered on 31 Jul 2009
0 answers
113 views
Hi,

We are experiencing a weird issue when we use both menu and context menu in a same page. We have a page, with menu and tree view controls. The menu does not contains any images and the text in that are left aligned with no 1px space.  In the tree view control we have a context menu with image before the menu text. Since the telerik menu and the context menu shares/uses the common stylesheets we could either have only the menu with text or with image and not both.  Whenever we try to open the context menu, the space in the top menu is also getting increased.

Our requirement is to have a menu with the left aligned text (both toplevel and sublevel) and the context menu with image and text in that. Is it possible to use different stylesheets for various menus?

Thanks & Regards,
Kamal
Kamalakannan D
Top achievements
Rank 2
 asked on 31 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?