Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
563 views

I have a RadComboBox and I am attempting to retrieve the selected item in JavaScript.  Using .NET 4.0. in FireFox 11.0.

The RadComboBox is as follows:

<telerik:RadComboBox ID="ddlBillingState" runat="server"
AppendDataBoundItems="True"
DataTextField="Name"
DataValueField="StateProvinceID"
ondatabinding="ddlBillingState_DataBinding"
ondatabound="ddlBillingState_DataBound">
<Items>
<telerik:RadComboBoxItem Text="Select a State" />
</Items>
</telerik:RadComboBox>

 

The above RadComboBox resides inside a FormView ID=VendorFormView.

When I use the following code the JavaScript terminates before the second alert is issued.  The statement with the get_selectedItem call seems to be failing. The following JavaScript is contained with the Header section of the page in which the RadComboBox resides. This JavaScript runs when the user clicks a CheckBox on the page.  The ddlBillingState control does have a selected item, which was selected by the user, but when I attempt to retrieve the selected item the JavaScript terminates.

Any help would be greatly appreciated.

var ddlBillingState = document.getElementById('<%=VendorFormView.FindControl("ddlBillingState").ClientID%>');
var ddlShippingState = document.getElementById('<%=VendorFormView.FindControl("ddlShippingState").ClientID%>');
if (ddlBillingState != null && ddlShippingState != null)
{
alert("Assigning selected billing state");
var selectedBillingItem = ddlBillingState.get_selectedItem();
alert("selectedBillingItem assigned");
var shippingItem = ddlShippingState.findItemByText(selectedBillingItem.get_text());
alert("Shipping Item assigned");
shippingItem.select();
alert("Done");
}
Cat Cheshire
Top achievements
Rank 1
 answered on 02 May 2012
6 answers
308 views
Here's my scenario: I have a master table with some items in it. Through the push of a button, you can choose to edit an item's sub-items. This expands the item, and populates the sub-items, setting each item's Edit=true, and works just fine. However, some items have tons of sub-items, so paging is necessary. When one changes the page, the new items that show up are not in Edit-mode. How do I keep them in edit mode while still allowing paging?
Peter
Top achievements
Rank 1
 answered on 02 May 2012
1 answer
245 views
Hello,

I have a Numeric Textbox in Rad Grid. I have 2 columns in that Grid. Old Price and New Price.

Old Price is dataGridItem and Had a textbox in New Price Column.

My New Price should not be greater than Old Price.

How can I set this Rad Numeric textbox in the Grid. ?

TIA
Shinu
Top achievements
Rank 2
 answered on 02 May 2012
2 answers
160 views
I have same questions here. In listview the order of next data is shown like this :
Data1  Data2  Data3
Data4  Data5  Data6
Data7  Data8  Data9
................................

Instead horizontal, can the next data be shown vertically like this :
Data1  Data4  Data7  ::
Data2  Data5  Data8  ::
Data3  Data6  Data9  ::

Thanks b4.
Michael
Top achievements
Rank 1
 answered on 02 May 2012
2 answers
750 views

how to clear RadAsyncUpload files which is hosted in Jquery UI dialog on clientside?

 

        // clears the radasync upload

        function ClearFileInput() {

            var upload = $find("<%= rauMailingDocument.ClientID %>");           

            if (upload._uploadedFiles.length > 0) {

                Array.removeAt(upload._uploadedFiles, 0);

                upload.deleteFileInputAt(0);

                upload.updateClientState();

            }  

        }

Edit:  Update, the above seems to work, is that the preferred method?

Esteban
Top achievements
Rank 1
 answered on 01 May 2012
1 answer
85 views
Hi,
 I have 2 controls raddatepicker and radtimepicker. Works perfect. But now I want to get the date only from the datepicker and the time only from the timepicker in code. How do I do this?


RadDPArrivalDate.Calendar.SelectedDate.Date.ToString
RadTPArrivalTime.DateInput.Text

But for both I seem to get the whole date and time.

4/30/2012 12:00:00 AM 2012-04-30-22-15-00

I would like to get 4/30/2012 and 3:00PM which is what was entered into the control.

Thanks.
Tash
Top achievements
Rank 1
 answered on 01 May 2012
1 answer
160 views
I want to be able to copy the personal address controls values over to the shipping address controls when a user clicks a link button. I have the following javascript

function NewUserCopyPrsnlToShip()
    {
        text = $find("<%= txtPersonalAddress.ClientID %>").get_textBoxValue();
        $find("<%= txtShippingAddress.ClientID %>").set_value(text);

        text = $find("<%= txtPersonalAddress2.ClientID %>").get_textBoxValue();
        $find("<%= txtShippingAddress2.ClientID %>").set_value(text);

        text = $find("<%= txtPersonalCity.ClientID %>").get_textBoxValue();
        $find("<%= txtShippingCity.ClientID %>").set_value(text);

        document.getElementById("<%=rcbShippingState.ClientID%>").selectedIndex = document.getElementById("<%=rcbPersonalState.ClientID%>").selectedIndex;

        text = $find("<%= txtPersonalZip.ClientID %>").get_textBoxValue();
        $find("<%= txtShippingZip.ClientID %>").set_value(text);
    }

