Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
259 views
If like me you've been struggling with using both LoadOnDemand and Checkboxes at the same time, here is my solution.

1.How do you remember what's been ticked as there is no viewstate recorded?

I used a hidden field in my page:

<div style="display:none">
    <input type="text" id="ComboCheck_HiddenField" name="ComboCheck_HiddenField"/>
</div>

Then called a function ComboCheck whenever fields were checked:

<telerik:RadComboBox ID="cbChooseFunds" runat="server" AllowCustomText="true" Width="400px"
    Height="200px" Filter="Contains" EnableLoadOnDemand="true" ShowMoreResultsBox="true"
    HighlightTemplatedItems="true" CheckBoxes="true" ItemRequestTimeout="1000" MinFilterLength="0"
    EnableVirtualScrolling="true"  
    EnableEmbeddedSkins="false" Skin="AppSkin" EmptyMessage="Start typing to search for a fund" ZIndex="10000000" OnClientItemChecked="ComboCheck" OnClientItemsRequesting="Combo_OnClientItemsRequesting"  >
 
</telerik:RadComboBox>


function ComboCheck(sender, eventArgs) {
    var combo = eventArgs._item._parent;
    var newValues = "";
    var items = combo.get_items();
    var hiddenValues = document.getElementById('ComboCheck_HiddenField');
    for (var i = 0; i < items.get_count() ; i++) {
        var item = items.getItem(i);
        var checkbox = item.get_element().getElementsByTagName("input")[0];
        if (checkbox.checked) {
            newValues += item.get_value() + ",";
        }
    }
 
    hiddenValues.value = newValues;
}


2. How do you stop losing the text when you type and the combo fetches more data?

<telerik:RadComboBox ID="cbChooseFunds" runat="server" AllowCustomText="true" Width="400px"
    Height="200px" Filter="Contains" EnableLoadOnDemand="true" ShowMoreResultsBox="true"
    HighlightTemplatedItems="true" CheckBoxes="true" ItemRequestTimeout="1000" MinFilterLength="0"
    EnableVirtualScrolling="true"  
    EnableEmbeddedSkins="false" Skin="AppSkin" EmptyMessage="Start typing to search for a fund" ZIndex="10000000" OnClientItemChecked="ComboCheck" OnClientItemsRequesting="Combo_OnClientItemsRequesting"  >
 
</telerik:RadComboBox>


The OnClientItemsRequesting event fires when the control needs more data. So we need to check the text at that point and then keep checking for a blank value and replace it when detected:

var ComboText = '';
var ComboInput;
function Combo_OnClientItemsRequesting(sender, eventArgs) {
    var combo = sender;
    ComboText = combo.get_text();
    ComboInput = combo.get_element().getElementsByTagName('input')[0];
    ComboInput.focus = function () { this.value = ComboText };
 
    if (ComboText != '') {
        window.setTimeout(TrapBlankCombo, 100);
    };
}
 
function TrapBlankCombo() {
    if (ComboInput) {
        if (ComboInput.value == '') {
            ComboInput.value = ComboText;
        }
        else {
            window.setTimeout(TrapBlankCombo, 100);
        };
    };
}



 
 
Nencho
Telerik team
 answered on 07 Mar 2014
4 answers
393 views
Hi,
I am using Radconfirm(Telerik Q3 2010) window.But when I am clicking on button and calling radconfirm thread is running as usual without clicking on OK button.
But what I want is thread should be blocked unless and untill I will not click ok button.
What I mean is server side event of that button should not fire unless and untill I will click on OK button.
But currently when I am clicking on button and calling RadConfirm from client side its firing server side event also before clicking on OK buttton.
Please help.
Thanks.
Sachin
Top achievements
Rank 1
 answered on 07 Mar 2014
1 answer
116 views
hi,

asp validation controls not firing after ajaxrequest been called.

i'm calling a function with below code to refresh a grid.

window[<My Grid Client ID>].AjaxRequest(<My Grid Unique ID>, 'Rebind');

after grid refreshed, validation not firing on clicking of submit button for the first time. for the next click it is working fine.

Hope this is due to ajax problem.

does any one came across this scenario...?
Konstantin Dikov
Telerik team
 answered on 07 Mar 2014
1 answer
181 views
Hi,

I want to use drag and drop feature between 2 Listbox. I am loading the data from server for 1st listbox. I can succesfully load the data and can see it in 1st listbox however i cant drag and drop to the second listbox the selected items. Thank you in advance for ur help.

