Configure dropdownlist to show empty (blank ) option..

5 posts, 0 answers
  1. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 06 Feb 2015 Link to this post

    I have a dropdown list that is populated via ajax call.
    Depending on what the user is allowed to do the dropdownlist might only have 1 item in it.
    I need to add a empty option first, then append the ajax results.

    I do this all the time in asp.net webform applications, how does one configure a kendoui dropdownlist to display the empty row but not allow it to be selectable?

  2. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 06 Feb 2015 in reply to Wired_Nerve Link to this post

    <div class="selectdiv">
        <select data-role="dropdownlist"
                data-option-label="{FundingSource:'Select...',FundingSourceUID:''}"
                data-value-primitive="true"
                id="fundingsouce"
                data-value-field="FundingSourceUID"
                data-text-field="FundingSource"
                data-bind=" source: fundingsoucedta"></select>
        <div class="fundingsouce"></div>
    </div>
  3. Kendo UI is VS 2017 Ready
  4. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 07 Feb 2015 in reply to Wired_Nerve Link to this post

    A quick note here.  The dropdown  list in the scenario that is causing me issues is when there is only one option for the user to select.  Basically, I click on the dropdown list and see only one option...  I click on it, and the change event does not fire...
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 10 Feb 2015 Link to this post

    Hi,

    I tried to replicate the issue locally, but to no avail. Could you review the test Dojo demo and let me know if I am missing something? It will be very helpful if you can modify it in order to reproduce the issue.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 10 Feb 2015 in reply to Georgi Krustev Link to this post

    I ended up adding a empty record to the dataset that is coming from the server and setting its value to -1.
    Then in my code if the user selects that "blank" record I just prevent that selection.  I don't have time as of right now to dig deep into the dropdown control to figure out the exact problem.  
Back to Top
Kendo UI is VS 2017 Ready