5 Answers, 1 is accepted
0
Wenlong Yi
Top achievements
Rank 1
answered on 23 Jul 2009, 02:38 AM
AutoPostBack="false" ?
0
Shinu
Top achievements
Rank 2
answered on 23 Jul 2009, 06:51 AM
Hi Benjamin,
I guess you want to prevent postback when selecting a particular item and want postback for all other items. If so you can try the following approach by invoking ajaxrequest/postback after checking the selected item from client side event OnClientSelectionIndexChanged. Here is the code that I tried.
ASPX:
JavaScript:
Note: I have not set the AutoPostBack property to True.
C#:
-Shinu.
I guess you want to prevent postback when selecting a particular item and want postback for all other items. If so you can try the following approach by invoking ajaxrequest/postback after checking the selected item from client side event OnClientSelectionIndexChanged. Here is the code that I tried.
ASPX:
| <telerik:RadComboBox ID="RadComboBox1" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1"> |
| </telerik:RadComboBoxItem> |
| <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2"> |
| </telerik:RadComboBoxItem> |
| <telerik:RadComboBoxItem runat="server" Text="DoNot PostBack" Value="DoNot PostBack"> |
| </telerik:RadComboBoxItem> |
| </Items> |
| </telerik:RadComboBox> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| </telerik:RadAjaxManager> |
JavaScript:
| <script type="text/javascript"> |
| function OnClientSelectedIndexChanged(sender, args) |
| { |
| if(args.get_item().get_text() != "DoNot PostBack") |
| { |
| $find("<%=RadAjaxManager1.ClientID%>").ajaxRequestWithTarget("RadComboBox1", "PostBack"); |
| } |
| } |
| </script> |
C#:
| protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| } |
-Shinu.
0
Benjamin
Top achievements
Rank 1
answered on 23 Jul 2009, 07:46 PM
hi
thanks mates, much appreciated. and you clearly understood my scenario and it is working good. thank you very much.
thanks mates, much appreciated. and you clearly understood my scenario and it is working good. thank you very much.
0
Mani PC
Top achievements
Rank 1
answered on 15 Oct 2009, 11:39 PM
can you please provide me sample code for doing it on the code behind. I want to use VB.Net on the code behind to aviod screen filckering when selecting items from the radcombobox.
0
Shinu
Top achievements
Rank 2
answered on 16 Oct 2009, 01:16 PM
Hi Mani,
I guess you want to prevent whole page refresh when selecting an item from RadComboBox. If so you can ajaxify the combobox either by using RadAjaxManager or RadAjaxPanel Controls. Checkout the following links to know more about these controls.
AJAX Manager
AJAX Panel
-Shinu.
I guess you want to prevent whole page refresh when selecting an item from RadComboBox. If so you can ajaxify the combobox either by using RadAjaxManager or RadAjaxPanel Controls. Checkout the following links to know more about these controls.
AJAX Manager
AJAX Panel
-Shinu.