Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
179 views

RadListBox Transfer Items from Source to Destination is getting fired even when I click a button in the Page. How Do I stop That?

Steps to Reproduce the Issue – Load the Page. Click the button. See the Item counts for the List Boxes inside the AJAX Update Panel. It will show correctly – 7 (source) and 0 (target) respectively. Move one item from Source to Target RadListBox. Click the button again – it shows 6 (source) and 1 (target) for the first time. Then click the button again – it shows 5 (source) and 2 (target) ..then click button.. it shows 4 (source) and 3 (target). Nothing is changing in the User Interface.

I believe that Transfer event from source to target is getting fired even when I click the button. How do I stop the Transfer event when the button is clicked?

 In my page, I have to refresh the AJAX Update panel but I do not want the items in the RadListBox to get changed at the same time.

ASPX Page -

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestRadListBox.WebForm1" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
        <table>
            <tr>
                <th colspan="2">Move 1 Item from Left to Right and then click the button below and see the Item Counts</th>
            </tr>
            <tr>
                <td>
                    <telerik:RadListBox ID="SourceRadListBox" runat="server" Height="100px" Width="200px"
                        AllowTransfer="true" TransferToID="TargetRadListBox">
                    </telerik:RadListBox>
                </td>
                <td>
                    <telerik:RadListBox runat="server" ID="TargetRadListBox" Height="100px" Width="175px"
                        AllowReorder="true" />
                </td>
            </tr>
        </table>
    </div>
    <br/>
    <div>
        Time OUTSIDE Update Panel : <asp:Label ID="timeOutsideLabel" runat="server"/>
    </div>
    <br/>
    <div align="left">
        <asp:Button ID="addRuleButton" runat="server" Text="Click To Refresh The Time Below Inside AJAX Update Panel"
            onclick="addRuleButton_Click" />
    </div>
    <br/>
    <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <table border = "2">
                <tr><th>AJAX Update Panel</th></tr>
                <tr><td>Time INSIDE Update Panel : <asp:Label ID="timeInsideLabel" runat="server"/></td></tr>
                <tr><td>Item Count in Source RadListBox : <asp:Label ID="srcCount" runat="server"/></td></tr>
                <tr><td>Item Count in Target RadListBox : <asp:Label ID="tarCount" runat="server"/></td></tr>
            </table>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="addRuleButton" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>

C# Code Behind -

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace TestRadListBox
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List<string> week = new List<string> { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
                SourceRadListBox.DataSource = week;
                SourceRadListBox.DataBind();
                string timenow = DateTime.Now.ToLongTimeString();
                timeInsideLabel.Text = timenow;
                timeOutsideLabel.Text = timenow;
            }
        }

        protected void addRuleButton_Click(object sender, EventArgs e)
        {
            timeInsideLabel.Text = DateTime.Now.ToLongTimeString();
            srcCount.Text = SourceRadListBox.Items.Count.ToString();
            tarCount.Text = TargetRadListBox.Items.Count.ToString();
        }
    }
}

Andy
Top achievements
Rank 1
 answered on 31 Jan 2012
6 answers
495 views
I have a RadComboBox that I populate with checkboxes and associated labels as follows:
<ItemTemplate>
     <div onclick="StopPropagation(event)">
          <asp:CheckBox ID="CheckBox1" runat="server" Checked="True" AutoPostBack="False" OnClick="checkboxClick(this)" Text = '<%# DataBinder.Eval(Container, "Text") %>' />
     </div>
</ItemTemplate>

The RadComboBox has a client event that updates the combobox text by looping thru the selected checkboxes and assigning a custom text.

If a user clicks to the right of the checkbox label, the label text is selected and inserted into the combobox, even though the checkbox is not checked/unchecked. The combobox client code does not overwrite this, for some reason.

How can I stop this from happening?

Please help!

Thank you, 
-Megan

see attached - on 2nd image, you can see that 1.5 stars is in the combo text, but it doesn't match the dropdown.

 
Ivana
Telerik team
 answered on 31 Jan 2012
4 answers
140 views
I have a problem in time to also utilize the tabstrip with multipage, the problem is time to validate the email first
RadPageView can not click on the second RadPageView2 without first validating the first RadPageView RadTextBox with id = "email" as the RadPageView Faso to work independently to validate the fields.


added these commands in the example with the RadPageView RadTextBox:

  <telerik: RadTextBox id = "email" runat = "server" Height = "15px" Width = "300px"
                             ValidationGroup = "rep">
                         </ telerik: RadTextBox>
                         <asp: RegularExpressionValidator ID = "EmailValidator" runat = "server" Display = "Dynamic"
