Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:07:32+00:00 2026-06-18T01:07:32+00:00

I have a working HTML form with a listbox from where the user can

  • 0

I have a working HTML form with a listbox from where the user can select from a list of standard bicycle tyre sizes. Each size maps internally to some numerical value, making the data source a Dictionary (map of key/value pairs).

The javascript implementation is as follows, and I would like to have the same behaviour in WPF with databinding (defining the dictionary/enum inside my domain-model class):

<select name="tiresize" id="tiresize"
    onchange="calcula();" style="width: 100px">
    <option value="305">26 X 1.0 (559 mm)</option>
    <option value="311">26 x 1 (650C)</option>
    <option value="312">26 X 1.5</option>
    <option value="324">26 X 1.9</option>
    <option value="330">26 X 1 3/8 (590 mm)</option>
    <option value="340">27 X 1</option>
    <option value="342">27 X 1 1/8</option>
    <option value="343">27 X 1 1/4</option>
    <option value="345">27 X 1 3/8</option>
    <option value="330">26 X 2.125</option>
    <option value="332">700 x 21</option>
    <option value="334" selected="selected">700 x 23</option>
    <option value="335">700 x 25</option>
    <option value="336">700 x 28</option>
    <option value="342">700 x 32</option>
    <option value="345">700 x 35</option>
    <option value="347">700 x 38</option>
    <option value="354">700 x 44</option>
    <option value="365">700 x 50</option>
    <option value="370">700 x 56</option>
</select>

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:07:33+00:00Added an answer on June 18, 2026 at 1:07 am

    You first need to set the DataContext of something (Window, Grid, etc.) that contains your ListBox to an instance of the class that contains the Dictionary. You can do this in XAML or in code. Then:

    <ListBox ItemsSource="{Binding MyDictionaryProperty}" DisplayMemberPath="Key"
             SelectedValuePath="Value" SelectedValue="{Binding wheelRadius}"/>
    

    As long as wheelRadius is of type int and has a public setter this will take the Value property of the SelectedItem (thanks to SelectedValuePath) and push that into SelectedValue, which will set your wheelRadius property through a TwoWay Binding (the default for SelectedValue, SelectedItem, and some others).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully created an HTML form that gets a file from a user
I have an HTML form that a user can add an arbitrary amount of
So I have an HTML form where a user can upload an image. This
I have a discussion forum/blog engine working with web forms. Each post contains html
I am working on templating system. I do have input of html document from
I have the following html form. Here the image upload is working fine. But
I have been working with rails3 , here the view.html.erb form have one login
I'm working on a simple JavaScript validation function for a html form, but have
I have one simple html form where the fields can be auto populated by
Is there anyway to redirect the user after posting a HTML form? I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.