Initialize value for the RadCombobox with Load In Demand feature

13 posts, 0 answers
  1. Tai
    Tai avatar
    73 posts
    Member since:
    Jun 2010

    Posted 11 Jan 2011 Link to this post

    Hi

    1.
    I tried to follow your method at Link in order to implement the Load-On-Demand feature for the RadCombobox . And it only works when i have added the Virtualization property. However, no matter what i tried , i can't make the initial BOUNDED value of the RadCombobox displayed. Your Demo is the same situation too(a blank radcombobox)

    this is really bad because i have to do some binding with the Radcombobox such as SelectedValue={Binding DocumentCode, Mode=Twoway} and it won't show any initial value on the combobox.

    2.
    My second problem is that I want this Load-On-Demand to be able to apply for the combobox which is inside the RadGridView because one of the column of my radgridview has been bounded to CustomerId . And i can't show that customerId and have to show CustomerCode. The only method which i know of is to user either GridViewCombobox or Radcombobox(through datatemplate). However, because my Customer table will have over 100,000 records. With that large data, i need the Load-On-Demand for my combobox inside the radgridview.(and bind initial value correctly)

    Can you show some sample demonstration at how to do these two scene? This is very common scene. I think a lot of us will need to know too

    thank you
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 13 Jan 2011 Link to this post

    Hi Tai,

    Unfortunately I think that would not be possible for the following reasons :

    You need the initial value displayed. This means the combo box needs to translate the  bound value to a display value.

    This "translation" is based on a search in the ItemsSource collection. RadComboBox tries to find a matching value in the source collection and if it does not find one it can not display the value.

    For a successful search you need the whole collection loaded which contradicts with virtualization.

    Sincerely,
    Pavel Pavlov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. Tai
    Tai avatar
    73 posts
    Member since:
    Jun 2010

    Posted 13 Jan 2011 Link to this post

    Hi Pavel,

    i checked your ASP.NET combobox control and know that my asking feature is available .
    Why isn't it available for Silverlight combobox.

    If we can't show the BOUNDED value for the radcombobox after loading all of the UI, then what is the point for using the feature Load in Demand

    because your control can't show the initial value now.

    Can you suggest me how i can handle my case with other method?(sample project will be great)
    "Basically my collection will be very large(so loading entirely the whole collection will kill the application). And i don't want to display the ItemId but want to display the ItemDescription.And it should show the BOUNDED value on the initial state"
    and that method should work for both standalone control(not inside any control) or the one inside the RadGridView. 
    i do know about 
    <telerik:RadComboBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VirtualizingStackPanel />
                            </ItemsPanelTemplate>
                        </telerik:RadComboBox.ItemsPanel>
                    </telerik:RadComboBox>
    and all of my radcombobox has it now to speed up the loading. But my collection can reach from 30,000 records to 1mil records

    Right now , i only know about the RadCombobox/GridViewComboboxColumn . If i am using wrong one for my requirement, plz suggest me a better one

    This feature is very important for my application. Thank you for helping
  5. Valeri Hristov
    Valeri Hristov avatar
    40 posts
    Member since:
    Dec 2003

    Posted 17 Jan 2011 Link to this post

    When there is no ItemsSource, the SelectedValue property keeps the initial/desired value until the ItemsSource is set. When the ItemsSource is set, RadComboBox will try to select the item with the specified value, but only once. If the item was not found, the control will not try to reselect items again. I suppose this is what causes your problems.

    Unfortunately there are no known workarounds that might help you. We are working on a solution, but unfortunately at this time I cannot say when it will be available.

    Regards,
    Valeri Hristov
    Telerik
  6. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 18 Jan 2011 Link to this post

    Hello Tai,

    Can you please share the structure of your data, the one you are setting as ItemsSource for the combo.
    Depending on it we may try find a workaround.
    What is most important for me to know is: is it a collection of strings ,or is it a collection of complex objects which requires matching selected value to display property ?

    Best wishes,
    Pavel Pavlov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  7. Tai
    Tai avatar
    73 posts
    Member since:
    Jun 2010

    Posted 18 Jan 2011 Link to this post

    Hi Pavel

    the itemsSource of the combobox is fed to the collection of the EntitySet (I am using Entity Framework 4) which is a collection of rows in my table

    For example , a collection of FinancialDepartments from FinancialDepartment table in database:
    FinancialDepartmentId, DepartmentDescription, DepartmentCode,...
    because i can't display FinancialDepartmentId to the user , i have to use the displaymemberpath to dispaly DepartmentCode instead

    thank you
  8. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 21 Jan 2011 Link to this post

    Hi Tai,

    For the case of complex object with ID and Display value, I am afraid you can not rely on the client side to make the translation. This is because as mentioned earlier - we do not all the data necessart at the client side.

    Since the lookup collection is large , I strongly believe the lookup logic should be performed at the server side . This means the table at the client should already have the initial value ( the code, not the  Id  ) when it arrives from the server.
    In other words I would suggest to alter the method that gets the table data for RadGridView to return a table with the codes, rather than the IDs.

    Greetings,
    Pavel Pavlov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
     
  9. Tai
    Tai avatar
    73 posts
    Member since:
    Jun 2010

    Posted 22 Jan 2011 Link to this post

    Hi Pavel

    i have just included a snapshot of one of my screens(Master-Detail scene) and the table PolicyInstallment(Master one, which will be filled out by TextBox and radcombobox), PolicyTransaction(Details One which is inside the radgridview) in sql . The other screens will be similar like that screen

    UPDATE: maybe 1mil data is too large. What if my collection for the combobox is only between 20,000 to 50,000 datas
    For all of my screens, the user will be able to :
    1.
    Edit(the existing Installment on the Installment table by using the SEARCH button to retrieved a specific one). Ok, if you look at the PolicyNumber radcombobox, that one will have very huge list(might be between 30,000 to 50,000). So if my RadCombobox can't show the value of the bounded object, then HOW I CAN SHOW MY EXISTING DATA(PolicyInstallment one in this case) /// OR let the user pick up a new PolicyNumber inside the radcombobox.
    2.
    Create NEW data (policyInstallment)
    3.
    Inside the radgridview,
     the Coverage Code column will be a gridviewcomboboxColumn. Which also contain a huge list. Well this situation You already talk about and now i know that we can't do that with our current technique now. I will consider your advise. But one problem is that the user WILL BE ABLE TO INSERT new row in the grid too(not just display)????

    So these are my questions:
    Q1:
    can you tell me how long i need to wait the radcombobox will be able to do stuff like the one in the ASP.NET with loading on demand and also can show the initial value?.
    Q2:
     But right now, I need to know a way to deal with my case 1(Edit)(the combobox Policy Number not inside the Radgridview). if using combobox isn't a good option, then what kind of method should i use in order to let user Input new policyInstallment and See the existing one.


    thank you
  10. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 27 Jan 2011 Link to this post

    Hi Tai,

    On Question1 : Can you please point me to a sample where the ASP.NET combo exposes such behavior. 

    On Question 2:
    I would definitely not recommend to use a combo box to perform a search among thousands or millions of items. The control is simply not intended for such purpose.

    The combo box  search operation may be  performed on the client  only . This means you will need to load all the thousands/millions items at the client.

    This will be heavy both for the client side search and for the service over the wire as transferring millions of items to the client is expected to be  slow.

    Such operations should be performed at the server - e.g. the user can enter some criteria in a text box , then the server will return a small portion of data displayed in a list  so the user can chose from .

    If the user knows the exact id - then it may be again entered in a textbox and the server shall return only the required record.

    Am I missing something ?

    All the best,
    Pavel Pavlov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  11. Tai
    Tai avatar
    73 posts
    Member since:
    Jun 2010

    Posted 27 Jan 2011 Link to this post

    Hi Pavel,

    For the search button, what i mean is the "...." radbutton in my picture.
    when you click on that button, it will pop up a radwindow which contains a radgridview paged by radDatapager to show a list of my PolicyInstallments.After choosing one of the available policyInstallment, 

    we will go back to the screen myScreen.PNG and it will automatically fill out everything including the value of PolicyNumber on the radcombobox.
    Note that: if you look at my sqlTABLE.PNG , the policyInstallment table has a field PolicyId (not PolicyNumber which is a Foreign-Key ). So in order to show the PolicyNumber, I am using the RadCombobox




    I hope you understand my explanation(if not , plz let me know so i can make a video to let you see what is going on my screen).

    If using RadCombobox isn't a good option for my PolicyNumber Radcombobox case, then how i can let the user do:
    1. For a NEW policyIntallment, let them pick the available PolicyNumber(my table only has PolicyId)
    2. When the "..." radbutton is pressed and an available policyInstallment has been chosen. Then the PolicyNumber (?combobox?) will be automatically filled out
  12. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 02 Feb 2011 Link to this post

    Hi Tai ,


    1. For the case of new  Policy, you can show a combo. Here I am not sure how you handle the case of 100 000 records. In fact I can not imagine the user to chose among 100 000 numbers.

    2. For the case of the existing Policy - you may modify the service method and the stored procedure to return the PolicyNumber  as well( a simple join operation) .
    in case you do not want to do that , then there is an alternative :

    You may provide a service method e.g. GetPolicyNumberByID(). Then calling it you may populate a textbox, or even a combo with a single item.
    This is the better way as only one record will travel over the wire ( as the conversion from ID to Number is made on the server and there is no need for all the records to be passed to the client) .

    Best wishes,
    Pavel Pavlov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  13. Naresh
    Naresh avatar
    1 posts
    Member since:
    Nov 2010

    Posted 11 Apr 2011 Link to this post

    Hi Telerik,
    Do you have any update for this issue on how to fix the problems with virtualization when editing a record. By default virtualized drop down does not show selectedvalue because by that time it did not bring back all those records?

    Thanks,
    naresh
  14. George
    Admin
    George avatar
    1332 posts

    Posted 15 Apr 2011 Link to this post

    Hi Naresh,


    Please, refer to the following links:

    I hope this helps.


    Kind regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner