Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
189 views
Hi all,

Very simple.  I am binding the RadCombo in markup and code-behind as follows.  So, when the user selects a value in the RadComboBox that contains an apostrophe, some javascript exception is thrown and the server-side postback event handler is never invoked.  We are using version 2011.2.712.35.

Please help.

Thank you,

Dan

 Markup:

 

<td>

 

 <telerik:RadComboBox ID="request__place_id" CssClass="LabelValue" AutoPostBack="true"

OnSelectedIndexChanged="request__place_idSelectedIndexChanged"

runat="server">

 

</telerik:RadComboBox>

 

 </td>


Code-behind:

 

var values = from info in result.Descendants("place")

 

select new

{

    PlaceId = info.Element(

"place_id"),

    Name = info.Element(

"name")

};

 

this.request__place_id.Items.Clear();

 

this.request__place_id.Items.Add(new RadComboBoxItem(string.Empty, string.Empty));

 

foreach (var value in values)

    this.request__place_id.Items.Add(new Telerik.Web.UI.RadComboBoxItem(value.Name.Value, value.PlaceId.Value));

}

Ivana
Telerik team
 answered on 01 Dec 2011
1 answer
126 views
I want to know a Telerik's scaffold control. I have seen Subsonic's scaffold control that has TableName property and it displays form according to that database table, it creates  list/edit/add/delete forms at runtime. 
Please note I don't want to use MVC.
Sebastian
Telerik team
 answered on 01 Dec 2011
6 answers
2.7K+ views
My colleague started on Telerik a few weeks ago. I am about to try and get up to speed. He gave me a project which I have set up with data on my workstation. We got Telerik, MM.NET and its Telerik subclasses installed, and figured out how to manually browse to the Telerik.Web.UI file i the Telerik install location.

However, I had downloaded a slightly later version of Telerik, Version=2010.2.929.35, from our shared account. The SP.NET app still had one reference error, and if we tried run it it would barf on the web.config file saying it could not find the Telerik.Web.UI.

My colleague showed me an email or exchange on forum from Telerik saying that for a the version in question, you could get the PublicKeyToken from the xml file.

We are using .NET 3.5 version, so in the \35 folder, I verified the version number in the properties of the Telerik.Web.UI.dll as 2010.2.929.35.

However, in the Telerik.Web.UI.XML, the only reference to a PublicKeyToken was in these two lines:

            <example>
                <code lang="CS" title="C#">
            spell1.CustomDictionarySourceTypeName = "RadSpellExtensions.CustomDictionarySource, RadSpellExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b5e57ccb698eab8e";
                </code>
                <code lang="VB" title="VB">
            spell1.CustomDictionarySourceTypeName = "RadSpellExtensions.CustomDictionarySource, RadSpellExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b5e57ccb698eab8e"
                </code>
            </example>


Naturally, the value there when placed in the web.config file did NOT solve the problem.

On another thread here

http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/telerik-web-ui-radchart-is-not-defined.aspx

we found a reference to the version number, and a PublicKeyToken:

add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI, Version=2010.2.929.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>


so for the heck of it, we tried it in the web.config, and the program fired up.

So the question is, where are we SUPPOSED to be able to get the correct PublicKeyToken for a version of the .dll??

It is clearly not in the xml file in the \35 folder with this version.
Peter
Top achievements
Rank 1
 answered on 01 Dec 2011
1 answer
179 views
Hello all,

I setup a vertical CoverFlow RadRotator in a user control bound to a generic List<> but i cant seem to get the rotator to "wrap" using WrapFrames="true" and i only get 1 cycle of the items in the List<>. I've tried changing the binding to IEnumerables and string[].
For this example, the List<> is just List<string> vpaths.

Heres the markup for the rotator.

<

telerik:RadRotator ID="rotatorVerticalMediaItems" runat="server" Height="400px" Width="400px" CssClass="ucCoverArtRotatorV_RotatorStyle" RotatorType="CoverFlow" PauseOnMouseOver="false" Skin="Black" ScrollDuration="2000" ScrollDirection="Down,Up" FrameDuration="1" ItemHeight="300px" ItemWidth="202px" WrapFrames="true">

 

<ItemTemplate>

 

<div title='<%# Container.DataItem %>'>

<a href='<%# Container.DataItem %>'><img class="ucCoverArtRotatorV_CoverArtStyle" alt="" 
    
src='<%# Container.DataItem %>' /></a>

</div>

</ItemTemplate>

