Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
105 views
Hi
I think that I've found bug in RadGrid.
When I wrote such code:

var radGrid = $find("RadGrid1"));
radGrid.add_command(function (sender, args) {
                        alert("script command handler"); 
                    });

I never saw alert window.
But after I've added on the server side:
        <ClientSettings>
            <ClientEvents OnCommand="function() {  alert("script command handler 2");  }" />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        </ClientSettings>

I saw 2 alerts.
So, now I live on server side:
<ClientEvents OnCommand="function() { }" />
And client handler works

Iana Tsolova
Telerik team
 answered on 25 Oct 2011
3 answers
252 views
Hi
I'm using the radchart in my application.
I need to set the height and width for the chart based on resolution of screen.
I try to on window.onload or window.resize.
But I'm getting the radchart null.

below is my code:

function ResizeRadChart() {
          var width = screen.width;
          var height = screen.height;
          var chrtObject = $find("<%= trndChrt.ClientID %>");
  
          switch (height) {
              case 1024:
                   //here i need set the chart height and width
                  break;
  
              case 960:
                   
                  break;
  
              case 864:
                    
                  break;
              case 768:
                    
                  break;
              case 720:
                   
                  break;
              case 600:
                    
                  break;
          }
      }
I'm getting null if I use the $find.
but I If I do like var chrtObject = $get("<%= trndChrt.ClientID %>");
I'm getting the object but not able to see height and width properties.
pls help me in this
Ves
Telerik team
 answered on 25 Oct 2011
1 answer
195 views
hello,

