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

Page scroll to top of the screen when radcombobox selected changed indexed is fired

3 Answers 153 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kuldeep
Top achievements
Rank 1
Kuldeep asked on 09 Feb 2011, 08:18 AM
hi telerik team,
I have got an issue regarding radcombobox.The scenario is as follow.
I have a radcombobox in the middle of the form .
On the selected changed indexed of this radcombobox i have to fill some textboxes that are on  the form.This radcombobox and the text boxes are using ajax to avoid postback.But when i do click on this radcombobox ,the screens scrolls down to the top .Can you please tell why is it happening?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Feb 2011, 11:03 AM
Hello Kuldeep,


I had a similar requirement in my application, and when I ajaxified the controls using AjaxManager, the page retains the scroll position. Here I am pasting my code.

ASPX:
<telerik:RadAjaxManager ID="ajaxm" runat="server">
         <AjaxSettings>
             <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                 <UpdatedControls>
                     <telerik:AjaxUpdatedControl ControlID="TextBox1" />
                 </UpdatedControls>
             </telerik:AjaxSetting>
         </AjaxSettings>
     </telerik:RadAjaxManager>
 
     <telerik:RadComboBox CloseDropDownOnBlur="true" ID="RadComboBox1" runat="server"
         AllowCustomText="false" OnClientLoad="OnLoad" Height="80" OnClientKeyPressing="OnClientKeyPressing"
         OnClientDropDownOpening="OnClientDropDownOpening" OnClientDropDownOpened="OnClientDropDownOpened"
         AutoPostBack="True" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
         <Items>
             . . .
         </Items>
     </telerik:RadComboBox>
 
     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

Setting the TextBox Text from code:
protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
    TextBox1.Text = "selection made"; // populate the textbox
}



-Shinu.
0
Kuldeep
Top achievements
Rank 1
answered on 09 Feb 2011, 02:04 PM
Thanks Shinu for your quick response.
 I have tried the settings that you specify for the radcombobox in your code snippet but it has not effects on the scrolling of the page back to the top.Still i m getting the same problem i.e the page scroll back to the top when radcombobox selected index is fired.Is there any other solutions for the same problem.

Looking forward to hear from you…

0
Shinu
Top achievements
Rank 2
answered on 10 Feb 2011, 06:45 AM
Hello Kuldeep,


Another option to get this functionality is making use of "scrollIntoView()"  method. When the selection is made in combobox, set a HiddenField value. Now in the client side pageLoad event, check for the HiddenField value and call the scrollIntoView().

Same kind of scenario is described in the following forum.
How to set focus for label or page last



-Shinu.
Tags
ComboBox
Asked by
Kuldeep
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kuldeep
Top achievements
Rank 1
Share this question
or