</telerik:RadRotator>

 
Thanks in advance.

Slav
Telerik team
 answered on 01 Dec 2011
1 answer
130 views
Hello,
I'm using the telerik grid but when I try to update any of the information, the grid disappears completely. Following are the steps I follow:
1. Click on the 'Edit' button for any of the row and update any information.
2. Press Update button.

As soon as I press 'Update' button, grid disappears. And when I reload the page, it appears again.
Following is the html code:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
  <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="tgLicenseInfo">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="tgLicenseInfo" LoadingPanelID="RadAjaxLoadingPanel1" />
      </UpdatedControls>
    </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<telerik:RadGrid ID="tgLicenseInfo" runat="server" AutoGenerateColumns="false" AllowSorting="true"
                                                            AllowPaging="true" AllowFilteringByColumn="true" OnNeedDataSource="tgLicenseInfo_NeedDataSource"
                                                            OnUpdateCommand="tgLicense_UpdateCommand">
  <EditItemStyle BackColor="AliceBlue" />
  <PagerStyle Mode="NextPrevAndNumeric" />
  <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" CommandItemDisplay="TopAndBottom" EditFormSettings-PopUpSettings-Modal="true">
    <Columns>
    <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-HorizontalAlign="Center"
                                                                        UniqueName="EditCommandColumn" HeaderText="Edit" ItemStyle-HorizontalAlign="Center" />
    <telerik:GridBoundColumn DataField="ID" UniqueName="ID" Visible="false" />
    <telerik:GridBoundColumn DataField="LNumber" HeaderText="License #" SortExpression="LNumber"
                                                                        UniqueName="LNumber" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
    <telerik:GridBoundColumn DataField="StateDesc" HeaderText="State" SortExpression="StateDesc"
                                                                        UniqueName="StateDesc" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
    <telerik:GridBoundColumn DataField="LType" HeaderText="Type" SortExpression="LType"
                                                                        UniqueName="LType" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
    <telerik:GridBoundColumn DataField="LHolder" HeaderText="Holder" SortExpression="LHolder"
                                                                        UniqueName="LHolder" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
    <telerik:GridBoundColumn DataField="LExpireDate" HeaderText="ExpireDate" SortExpression="LExpireDate"
                                                                        UniqueName="LExpireDate" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
    <telerik:GridBoundColumn DataField="LicenseStatus" HeaderText="Status" SortExpression="LicenseStatus"
                                                                        UniqueName="LicenseStatus" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
    <telerik:GridBoundColumn DataField="VerifiedByUserID" HeaderText="Verified By" SortExpression="VerifiedByUserID"
                                                                        UniqueName="VerifiedByUserID" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" HeaderText="Delete"
                                                                        ButtonType="ImageButton" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
    </Columns>
    <EditFormSettings EditFormType="Template">
      <EditColumn UniqueName="EditColumn"> </EditColumn>
      <FormTemplate>
        <table border="0" cellpadding="2">
          <tr>
            <td> License #:  </td>
            <td><asp:TextBox ID="txtLNumber" Width="150px" Text='<%# Bind( "LNumber") %>' runat="server"></asp:TextBox>
            </td>
          </tr>
          <tr>
            <td> State:  </td>
            <td><asp:TextBox ID="txtState" Width="150px" Text='<%# Bind( "StateDesc") %>' runat="server"></asp:TextBox>
            </td>
          </tr>
          <tr>
            <td> Type:  </td>
            <td><asp:TextBox ID="txtLType" Width="150px" Text='<%# Bind( "LType") %>' runat="server"></asp:TextBox>
            </td>
          </tr>
          <tr>
            <td> Holder:  </td>
            <td><asp:TextBox ID="txtLHolder" Width="150px" Text='<%# Bind( "LHolder") %>' runat="server"></asp:TextBox>
            </td>
          </tr>
          <tr>
            <td> Exp Date:  </td>
            <td><asp:TextBox ID="txtLExpireDate" Width="150px" Text='<%# Bind( "LExpireDate") %>'
                                                                                        runat="server"></asp:TextBox>
            </td>
          </tr>
          <tr>
            <td> Status:  </td>
            <td><asp:TextBox ID="txtStatus" Width="150px" Text='<%# Bind( "LicenseStatus") %>' runat="server"></asp:TextBox>
            </td>
          </tr>
          <tr>
            <td> Verified By:  </td>
            <td><asp:TextBox ID="txtVerifiedByUserID" Width="150px" Text='<%# Bind( "VerifiedByUserID") %>'
                                                                                        runat="server"></asp:TextBox>
            </td>
          </tr>
        </table>
        <asp:Button ID="Button3" CommandName="Update" Text="Update" runat="server" />
        <asp:Button ID="Button3a" CommandName="Cancel" Text="Cancel" runat="server" />
      </FormTemplate>
    </EditFormSettings>
  </MasterTableView>
