locked
Why can not use DropDownList? RRS feed

  • Question

  • Hello. 

    I want to use DropDownList.
    I know that you say "Make DropdownList. Silverligt 2 + VS2008 can it."

    But, Before considering logic meet specifications, DropDownList's logic must consider.
    Thousands, tens of thousands, hundreds of thousands of programmers need spend time to make DropDownList.
    This is a big waste.

    Why is DropDownList removed, I can't understand.
    Please add immediately.

    Thank you.

    Tuesday, April 1, 2008 2:28 AM

Answers

  • hello mchlSync.

    Thanks to the quick reply.

    You say that you are following.
    1.Still in the beta stages, DropDownList is not.
    2.At this stage, use the program which other person is made.
    3.Otherwise, the only wait for the finished product.

    OK. I use a program made by other people.
    And I wait for finished product.

    I hope finished product have a DropDownList.
    Please add.This is all.

    Thank you.

    Tuesday, April 1, 2008 3:54 AM

All replies

  • Since Silverlight 1.0 and 1.1 Alpha, there were no control for Silverlight.

    In Silverlight 2 beta1, we got a few standard controls such as Button, Datagrid or etc. but DropDownList is missing in Silverlight 2 beta1. (It is not removed. Dropdwonlist is never a part of Silvelight until now. ) 

    In order to save thousands, tens of thousands, hundreds of thousands of programmers' time, you should probably develop one Silverlight custom DropDownlist control and make it opensource. So, we all can use it. :)  

    Otherwise, we have to wait some time to get the dropdownlist from Microsoft.  

    Tuesday, April 1, 2008 2:51 AM
  • hello mchlSync.

    Thanks to the quick reply.

    You say that you are following.
    1.Still in the beta stages, DropDownList is not.
    2.At this stage, use the program which other person is made.
    3.Otherwise, the only wait for the finished product.

    OK. I use a program made by other people.
    And I wait for finished product.

    I hope finished product have a DropDownList.
    Please add.This is all.

    Thank you.

    Tuesday, April 1, 2008 3:54 AM
  •  Hi Hiro-tarou,

     

    You're right. We all need this control. Scott Guthrie just posted on his blog that it will be included in the final release. Meanwhile you can try the controls out there:

    http://blog.seancleaver.com/sean_cleaver/2008/05/combobox-dropdo.html This is a really simple control, but can meet a few scenearios. 

    http://www.vectorlight.net/controls/dropdown_list.aspx This is a better control, but complex to use and with a couple of bugs. 

     You can find others, I'll probably post mine if time permits. 

    Wednesday, June 18, 2008 5:51 AM
  • Exapanding on that topic, I tried the first sample and was really simple, I used it as a base and customize it to meet our needs.

    The second one was super buggie, really complex and worked great for simple escenarios, but in other's, for example nested dataItems with custom templates or two way binding, it simple crashed and chrashed.

    We did one, was really easy to implement, isnot really sexy, but allowed us to work while we get a real one. Here's the code:

    <StackPanel>

    <TextBlock MouseLeftButtonDown="textBox_MouseLeftButtonDown" x:Name="textBox" Height="18" FontSize="10" Text="ListBox" MinWidth="100"/>

    <ListBox x:Name="listBox" ItemsSource="{Binding Valores}" MaxHeight="75" Visibility="Collapsed"

    Style="{StaticResource listBoxBaseStyle}" SelectionChanged="listBox_SelectionChanged" DisplayMemberPath="Value"

    MouseLeave="listBox_MouseLeave">

    <ListBox.ItemContainerStyle>

    <Style TargetType="ListBoxItem">

    <Setter Property="Background" Value="Transparent"/>

    </Style>

    </ListBox.ItemContainerStyle>

    </ListBox>

    </StackPanel>

    ublic partial class DropDownList : UserControl

    {

    public DropDownList()

    {

    InitializeComponent();

    }

    public event EventHandler<DataEventArgs<int>> SelectedItemChanged;

    #region Cachadores
    private void textBox_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

    {

    ToggleVisibility();

    }

    private void listBox_MouseLeave(object sender, MouseEventArgs e)

    {

    listBox.Visibility =
    Visibility.Collapsed;

    }

    private void listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)

    {

    if (SelectedItemChanged != null)SelectedItemChanged(this, new DataEventArgs<int>(listBox.SelectedItem));

    }

    listBox.Visibility = Visibility.Collapsed;

    }

    #endregion

    #region
    Privadasprivate void ToggleVisibility()

    {

    if (listBox.Visibility == Visibility.Visible)

    listBox.Visibility = Visibility.Collapsed;

    else

    listBox.Visibility = Visibility.Visible;

    }

    #endregion

    }

    Friday, July 4, 2008 6:55 PM

  • Friday, July 18, 2008 11:58 AM
  • Sorry about that, I didnt post the complete sample. DataEventArgs is really simple and it's used to pass EventArgs than expose only a data parameter. I found this class in the the Mobile Client Software Factory project from Patterns & Practices, but I have seen it used in different projects, has been really useful, we dont want to create different EventHandlers and EventArgs everytime we just need to pass a different type of object.

    public class DataEventArgs<T>:EventArgs

    {

    public T Data { get; private set; } public DataEventArgs(T data)

    {

    Data = data;

    }

    }

     

     

    Friday, July 18, 2008 1:07 PM
  • Hi ,

    Im trying to create a combobox sample. The code mentioned above kindoff worked but not entirely...Am i missing something ? The dropdown doesnt seem to show up.. I can see the items in the listbox but it does popup ?

    Any help? 

    Thanks,
    SilverUser 

    Friday, July 18, 2008 1:38 PM
  • I post the source code an everything on my blog www.miguelmadero.com (Silverlight's DropDownList), you might also want to check the Silverlight Tip of The Day column, it's new and only has 6 posts, but I'm trying to do it daily (except for the weekends).

     

    You can get it here

    Friday, July 18, 2008 3:45 PM
  • Thanks a ton !

    Sunday, July 20, 2008 8:03 AM