this is how i load the data in code behind:
​ public void Populate()
{


var client = new Organon.IM.Presentation.IMPresentationService.PresentationServiceClient();
OperationResultDto<UserDto[]> Users = client.GetAllUsers();

var source = new BindingSource();
source.DataSource = Users.Data;
rlAssignments.DataSource = source;
rlAssignments.DataBind();

}


this is the code i am using the listboxes:

       <telerik:RadListBox ID="rlAssignments" runat="server" TransferMode="Copy" Width="250px" BackColor="#2D1A44" SelectionMode="Multiple" AllowTransfer="True" TransferToID="rlModellers" AutoPostBackOnTransfer="true"
AllowReorder="True" AutoPostBackOnReorder="true" EnableDragAndDrop="true" Skin="" CssClass="app-check">
<ItemTemplate>
<p><%# Eval("Username") %></p>
</ItemTemplate>

</telerik:RadListBox>


<telerik:RadListBox ID="rlModellers" runat="server" AllowTransfer="true" AutoPostBackOnTransfer="true"
SelectionMode="Multiple" AllowReorder="true" AutoPostBackOnReorder="true" EnableDragAndDrop="true"
Skin="" Width="510px">
<ItemTemplate>
<table style="width: 250px">
<tr style="width: 250px">
<td style="width: 470px"><span class="name fl"></span>
<span class="buttons fr">
<a href="" class="mini-action icon-delete-mini"></a>
</span>
</td>

</tr>
</table>
</ItemTemplate>

</telerik:RadListBox>
Bozhidar
Telerik team
 answered on 07 Mar 2014
3 answers
117 views
Hello,

I installed Telerik latest version, and I noticed that my editor height became smaller and not expanded over the td as it was on Telerik's previous versions.

Description: my editor is inside a td, and I set the editor to be width:100% and height: 100%- the width expands as it should (td wifth is equal to editor width) but the height doesn't behave the same (the editor height is smaller than the td height).

* on the previous versions it worked correctly.

Thanks,

Shinu
Top achievements
Rank 2
 answered on 07 Mar 2014
4 answers
475 views
Hi there,

I know this question has been asked thousands of time and I search for it in the forum but yet I could find anything to help me out.
As for many people, I'm trying to achieve such feature described here : Demo adding a custom field to an upload process.

Here is my (very simple) code :
01.<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="feature-data-upload.ascx.cs"
02.    Inherits="NRP.Study.usercontrols.feature_data_upload" %>
03.<telerik:RadScriptBlock ID="rsbDataUpload" runat="server">
04. 
05.    <script type="text/javascript">
06.        var $ = $telerik.$;
07. 
08.        function onClientFileUploaded(radAsyncUpload, args) {
09.            alert(1);
10.            var $row = $(args.get_row());
11.            var inputName = radAsyncUpload.getAdditionalFieldID("TextBox");
12.            var inputType = "text";
13.            var inputID = inputName;
14.            var input = createInput(inputType, inputID, inputName);
15.            var label = createLabel(inputID);
16.            $row.append("<br/>");
17.            $row.append(label);
18.            $row.append(input);
19.        }
20. 
21.        function createInput(inputType, inputID, inputName) {
22.            var input = '<input type="' + inputType + '" id="' + inputID + '" name="' + inputName + '" />';
23.            return input;
24.        }
25. 
26.        function createLabel(forArrt) {
27.            var label = '<label for=' + forArrt + '>File info: </label>';
28.            return label;
29.        }
30.        function startManualUpload() {
31.            var upload = $find('<%=rauDataUpload.ClientID%>');
32.            upload.startUpload();
33.        }
34.        function pauseManualUpload() {
35.            var upload = $find('<%=rauDataUpload.ClientID%>');
36.            upload.pauseUpload();
37.        }
38.        function resumeManualUpload() {
39.            var upload = $find('<%=rauDataUpload.ClientID%>');
40.            upload.resumeUpload();
41.        }
42.    </script>
43. 
44.</telerik:RadScriptBlock>
45.<telerik:RadProgressManager ID="rpmDataUpload" runat="server" />
46.<ul>
47.    <li>
48.        <input type="button" id="BtnStartUpload" onclick="startManualUpload()"
49.            value="Start" />
50.    </li>
51.    <li>
52.        <input type="button" id="BtnPauseUpload" onclick="pauseManualUpload()"
53.            value="Pause" />
54.    </li>
55.    <li>
56.        <input type="button" id="BtnResumeUpload" onclick="resumeManualUpload()"
57.            value="Resume" />
58.    </li>
59.    <li>
60.        <asp:Button ID="BtnSubmitFiles" runat="server" OnClick="BtnSubmitFiles_Clicked" Text="Submit" />
61.    </li>
62.</ul>
63.<telerik:RadAsyncUpload ID="rauDataUpload" runat="server" MultipleFileSelection="Automatic"
64.    ManualUpload="true" HttpHandlerUrl="~/Study/handlers/DataUploadManager.ashx"
65.    TemporaryFolder="~/App_Data/DataUploads" OnClientFilesUploaded="onClientFileUploaded">
66.</telerik:RadAsyncUpload>
67.<telerik:RadProgressArea ID="rpaDtatUpload" runat="server">
68.</telerik:RadProgressArea>

