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

canceling postback of Radcombobox

1 Answer 81 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 1
Sunil asked on 25 Jul 2011, 10:47 AM
Dear Sir/Mam


How can i make selection of combobox item after making its postback false

---------Javascript Function-----------------------------------------------
 function OnClientSelectedIndexChangingSeries(sender, args) {
                     var btnAdd = $find("<%=btnAdd.ClientID %>");
                     if (btnAdd.get_text() == "Add") {
                         args.set_cancel(false);                        
                     }
                     else {
                         args.set_cancel(true);                                              
                     }
 }
--------------------------------------------------------------------------------
------------ASPX Page Combobox Control---------------------------------------
  <telerik:RadComboBox ID="cmbSeries" runat="server"  AutoPostBack="true"
                                    OnClientSelectedIndexChanging="OnClientSelectedIndexChangingSeries" / >       
-----------------------------------------------------------------------------------------

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Jul 2011, 01:14 PM
Hello Sunil,

I am not quite sure about the requirement. I suppose you want to access the SelectedItem. If that is the requirement, here is the sample code that I tried which worked as expected.
JS:
<script type="text/javascript">
function OnClientSelectedIndexChangingSeries(sender, args)
{
var btnAdd = $find("<%=cmbSeries.ClientID %>");
alert(btnAdd.get_text()) ;
}
</script>

Also take a look at the following help documentation which explains more about this.
Client-Side Basics.

Thanks,
Shinu.
Tags
ComboBox
Asked by
Sunil
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or