It all works except the combobox copy part. Both comboboxes are bound to the exact same collections. How do I make this work?
Matt
Top achievements
Rank 1
 answered on 01 May 2012
1 answer
138 views
I'm working on a static website and would like to know if anyone can give me advice on what controls I could use to make it a better site for the users?  I'm currently using the radCalendar, the File Explorer and the Panel Bar.  I'm using the calendar to show users important dates, the file explorer i'm using to list some pdf files and the panel bar i'm using as my menu.  Since we purchased the controls I would like to use as many features as I can to enhance the website.  Since I have not read or worked with most of the other controls and just wanted to know if anyone to tell me what other controls I could use for a basic website. 

Thank you
M. R.
Top achievements
Rank 1
 answered on 01 May 2012
2 answers
274 views
Hi

I would like to write an aspx page that uses a RadBinaryImage to load an image from a database with a table structured as follows.

ImageID, ImageData
10, 12345678901234567890

With ImageID a key and ImageData the binary image data for a RadBinaryImage control.

This page (imageresize.aspx) should load the imge with an ImageID specified on a QueryString from the database, then resize the image and finally set the response contentType to "image/jpeg" and write out the image.

I would like to be able to include it on another page in another site, e.g. main.html.  The HTML for main.html might include <img src=imageresize.aspx?ID=10>. 

Is there any way I can convert a RadBinaryImage into System.Drawing.Image to be able to write it out, or is there any other way of doing this?

Kind Regards, Richard Jonas
Richard
Top achievements
Rank 1
 answered on 01 May 2012
2 answers
376 views
Hi,

I've got a RadComboBox (version 2012.1.411.40) that has the input/display box and down arrow sections showing up just fine, but when I click on the down arrow, the drop down list fails to appear.  I've checked the generated page source and can see the list of the items that are supposed to be showing up.  All list items are being loaded up-front, there is no on-demand functionality being utilized. I was using a custom skin that I thought might be the source of the issue, but I switched back to the default embedded skin, and the problem is persisting. I am trying to use the control on a content page which is contained within an UpdatePanel on the master page.  I'm not receiving any sort of error on the page (JavaScript or otherwise).  While the drop down list never shows up, I can use the up and down arrow keys to scroll through the options, and the auto-complete feature still works as well.

Here's the markup and generated HTML, in case it helps:

<telerik:RadComboBox ID="ddlSearchRoles" runat="server" EnableEmbeddedSkins="true"
    AllowCustomText="false" EnableLoadOnDemand="false" MarkFirstMatch="false" />
 
<div class="rcbSlide" style="z-index: 6000; visibility: visible; display: none; overflow: hidden; margin-left: 0pt; position: absolute; top: 323.5px; left: 806.283px; height: 107px; width: 160px;">
    <div id="ctl00_ContentPlaceHolder1_ddlSearchRoles_DropDown" class="RadComboBoxDropDown RadComboBoxDropDown_Default " style="display: block; visibility: visible; top: -107px; left: 0px; width: 158px;">
        <div class="rcbScroll rcbWidth" style="width: 100%; overflow: auto; height: 105px;">
            <ul class="rcbList" style="list-style:none;margin:0;padding:0;zoom:1;">
                <li class="rcbHovered ">-All-</li>
                <li class="rcbItem ">Application Admin</li>
                <li class="rcbItem ">Dependent Member</li>
                <li class="rcbItem ">Practice Admin</li>
                <li class="rcbItem ">Primary Member</li>
            </ul>
        </div>
    </div>
</div>
 
 <div id="ctl00_ContentPlaceHolder1_ddlSearchRoles" class="RadComboBox RadComboBox_Default" style="width:160px;">
    <table class="" style="border-width: 0pt; border-collapse: collapse;" summary="combobox">
        <tbody>
            <tr class="rcbReadOnly">
                <td class="rcbInputCell rcbInputCellLeft" style="width:100%;">
                    <input id="ctl00_ContentPlaceHolder1_ddlSearchRoles_Input" class="rcbInput" type="text" readonly="readonly" value="-All-" name="ctl00$ContentPlaceHolder1$ddlSearchRoles" autocomplete="off">
                </td>
                <td class="rcbArrowCell rcbArrowCellRight">
                    <a id="ctl00_ContentPlaceHolder1_ddlSearchRoles_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a>
                </td>
            </tr>
        </tbody>
    </table>
    <input id="ctl00_ContentPlaceHolder1_ddlSearchRoles_ClientState" type="hidden" name="ctl00_ContentPlaceHolder1_ddlSearchRoles_ClientState" autocomplete="off">
</div>

Any ideas or suggestions?

Thanks,
Jason
Jason
Top achievements
Rank 1
 answered on 01 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?