RadComboBox looses selected item when click on other parts of page

14 posts, 0 answers
  1. David
    David  avatar
    35 posts
    Member since:
    Dec 2008

    Posted 02 Oct 2009 Link to this post

    I have the lastest edition of Radcontrols installed here.  However I am developing for Sitefinity 3.7 SP1.  I place a Radcombo box into a user control and populated the control using linqtosql.  Then added a search button to search the database. 

    <asp:LinqDataSource ID="LinqDataSource2" runat="server"   
        ContextTypeName="Offices.BillingDataClassesDataContext" OrderBy="Name"   
        TableName="sc_Tribunals" Select="Distinct">  
    </asp:LinqDataSource> 
    <telerik:RadComboBox ID="rcbSearchBox" Runat="server"   
        DataSourceID="LinqDataSource2" DataTextField="Name" DataValueField="OfficeId"   
        MarkFirstMatch="True" AllowCustomText="True">  
    </telerik:RadComboBox> 
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click"   
        Text="Search By City" /> 


    The RadComboxBox appears work find with small amount of items lets say 10 items loaded.    The OfficeId value type is a GUID, and the DataTextField is a just a string contain city names.

    If I select an item near the bottom of the dropdown then click anywhere on the page, the selected item drops and the RadCombo box selects an item near the top of the list.  I found this to be the case with the lastest version of Firefox and IE8/7. 

    Am I missing something.
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 07 Oct 2009 Link to this post

    Hello David ,

    We could not reproduce the problem in our RadComboBox / LinqDataSource demo. Can you reproduce the problem outside Sitefinity (in a blank new web application)? Are the values of the items really unique?

    Regards,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David  avatar
    35 posts
    Member since:
    Dec 2008

    Posted 07 Oct 2009 Link to this post

    Thanks for getting back with me. I ended up just loading the Office Name into the Combo box and dropping the OfficeID.  
    My solution was to load the combo on form load.  I loaded my Office Name into a list and check for duplicates then biinded the list to the control

    When I get caught up here I will go back try using GUID again with this approach to see if if happens again.  I think the OfficeId(Guid) should be a unique value since it is my primary key in the database table.  

    I did have a layout problem with IE8 where the combo box would run under the command button next to it.  My work around for that was just set up a table with two columns.

    Thanks for the reply, I will did dig in to this when I get caught up and let you know if I find anything.   I really do like the RadCombo box, this was the first time I had use for it.

    David
  5. Pascal
    Pascal avatar
    15 posts
    Member since:
    Mar 2009

    Posted 12 Oct 2009 Link to this post

    We've got the same issue, for some of our RadComboBoxes. In Firefox, once you leave these boxes, automatically some other item, mostly the last item is selected. Unfortunately I was not able to reproduce this issue in a separate project. Even if I don't use the value property (like David suggested) the same problem occurs. I noticed that it only occurs for the combo boxes which contain items with text and spaces. Some other Boxes which only contain numbers work fine.

    Could you maybe give me some hints how to debug this problem? I am using FireBug, and was inspecting this issue, I tried to set some break points but they were not passed. Do you have any ideas where I should set a break point to check what's going on, or which values to check?
  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 14 Oct 2009 Link to this post

    Hi Pascal,

    The best way to proceed would be to send us a sample project where we can reproduce the issue locally. We will debug our code and find where the problem is.

    Thanks

    Sincerely yours,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Pascal
    Pascal avatar
    15 posts
    Member since:
    Mar 2009

    Posted 15 Oct 2009 Link to this post

    Finally we figured out the cause for our problem. It seems to be again a conflict between an other third party component (esri) and the rad components. We had an issue like this before and you figured out a solution. We hope there is a solution to this problem also. I will file in a sample project with a support ticket.
  8. Matt
    Matt avatar
    78 posts
    Member since:
    Mar 2009

    Posted 15 Jan 2010 Link to this post

    Was there ever a reproduction of this at Telerik?  I'm running across the same thing (select a value in the combobox, click anywhere outside of the combobox and the value is changed).

    In my case, however, it only happens sometimes.  (Also, when I use the keyboard to make the change and then tab to the next control, the selected value typically stays selected -- no change takes place.)
  9. Pascal
    Pascal avatar
    15 posts
    Member since:
    Mar 2009

    Posted 18 Jan 2010 Link to this post

    They answered us this and it solved the problem:

    "Looks like this is a bug in our RadControls for ASP.NET AJAX which has nothing to do with ESRI's controls. When you specify Filter the AllowCustomText mode is automatically switched on, but seems its not properly initialized. So, as a workaround try setting radComboBox.AllowCustomText = true after creating the controls in Page_Load."
  10. Matt
    Matt avatar
    78 posts
    Member since:
    Mar 2009

    Posted 18 Jan 2010 Link to this post

    Thanks, but unfortunately, that didn't do the trick.

    I *did* notice, however, that the selection changes ONLY when a non-unique first word value is selected.  For example, if I load the following into a combo box:

    Search 1
    Search 2
    Search 3
    Object Type
    Object Form
    Created By
    Creation Date
    Creation Time

    and select Search 2 or Search 3, when I click anywhere outside the combo box, Search 1 gets selected.  If I select Object Form, Object Type is selected and when I select Creation Time, Creation Date is selected.

    It appears this has to do with the first word in the list vs. anything else.  Is there a setting I'm missing?  Here's the code for the combo box declaration:

    <telerik:RadComboBox  
       ID="cboKeywordFields"  
       EnableLoadOnDemand="true"  
       OnChange="MakeDirty()"  
       runat="server"  
       Width="300" /> 
  11. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 20 Jan 2010 Link to this post

    Hi Matt,

    Please make sure that the items have different Value properties. If two items have the same Value - the combobox will chose the first one even if you selected the second one.

    Try setting unique Value property for each items and I believe the problem will not manifest.

    Regards,
    Veskoni
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  12. Balageetha
    Balageetha avatar
    12 posts
    Member since:
    May 2014

    Posted 19 Aug 2014 in reply to Veselin Vasilev Link to this post

    I am also facing the same problem but i didnt get the solution yet. Rad combobox with Ajax is not focusing the selected value.The same problem mentioned above.The values are Unique only.but i didnt get the solution.

    Waiting for the Solution.

    Thanks
  13. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Aug 2014 in reply to Balageetha Link to this post

    Hi Balageetha,

    I guess you want to select an Item from RadComboBox on blur. Please check the below sample code snippet which works fine at my end. Please elaborate your requirement if it doesn't help.

    ASPX:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rcboTestItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rcboTestItems" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadComboBox ID="rcboTestItems" runat="server" EmptyMessage="select" OnClientBlur="selectItem">
        <Items>
            <telerik:RadComboBoxItem Text="Item1" Value="1" />
            <telerik:RadComboBoxItem Text="Item2" Value="2" />
            <telerik:RadComboBoxItem Text="Item3" Value="3" />
        </Items>
    </telerik:RadComboBox>

    JavaScript:
    <script type="text/javascript">
        function selectItem(sender, args) {
            sender.findItemByValue("2").select();
        }
    </script>

    Thanks,
    Shinu.
  14. Balageetha
    Balageetha avatar
    12 posts
    Member since:
    May 2014

    Posted 19 Aug 2014 in reply to Shinu Link to this post

    Hi shinu,
                   Thanks for your reply.

                   I didn't get the solution.I am using a RadCombobox inside a Rad List View which is ajaxified and contains a Item Template and EditItem Template.

                   The Rad combobox is within the Edit Item Template
    .aspx
    =====
    <rad:RadComboBox ID="ddlStatus" runat="server" Width="100px" DropDownWidth="200"
                                                                    AppendDataBoundItems="true">
                                                                    <Items>
                                                                        <rad:RadComboBoxItem Text="None" Value="0" />
                                                                    </Items>
                                                                </rad:RadComboBox>

                   i am binding this combo box in the server side in the RadListView_ItemCreated event as follows,
    .aspx.cs
    =======

      protected void RadListView_ItemCreated(object sender, RadListViewItemEventArgs e)
            {
                if (e.Item.ItemType == RadListViewItemType.EditItem)
                {

                    RadListViewDataItem item = e.Item as RadListViewDataItem;
                    string ChecklistHeaderId = item.GetDataKeyValue("ChecklistHeaderId").ToString();
                    string InspectionChecklistItemID = item.GetDataKeyValue("InspectionChecklistItemID").ToString();
                    string checklistItemStatus = item.GetDataKeyValue("checklistItemStatus").ToString();
                    RadDropDownList statusCombo = (RadDropDownList)e.Item.FindControl("ddlStatus");
                    statusCombo.DataSource = MOCAdministration_BLL.FetchChecklistStatusItemByChecklistHeaderID(iProcess.Util.IProConvert.toInt32(ChecklistHeaderId));
                    statusCombo.DataValueField = "ChecklistStatusHeaderID";
                    statusCombo.DataTextField = "StatusDesc";
                    //statusCombo.DataBind();
                    // statusCombo.Items.Insert(0, new RadComboBoxItem("None", "0"));
                    if (statusCombo.Items.Count > 0)
                        statusCombo.SelectedValue = checklistItemStatus != null ? checklistItemStatus : "0";
                }
            }




















  15. Balageetha
    Balageetha avatar
    12 posts
    Member since:
    May 2014

    Posted 19 Aug 2014 in reply to Balageetha Link to this post

    Hi shinu,

              It is working fine now.


    Thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017