</telerik:RadGrid>


And following is the code behind:
protected void tgLicense_UpdateCommand(object source, GridCommandEventArgs e)
{
 try
  {
   if (e.CommandName == RadGrid.UpdateCommandName)
    {
      if (e.Item is GridEditFormItem)
       {
         GridEditFormItem item = (GridEditFormItem)e.Item;
         int iLID = Convert.ToInt32(item.GetDataKeyValue("ID"));
         if (iLID != 0)
          {
           TextBox txtLHolder = (TextBox)item.FindControl("txtLHolder");
           TextBox txtLType = (TextBox)item.FindControl("txtLType");
           TextBox txtLExpireDate = (TextBox)item.FindControl("txtLExpireDate");
           TextBox txtLicenseStatus = (TextBox)item.FindControl("txtStatus");
           TextBox txtVerifiedByUserID = (TextBox)item.FindControl("txtVerifiedByUserID");
           TextBox txtState = (TextBox)item.FindControl("txtState");
           //    DropDownList drdState = (DropDownList)item.FindControl("drdState");
           SaisUser oUser = (SaisUser)Cache[this.GUID + "User"];
           AgentLicense oLI = oUser.AgentInProcess.LicenseInfo[iLID];
           oLI.LExpireDate = txtLExpireDate.Text;
           oLI.LHolder = txtLHolder.Text;
           oLI.LicenseStatus = Convert.ToBoolean(txtLicenseStatus.Text);
           oLI.VerifiedByUserID = txtVerifiedByUserID.Text;
           oLI.LType = txtLType.Text;
           //      oLI.LState = drdState.SelectedItem.Value;
           oLI.LState = txtState.Text;
           //here license is saved
           ProcessResult oPR = oLI.Save(this.CnxnString, this.LogPath);
           if (oPR.Exception == null)
             {
              oUser.AgentInProcess.LicenseInfo[iLID] = oLI;
              Cache[this.GUID + "User"] = oUser;
              this.tgLicenseInfo.Rebind();
             }
            // else
            //   this.lblUpdate.Text = "Error:" + oPR.Exception.Message;
           }
       }
     }
   }
   catch (Exception Exc)
    {
      string script = "$(function(){initializedialog();showDialog(\"" + Exc.Message + "\");});";
      ScriptManager.RegisterStartupScript(this, this.Page.GetType(), "dialog", script, true);
    }
}

Can some one help me with this issue?
Iana Tsolova
Telerik team
 answered on 01 Dec 2011
2 answers
88 views
Hi,

We are working on a rich ASP.Net application using most of Telerik controls and we are facing a strange issue. Given below is the scenario:

1. User visits our site.
2. Navigates to different pages using different Menu options (RadMenu - on Top of page, RadPanelBar - on Left).
3. in the same browser window/tab, User opens any other website e.g. msn.com.
4. Now, user moves back to previous page (our website) using browser's back button.

Once user is back on our website, both left and top menu bars are not functional i.e. clicking on menu items performs no action. Clicking or double clicking a menu makes no difference. It start behaving in a way that if there is no Page linked to any of the menu.

What could be the reason? Any fixes/help?

We are using RAD Asp.Net AJAX Q2 2011

Thanks in acticipation!
DIT
Top achievements
Rank 1
 answered on 01 Dec 2011
5 answers
98 views
OK, I just inherited a project that uses these controls and I am not sure how to word this.  I have a page thatuse radtabstrip and multipage. I have several pages and when I click on to save, the tables are getting updated with all the values with the first tab and doesn't see anything else.  I also get the identity of the record and save it as a session variable for a child table and it doesn't see it either. Is it possible for me to see the controls on all the tabs? If so, how do I do it?
Genady Sergeev
Telerik team
 answered on 01 Dec 2011
5 answers
394 views
I have a RadDateTimePicker that needs to stay empty when the page loads. When the user selects a time from the TimePopupButton, the Date & Time are populated in the RadDateTimePicker.  The problem is the date portion that's populated is always today's date. How can I default this to another date, for example DateTime.Now.AddDays(1)?

