This is a migrated thread and some comments may be shown as answers.

Populating Rad ComboBox with Uploaded File

1 Answer 36 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Jo
Top achievements
Rank 1
Jo asked on 11 Feb 2011, 05:34 PM
I have a RadComboBox on my page which has an ItemTemplate defined containing a  RadAsyncUpload control.  When the file is uploaded I would like to populate the combobox with the name of the uploaded file.  Please can anyone explain why this code doesn't work:

<telerik:RadComboBox ID="RadComboBoxDocument" runat="server" EmptyMessage="Choose an existing SPA or upload a new one" AppendDataBoundItems="true" Height="200px" Width="300px">
  <ItemTemplate>
    <div>
      <telerik:RadAsyncUpload ID="RadAsyncUploadDocument" runat="server" ControlObjectsVisibility="None" MultipleFileSelection="Disabled" MaxFileInputsCount="1" AllowedFileExtensions="pdf" Width="300px" OnClientFileUploaded="fileUploaded">
      </telerik:RadAsyncUpload>
    </div>
  </ItemTemplate>
  <Items>
    <telerik:RadComboBoxItem Text=" " />
  </Items>
</telerik:RadComboBox>

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Feb 2011, 05:53 AM
Hello,


Have you tried setting the text using client side method "set_text()" of RadComboBox?

Try the following code and see whether it works as expected:
function fileUploaded(sender, args) {
    var name = args.get_name();       
    var combo = $find('<%=  RadComboBoxDocument.ClientID %>');
    combo.set_text(name);
}



Thanks,
Princy.
Tags
PanelBar
Asked by
Jo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or