This is a usercontrol that I'm dynamically loading into my aspx page via a call to "LoadControl(xxxxx)".
The upload process looks good, everything works properly till it reaches that $(args.get_row()) on line #10.

Anyone has any idea why such "bug" ? Could this be due because I'm loading an external control from the page ?

Thanks,

Chris

Christophe
Top achievements
Rank 1
 answered on 07 Mar 2014
1 answer
94 views
Hi All,
We have BoundColumn with DateTime as DataField , we are using RadDatePicker for filtering purposes as shown in this demo for "Shipped Date" Column 
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx  .
Once we apply filter , the filter happens , but we are not able to clear the filter .
We have tried using AutoPostBackonfilter ="true" and by using RadAjaxCreated Method to clear the filter but it doesnot clear the filter.
Please update on how to resolve this problem .

-Dinesh
Princy
Top achievements
Rank 2
 answered on 07 Mar 2014
1 answer
452 views
I am following the demo to export a radscheduler to a calendar, but I am running into a problem using master pages and content pages. I have the RadAjaxManager in the masters page and RadAjaxManagerProxy in the content page.  I am getting an error trying to do the following (code is in the content page):

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function Export(sender, e) {
                $find("<%= RadAjaxManager1.ClientID %>").__doPostBack(sender.name, "");
            }
        </script>
    </telerik:RadCodeBlock>

I have this in the scheduler:
<asp:Button runat="server" ID="Button1" CssClass="rsExportButton" ToolTip="Export to iCalendar"
                                CommandName="Export" OnClientClick="Export(this, event); return false;" Style="cursor: pointer; cursor: hand;"></asp:Button>

I know I am not doing this right but I don't know what to reference properly in the javascript.

Thanks!
 
Darren
Top achievements
Rank 1
 answered on 06 Mar 2014
5 answers
61 views
Hi, 

This is an issue I found in the demo("Scheduler - External Edit in RadDock" -  http://demos.telerik.com/aspnet-ajax/scheduler/examples/raddock/defaultcs.aspx) as well. When creating an appointment using the customized RadDock, the "End By" date does not properly create the appointment for recurring ones. Using the normal appointment editor(not the RadDock one), when a date is chosen for "End By" date. An occurrence will get create for that particular day included. 
But when using the RadDock as the appointment editor, an occurrence does not get created for the date selected on the "End By" date.

Example.
Image 1 : Creating a recurring appointment that does not use the RadDock. The appointment to be created is a recurring one with Daily, occurring every day with start date, end date and end by date as 4/18/2012.
Image 1 - Outcome : An occurrence is created for the appointment on the 4/18/2012.

Image 2 : Creating a recurring appointment using the RadDock. The appointment to be created is a recurring one with Daily, occurring every day with start date, end date and end by date as 4/18/2012.
Image 2 - Outcome : No occurrence got created for the appointment on the 4/18/2012.

If more clarification is needed, please reply.

Thank you.


Boyan Dimitrov
Telerik team
 answered on 06 Mar 2014
8 answers
325 views
Hi Pero,

I am having a problem with RadCaptcha.  I have it on a Contact page.  When the user fills out the information, the page posts back and emails the information to the admin.  I then hide the div that has the form and display another div to show thank you message.  We are on the same page so no Transfer. If the user clicks on Back button in the browser then he/she can postback again using the same code.  No problem.  I do check for IsValid property before sending out the email and the ISValid always returns true

if (Page.IsValid && RadCaptcha1.IsValid)
            {
                try
                {                                       MailHelper.Instance.SendSystemOwnerEmail("Contact form filled out.", txtName.Text);                 
  
                    this.txtName.Text = string.Empty;
                    // With the code below or without it.  The CAPTCHA image doesnt change and the user can click on Back button and use the same code to postback.
                    RadCaptcha1.CaptchaImage.RenderImage();
  
                    divContact.Visible = false;
                    divThankYou.Visible = true;
                }
Slav
Telerik team
 answered on 06 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?