If I set the "SelectedDate" property to DateTime.Now.AddDays(1), then the date that's populated works as expected. But setting "SelectedDate" causes the RadDateTimePicker to display this date when the page loads. I need it to be empty on page load and only populated if the user selects something from the PopUpButtons. 
Kevin
Top achievements
Rank 2
 answered on 01 Dec 2011
7 answers
301 views
Hello,

I'm trying to set a customvalidator for the RadUpload control in order to check the maximum upload size, but I got an error (Attached screen-shot). My code is based on http://sample.topscms.com/blog/post/1607--client-side-file-size-validation-for-telerik-upload.

Default2.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <asp:ScriptManager ID="asdasD" runat="server">
       </asp:ScriptManager>
 
       <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                var currentLoadingPanel = null;
                var currentUpdatedControl = null;
 
                function RequestStart(sender, args) {
                    currentLoadingPanel = $find("<%= TasksRadAjaxLoadingPanel.ClientID %>");
 
                    if (args.get_eventTarget() == "<%= SubmitButton.UniqueID %>") {
                        args.set_enableAjax(false);
                    }
 
                    currentUpdatedControl = "<%= MainPanel.ClientID %>";
 
                    //show the loading panel over the updated control
                    currentLoadingPanel.show(currentUpdatedControl);
                }
 
                function ResponseEnd() {
                    //hide the loading panel and clean up the global variables
                    if (currentLoadingPanel != null)
                        currentLoadingPanel.hide(currentUpdatedControl);
                    currentUpdatedControl = null;
                    currentLoadingPanel = null;
                }
 
                function validateRadUploadFileSize(source, arguments) {
                    var totalFileSize = 0;
                    var maxFileSize = 100000;
                    var radUpload = $find('<%= AttachedFilesRadUpload.ClientID %>');
                    var fileInputs = radUpload.getFileInputs();
                    for (var i in fileInputs) {
                        if (fileInputs[i] && fileInputs[i].files[0]) {
                            totalFileSize += fileInputs[i].files[0].fileSize;
                        }
                    }
 
                    arguments.IsValid = totalFileSize <= maxFileSize;
 
                }
            </script>
        </telerik:RadCodeBlock>
 
 
       <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="SubmitButton">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="MainPanel" LoadingPanelID="TasksRadAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
            <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
        </telerik:RadAjaxManager>
 
        <telerik:RadAjaxLoadingPanel ID="TasksRadAjaxLoadingPanel" Skin="Vista" runat="server">
        </telerik:RadAjaxLoadingPanel>
 
        <asp:Panel ID="MainPanel" Width="100%" HorizontalAlign="Left" runat="server">
 
            <telerik:RadProgressManager ID="Radprogressmanager1" Width="403px" runat="server" />
            <telerik:RadUpload ID="AttachedFilesRadUpload" InitialFileInputsCount="1" MaxFileInputsCount="10" ControlObjectsVisibility="AddButton, RemoveButtons, CheckBoxes"
                       Width="405px" runat="server" />                       
            <telerik:RadProgressArea runat="server" Width="405px" ID="ProgressArea1" ></telerik:RadProgressArea>
 
             <asp:CustomValidator runat="server" ID="CustomValidator1" Display="Dynamic" ClientValidationFunction="validateRadUploadFileSize"
                        OnServerValidate="CustomValidator1_ServerValidate" ValidationGroup="CreateNewTaskValidationGroup">       
                        The maximum upload size is 100 KB
             </asp:CustomValidator>
 
             <asp:Button runat="server" ID="SubmitButton" ValidationGroup="CreateNewTaskValidationGroup" Text="Submit" />
 
         </asp:Panel>
 
    </div>
    </form>
</body>
</html>

Default2.aspx.cs:

using System;
using System.Web.UI.WebControls;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = (AttachedFilesRadUpload.InvalidFiles.Count == 0);
}
}

Please, I need you help in order to solve this problem.
It is very appreciated to send me the modified code.

Regards,
Bader
Kevin
Top achievements
Rank 2
 answered on 01 Dec 2011
1 answer
558 views
We have found a Xss vulnerability in the Telerik.Web.UI.WebResource.axd [_TSM_CombinedScripts_ parameter], where it is possible to edit the javascript. We are currently using an older version of the library (2009.3.1103.20). Can anyone confirm that this issue is fixed in the latest release, and in what version was this issue solved?
Simon
Telerik team
 answered on 01 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?