ErrorMessage = "Please, enter valid email address." ValidationExpression = "^ [\ w \. \ -]+@[ A-zA-Z0-9 \ -] + (\. [A-zA-Z0-9 \ -] {1,})*( \. [a-zA-Z] {2,3}) {1,2} $ "
ControlToValidate = "email" ValidationGroup = "rep"> </ asp: RegularExpressionValidator>
<asp: RequiredFieldValidator ID = "Requiredfieldvalidator1" runat = "server" Display = "Dynamic"
ControlToValidate = "email" ErrorMessage = "Please, enter an e-mail!" ValidationGroup = "rep" />

want to activate the link for the second RadPageView2 that will contain another form, ie the link only works if I RadPageView2 validate the email that is in RadPageView1
Dimitar Terziev
Telerik team
 answered on 31 Jan 2012
1 answer
199 views
hi,
    Recently ive downloaded Telerik dll from the Website (2011.3.1305.35) and when Im trying to build the application using this dll on V2.0 framewrok, i face some compatibility issues with System.web.Extension.

Error are as follows:
    Error 43 C:\Prabhu\Working Folder\Prototype\Prototype\Prototype\MasterPage\Proto.Master: ASP.NET runtime error: The base class includes the field 'UpdatePanel1', but its type (System.Web.UI.UpdatePanel) is not compatible with the type of control (System.Web.UI.UpdatePanel). C:\Prabhu\Working Folder\Prototype\Prototype\Prototype\MasterPage\Proto.Master 160 1 Prototype

    Error 44 Assembly 'Telerik.Web.UI, Version=2011.3.1305.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' uses 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' c:\Prabhu\Working Folder\Prototype\Prototype\Prototype\Assemblies\Telerik.Web.UI.dll Prototype

Note: Ive added the reference of 
    System.Web.Extensions (1.0.61025.0), 
    Telerik.Web.Design (2011.3.1305.35)
    Telerik.Web.UI  (2011.3.1305.35)
    Telerik.Web.UI.Skins (2011.3.1305.35)


Please help me on fixing this issue. thanks in advance.
Dimitar Terziev
Telerik team
 answered on 31 Jan 2012
1 answer
215 views
hi

in calendar control ,if user double clicks on date i need to show the alert message.

please suggest me solution.


thanks
Sri
Richard
Top achievements
Rank 1
 answered on 31 Jan 2012
1 answer
225 views

hi  i am using RadToolTipManager to show Thumbunail of file when user mouseover the file link on grid
in the ascx prerender event
i download the swf file from the databse store in application path
i need to chage the value property of <param> and src property of <embed>

<object id="file"  width="240" height="200"
 classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
 pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">
 <param id="ParamC"  name="SRC" value="Paper.swf">
 <embed id="embedC"  src="Paper.swf" width="240" height="200"></embed>
 </object>

how to achive this?

Marin Bratanov
Telerik team
 answered on 31 Jan 2012
1 answer
126 views
In my website project I have a top-level file called "Common.cs" that is shared by all the forms in the project.  It contains common code that needs to access the Website UI.  I'd like to dynamically create a dialog box that will allow the user to enter additional comments in the event of an error.