i am working on email functionality and recently i  am using rad uploader to upload files and send to mails through smtp connection ,the problem is if i send notepad  files it is uploading and sending to specified mailid ,but if we upload .pdf or .doc means  pdf or wordformat files e.t.c it is not sending  we are getting an error that file cannot found at path specified .i am sending a code block please reply soon
void SendEMail()
   {
       if (Session["UserID"] != null) //from home.aspx
       {
           newmailuserid = Convert.ToInt32(Session["UserID"]);
       }
       DbLayer objDB = new DbLayer();
       System.Net.Mail.MailMessage Message = new System.Net.Mail.MailMessage();
       Message.To.Add(rdtxtTo.Text);
       if (rdtxtCC.Text != string.Empty)
       {
           Message.CC.Add(rdtxtCC.Text);
       }
       Message.Subject = rdtxtSubject.Text;
       Message.Body = rdtxtBody.Text;
        
        
       System.Net.Mail.SmtpClient SmtpClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
       SmtpClient.EnableSsl = true;
       SmtpClient.Credentials = new System.Net.NetworkCredential("abc.hits.com", "hits@123");
       System.Net.Mail.MailAddress FromEmail = new System.Net.Mail.MailAddress(TextBox1.Text);
       Message.From = FromEmail;
             try
       {
           System.Net.Mail.Attachment attachment;
           foreach (UploadedFile file in RadUpload1.UploadedFiles)
           {
               try
               {
                   string strFileName = null;
                   strFileName = System.IO.Path.GetFileName(file.FileName);
                   attachment = new System.Net.Mail.Attachment(Server.MapPath(strFileName));
                   Message.Attachments.Add(attachment);
               }
               catch 
               {
               }
           }
           SmtpClient.Send(Message);
Genady Sergeev
Telerik team
 answered on 25 Oct 2011
3 answers
201 views
Hello,

Could anyone shed some light on the 'SelectedToggleStateIndex' and 'SelectedToggleState' properties??

It does not do anything here. 'SelectedToggleStateIndex' is always zero.

<telerik:RadButton ID="rbt_1" ButtonType="LinkButton" GroupName="0001" AutoPostBack="false" UseSubmitBehavior="False" ToggleType="Radio" Text="0-7" runat="server" />
<telerik:RadButton ID="rbt_2" ButtonType="LinkButton" GroupName="0001" AutoPostBack="false" UseSubmitBehavior="False" ToggleType="Radio" Text="8-27" runat="server" />
<telerik:RadButton ID="rbt_3" ButtonType="LinkButton" GroupName="0001" AutoPostBack="false" UseSubmitBehavior="False" ToggleType="Radio" Text="28-82" runat="server" />
<telerik:RadButton ID="rbt_4" ButtonType="LinkButton" GroupName="0001" AutoPostBack="false" UseSubmitBehavior="False" ToggleType="Radio" Text="83-100" runat="server" />

Thanks,

Erik
Kevin
Top achievements
Rank 2
 answered on 25 Oct 2011
5 answers
164 views
This was working for me, but can't figure out why not now...

I have a radMenu in a MasterPage.. disabled embedded skins.. styling with css.  The menu automatically added the 'rmFocused' class.. when applicable.

Now, I can't see what's different.. or why.. but it's no longer adding the class to the active tab.  SiteMap is the same, urls the same.. same stylesheets/declarations.. same properties.

Any ideas as to why? 
What factors affect whether menu adds it?  Not adds it?
I thought it was just a matching href to raw url??

Thanks!  D
Kate
Telerik team
 answered on 25 Oct 2011
1 answer
102 views
I'm working with the Telerik RadTreeView;

One objective for the functionality of the RadTreeView is to allow a User to either click the plus (+) sign (next to Node Name), or click the actual Node Name, and expand the Node;

<telerik:RadTreeView ID="RadTreeView1" runat="server"  
              
         OnNodeExpand="RadTreeView1_NodeExpand" ForeColor="Black" 
            Font-Names="Microsoft Sans Serif" 
            onnodeclick="RadTreeView1_NodeClick" Height="600px" Width="300px" 
                    Font-Size="Medium" OnClientNodeClicked="ClientNodeClicked">
                              
        </telerik:RadTreeView>

<script type="text/javascript" language="javascript">
    function ClientNodeClicked(sender, eventArgs) {
        var node = eventArgs.get_node();
        //alert("You clicked " + node.get_text());
        if (node) {
            node.expand();
        }
          
    }
</script>

The above code works briefly, and expands a selected RadTreeView Node for a split second; However, because the RadTreeView is being built dynamically in the C# code-behind, a post back occurs, and the expanded node quickly returns to an un-expanded state;

Thanks in advance for any insight;  Best regards - Rob
Plamen
Telerik team
 answered on 25 Oct 2011
4 answers
683 views
I have a web application project with the Telerik.Web.UI goodies in it (the latest and greatest version). Everything was fine until I started working with some web services.

I have a third party API I need to use to access financial data. Long story short, after several different setups, I have settled on having a WebServices folder in the project that will contain all my local .ASMX files to access any cross-domain services so I can use them asynchronously.

Due to the nature of the web application I am developing, I needed to make this WebServices folder a web application in IIS7 on its own app pool. For some reason, however, any time I try to access any services there, I receive the following:

System.Web.HttpException: Could not load type 'Telerik.Web.UI.RadUploadHttpModule'

This is a bit of a show stopper, needless to say. I've tried various fixes (including commenting out the respective lines in web.config, but that just led to a chain of HttpExceptions...), but to no avail. How do I fix this?

EDIT: A sanitized version of the web.config from the web project folder.

<?xml version="1.0" encoding="UTF-8"?><configuration> 
  <configSections> 
    <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> 
 
  <connectionStrings/> 
  <appSettings><!---REDACTED---></appSettings
 
  <system.web> 
    <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.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
        <add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
      </assemblies> 
    </compilation> 
    <authentication mode="Forms"/> 
    <pages> 
      <namespaces><!---REDACTED---></namespaces
      <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"/> 
        <!---REDACTED---> 
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/> 
      </controls> 
    </pages> 
 
    <sessionState timeout="60"></sessionState> 
    <membership> 
      <providers> 
        <remove name="AspNetSqlMembershipProvider"/> 
        <!---REDACTED---> 
        </providers> 
    </membership> 
    <roleManager enabled="true" cookieTimeout="60"
      <providers> 
        <remove name="AspNetSqlRoleProvider"/> 
        <remove name="AspNetWindowsTokenroleProvider"/> 
        <!---REDACTED---> 
      </providers> 
    </roleManager> 
    <anonymousIdentification enabled="false"/> 
    <profile> 
      <providers> 
        <remove name="AspNetSqlProfileProvider"/> 
        <!---REDACTED---> 
      </providers> 
    </profile> 
 
    <httpHandlers> 
      <remove verb="*" path="*.asmx"/> 
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <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 path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/> 
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/> 
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/> 
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/> 
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/> 
    </httpHandlers> 
    <httpModules> 
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/> 
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/> 
    </httpModules> 
  </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> 
  <system.webServer> 
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules> 
      <remove name="ScriptModule"/> 
      <remove name="RadUploadModule"/> 
      <remove name="RadCompression"/> 
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode,runtimeVersionv2.0"/> 
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode,runtimeVersionv2.0"/> 
    </modules> 
    <handlers> 
      <remove name="WebServiceHandlerFactory-Integrated"/> 
      <remove name="ScriptHandlerFactory"/> 
      <remove name="ScriptHandlerFactoryAppServices"/> 
      <remove name="ScriptResource"/> 
      <remove name="ChartImage_axd"/> 
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/> 
      <remove name="Telerik_Web_UI_DialogHandler_aspx"/> 
      <remove name="Telerik_RadUploadProgressHandler_ashx"/> 
      <remove name="Telerik_Web_UI_WebResource_axd"/> 
      <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"/> 
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
    </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> 
</configuration> 

Genady Sergeev
Telerik team
 answered on 25 Oct 2011
3 answers
114 views
How do I get a value of a column in the current row if it's not selected? My grid shows data in some bound columns and a template column. The template column has (among other things) a button which will pass a value from that row to open another page via querystring. This doesn't seem like it should be difficult.

Grid only:
<telerik:RadGrid ID="Project_RadGrid" runat="server" CellSpacing="0" DataSourceID="Project_SqlDataSource"
    GridLines="None" AllowSorting="True" ShowGroupPanel="True" AllowPaging="True" Skin="Black">
    <ClientSettings AllowDragToGroup="True">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="JobNumber" DataSourceID="ProjectSqlDataSource">
        <CommandItemSettings ExportToPdfText="Export to PDF" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" />
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" />
        <Columns>
            <telerik:GridBoundColumn DataField="JobNumber" DataType="System.Decimal" FilterControlAltText="Filter JobNumber column"
                HeaderText="JobNumber" ReadOnly="True" SortExpression="JobNumber" UniqueName="JobNumber" Display="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SegmentName" FilterControlAltText="Filter SegmentName column"
                HeaderText="Business Segment" SortExpression="SegmentName" UniqueName="SegmentName">
                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn1 column" HeaderText="Overview"
                UniqueName="TemplateColumn1">
                <ItemTemplate>
                    <div>
                    <table style="width:99%; vertical-align:text-top;">
                        <tr><th style="width:80%;">
                        <span style="color:#009900;background-color:#F2F2F2;font-variant:small-caps;"><%# DataBinder.Eval(Container.DataItem, "Overview")%></span>
                        </th></tr>
                        <%--
                        *** Add the summary and integration rows only if there is data.
                        --%>
                        <%# If((DataBinder.Eval(Container.DataItem, "Summary") & "") = "", "", "<tr><td>" & DataBinder.Eval(Container.DataItem, "Summary") & "</td></tr>")%>
                        <%# If((DataBinder.Eval(Container.DataItem, "Integration") & "") = "", "", "<tr><td>" & DataBinder.Eval(Container.DataItem, "Integration") & "</td></tr>")%>
                        <tr><td>
                        <asp:Button ID="ShotDetail_Button" runat="server" Text="Shot List..." UseSubmitBehavior="False"
                                OnClick="ShotDetail_Button_Click" />
                        <input id="Comments_Button" type="button" value="Comments..." onclick=" $('#div_Comments').toggle();" />
                        <asp:Button ID="LinkedProjects_Button" runat="server" Text="Linked Projects..." UseSubmitBehavior="False" />
                        </td></tr>
                    </table>
                    </div>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
            </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column" />
        </EditFormSettings>
        <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
    </MasterTableView>
    <FilterMenu EnableImageSprites="False" />
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" />
</telerik:RadGrid>

Code behind:
protected void ShotDetail_Button_Click(object sender, System.EventArgs e)
{
    //I need JobNumber here
    Response.Redirect(string.Format("~/ShotDetail.aspx?JobNo={0}", JobNumber));
}
Francis Frank
Top achievements
Rank 1
 answered on 25 Oct 2011
3 answers
211 views
My web.config timeout is set to 1 minute for testing.  I log in and view a page with a radgrid. The grid loads normally.
I wait for 1 minute.  Then I click on a button on the radgrid and i get an error.

I want to be able to redirect users to my login.aspx page.

In an earlier thread you mention putting this in Login.aspx "Page_Init" function. 

"Response.RedirectLocation = Request.Url.ToString();"

But no redirect occurs.  Any ideas?
Iana Tsolova
Telerik team
 answered on 25 Oct 2011
1 answer
87 views
When I use asp DropDownList and populate it with some items (a, ab, abc, b, ba etc) I click to open drop down list and type 'a' on keyboard selection goes to first item that begins with 'a' and when I type 'ab' it goes to 'ab'.<br/>
But in telerik RadComboBox when I type 'ab' it goes to the first item that begins with 'b' and  not to 'ab'.<br/>
Is it possible to fix this somehow on RadComboBox?
Shinu
Top achievements
Rank 2
 answered on 25 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?