Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<Window x:Class="SlidingChart.Window3"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:ext="clr-namespace:eisiWare;assembly=NumericUpDown"

        Title="Window3" Height="300" Width="300" Loaded="Window_Loaded_1">
    <Grid>
        <
        <ext:NumericUpDown Name="cmb"  ValueChanged="cmb_ValueChanged"  ></ext:NumericUpDown>
        <;
    </Grid>
</Window>


cs file
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SlidingChart
{
    /// <summary>
    /// Interaction logic for Window3.xaml
    /// </summary>
    public partial class Window3 : Window
    {
        public Window3()
        {
            InitializeComponent();
        }

        private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
        {

        }

        private void cmb_ValueChanged(object sender, RoutedEventArgs e)
        {

        }

        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
           int  ymax = 700;
            List<double> inp = new List<double>();
            for (double i = ymax; i >= 0; i--)
            {
                inp.Add(i);
            }

            cmb.DataContext = inp;
            
        
        }
    }
}


i want to bind the value in numeric up down control.
Posted
Updated 13-Nov-13 2:53am
v2
Comments
Francisco T. Chavez 13-Nov-13 6:21am    
You want to bind the value in the numeric control to what?
kumar9avinash 13-Nov-13 6:34am    
hi , i want to dsplay 1 to 700 in that numeric up down control, that means when i am pressing vertical scrolling , yhe valu should change

http://www.google.co.in/imgres?imgurl=http://elegantcode.com/wp-content/uploads/2010/11/numericupdown_thumb.png&imgrefurl=http://elegantcode.com/2010/11/07/extended-wpf-toolkitrelease-1-2-0/&h=170&w=409&sz=6&tbnid=JvVGxrxEo5R-4M:&tbnh=119&tbnw=286&zoom=1&usg=__HTLM_DZEuZJw5sjzYHKI1qIvPlE=&docid=znKK7XqWt-qI4M&sa=X&ei=KGODUuKMGIrlrAfV5oC4DQ&ved=0CEAQ9QEwCQ
Francisco T. Chavez 13-Nov-13 6:38am    
Ok, just set the min value to 1 and the max value to 700, but that still doesn't tell us what you want to bind the value to.

Are you trying to set the selected value on the list with the numeric box?
kumar9avinash 13-Nov-13 6:47am    
yes
Francisco T. Chavez 13-Nov-13 6:53am    
In that case, I would create a binding between the SelectedItem property of the combo box, and the Value property of the numeric box. Before I forget, you might want to change the list to ints. You are going to want discrete values that match up, and a double to int converter might be needed in the binding.

You already said you want the numeric box to change the selected item in the combo box, but do you want the selected item in the combo box to change the value in numeric box?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900