I've written some code that is not crashing but yet no RadWindow is appearing.  Here's the crux of what I have so far:

    public static void ShowErrorDialog(string msg, Constants.ErrorCode category, string location, Control parent)<br>    {<br>      RadWindow rw = new RadWindow();<br>      rw.ID = "rwErrorHandling";<br>      rw.VisibleOnPageLoad = true;<br>      rw.CssClass = "errorDialog2";<br>      rw.Behaviors = WindowBehaviors.Move;<br>      rw.EnableShadow = true;<br>      rw.VisibleStatusbar = false;<br>      rw.VisibleTitlebar = true;<br>      rw.Visible = true;<br>      //rw.AutoSize = true;<br>      rw.Width = 300;<br>      rw.Height = 200;<br>      rw.Modal = true;<br>      <br>      // Much more code here to create the contents of the dialog box<br>      <br>      parent.Page.Controls[0].FindControl("form1").Controls.Add(rw);<br>    }

And here's a sample call to the method:

  Website.Common.ShowErrorDialog("Test message", Constants.ErrorCode.UnexpectedRecordCount, "buttonTest", Page);

Hoping someone can tell me why the RadWindow is not appearing,

Robert

P.S. In case it helps, here's displayed info from jQuery when I'm stepping through client-side code:

? $('div[id$=_rwNewMuckpile]')[0].id
"ctl00_ContentPlaceHolder1_Mucking_rwNewMuckpile"
    endsWith: function String$endsWith(suffix) {
    /// <summary locid="M:J#String.endsWith" />
    /// <param name="suffix" type="String"></param>
    /// <returns type="Boolean"></returns>
    var e = Function._validateParams(arguments, [
        {name: "suffix"
    startsWith: function String$startsWith(prefix) {
    /// <summary locid="M:J#String.startsWith" />
    /// <param name="prefix" type="String"></param>
    /// <returns type="Boolean"></returns>
    var e = Function._validateParams(arguments, [
        {name: "pre
    trim: function String$trim() {
    /// <summary locid="M:J#String.trim" />
    /// <returns type="String"></returns>
    if (arguments.length !== 0) throw Error.parameterCount();
    return this.replace(/^\s+|\s+$/g, '');
}
    trimEnd: function String$trimEnd() {
    /// <summary locid="M:J#String.trimEnd" />
    /// <returns type="String"></returns>
    if (arguments.length !== 0) throw Error.parameterCount();
    return this.replace(/\s+$/, '');
}
    trimStart: function String$trimStart() {
    /// <summary locid="M:J#String.trimStart" />
    /// <returns type="String"></returns>
    if (arguments.length !== 0) throw Error.parameterCount();
    return this.replace(/^\s+/, '');

So something "appears" to be there but if I make this call: $find($('div[id$=_rwNewMuckpile]')[0].id)
then I get 'null'.  :-(
Marin Bratanov
Telerik team
 answered on 31 Jan 2012
5 answers
602 views
Hi,

I tried this in the DetailTableDataBind event handler

GridBoundColumn b = new GridBoundColumn();
e.DetailTableView.Columns.Add(b);
b.HeaderText = "test";

the column is successfully added, but as soon as a postback occurs, the new column disappears. But adding a column the exact same way to the MasterTableView works as intended.

I am having the same issue as an unanswered question in the second half of this thread (by Bruno):
http://www.telerik.com/community/forums/aspnet-ajax/grid/dynamically-add-columns-to-existing-radgrid.aspx

Thanks,
Donald
Tsvetina
Telerik team
 answered on 31 Jan 2012
0 answers
117 views
I have defined a RadUpload control:

    <telerik:RadUpload MaxFileSize="512000" OverwriteExistingFiles="true" ControlObjectsVisibility="None"
          runat
="server" ID="RadUpload1" OnValidatingFile="uploadMedia_ValidatingFile"
          OnClientFileSelected
="uploadMedia_FileSelected" Width="500px" />
But this is rendered as:

<span class="ruFileWrap ruStyled" style="width: 80px;" jQuery171041561896132524767="11">
   
<input class="ruFileInput" id="ctl00_MainContent_Edit1_RadUpload1file0" submitName="ctl00_MainContent_Edit1_RadUpload1file0" type="file" size="23" unselectable="on" _events="[object Object]"/>
   
<label style="display: none;" for="ctl00_MainContent_Edit1_RadUpload1file0">
   
<input class="ruFakeInput" id="ctl00_MainContent_Edit1_RadUpload1TextBox0" type="text" size="22"/>
   
<label style="display: none;" for="ctl00_MainContent_Edit1_RadUpload1TextBox0">
   
<input class="ruButton ruBrowse" type="button" value="Select"/>

You may notice the style="width: 80px;" property. That's the bit that's causing problems, it's 'cutting off' the right half of the control. I've traced the style using IE's developer tool but all it's telling me is that it's 'Inline.' Where is this styling defined? Is it possible to override the 80px?

Thanks a lot.

EDIT: Please note that this happens regardless of whether I'm setting the EnableFileInputSkinning and InputSize properties, these where just set in attempt to solve the problem, and it didn't work.

EDIT: Please remove this thread, reposted in the right place: http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/problem-with-inline-styling.aspx 
Julien Pierre
Top achievements
Rank 1
 asked on 31 Jan 2012
1 answer
110 views
Hi,
We are trying to host ASP.NET website on GODADDY.COM
Some telerik control we used to make it look better but control fail to render as it render when run through VISUAL STUDIO.
Attached images will explain scenario...

Is there any tutorial which explain how to deploy Telerik Web Site?? 
Kate
Telerik team
 answered on 31 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?