How to validate a combobox in silverlight 5 MVVM pattern - silverlight

How to validate a combobox in silverlight 5 (I am preparing a report in silverlight5 with MVVM pattern and on search button, if the checkbox is checked, the user has to select an item from the combobox..)
Also, i am using the below to set the default content text as "Select One"...is there any other better way to do it. The problem using below link is ..if i select an item from the combobox and then later i decide to keep it blank..i have no way of doing it but reload the webpage..
Silverlight: Default value in Combobox
Any help would be much appreciated..please I need it urgently
Thanks in advance!!

Related

WPF Telerik DataFormCombobbox losed its selected item in edit mode

I am using WPF Telerik dataform & Grid, I have set the auto generate columns to false for the dataform where as I set it true for the grid.
DataFormCombobox loses its selected item when I enter edit mode in the data form. Please some one help.
Regards,
Kannan M.
I got an answer myself, It looks like it happens only when I use DataFormCombobox, When I change it to DataFormDataField inside which I kept the RadCombobox, and set the same binding which had no such issue.It's a workaround but I could not se any other option.

How to show additional info in a vaadin combobox selection list?

I'd like to have a combobox where there is a lot of information in the list to select from or search but only parts of it are shown after selection.
For example when the user starts typing "raf" the combobox should show a list like this:
RA - Raffael (raffael#example.com)
HU - Hugo (hugo#rafferty.xyz)
After selecting the entry "Raffael" only "RA" should be shown in the combobox.
I need that because of the limited space for the combobox in my application. So the combobox should not be wider than needed to hold some characters but the list to select from may be much wider. Is there an easy way to achieve that? Or which function i have to overwrite in combobox to set the text line after the selection?
Thanks
This is not possible with a standard Vaadin ComboBox without custom client side coding.

Silverlight Editable Combo Box

I want to use comobox which is editable in my silverlight project, but silverlight doesnt provide a such control.
If any one knows how to create a custom editable combobox in silvelight 4.0 then please help me.
Editable combobox means:
A combo box providing list of
options.
User can enter the value.
Filtering.
Sounds like you are looking for the AutoCompleteBox.
Allows user to type value
Can simply dropdown like a combox
Partial value typed can be used to filter choices using either StartsWith or Contains mode.
Supports a create new entry operation if the final typed value does not match any existing entry
This control is part of the standard SDK and is found in the System.Windows.Controls.Input.dll. You should be able to drag it from the toolbox.
You can also have a look Lookup Combo Box

Adding filter textbox to header of a Listview in Gridview mode

I watched a demo video of Mole 2010 (a WPF debugger) in which there is a nice datagrid feature where the header contains a filter textbox, so you can type in a string and filter for that column. Here is the video, the feature is demonstrated at 3:00 minutes
http://www.youtube.com/watch?v=bgMg61iM9G8&feature=player_embedded#at=180
I am interested in replicating that feature, but I am not sure how to do it gracefully. My application is a WPF MVVM EF app, it's my first WPF app.
Is it possible to create a template for the header where I can also add a textbox, and a button with a cross so the contents can be cleared?
If so, how could I bind the textbox to filter its column?
Should I be hiding the actual header row and making an artificial one where I add my own header and textbox and button etc. and then bind them to filter clause properties that I add to my CollectionViewSource when a filter string is typed? I hoped to avoid this so I could retain sorting by clicking the header.
I dont really know how to start this. Are there any gurus that could suggest how this could be done? Thanks!
You might have a look at the BookLibrary sample application of the WPF Application Framework (WAF). It shows how to use a TextBox for filtering the data in a DataGrid. It uses MVVM and the Entity Framework as well.
you might want to try that : http://dotnetexplorer.blog.com/2011/04/07/wpf-itemscontrol-generic-staticreal-time-filter-custom-control-presentation/ => it filters any collections and you just have to decalre the control in XAML...

DatePicker with the ability to choose a span

Here is a quick visual of the idea that I got from Google Analytics.
ComboBox Collapsed:
ComboBox Collapsed http://www.googlemapscontrol.net/images/CalendarDropDownClosed.jpg
ComboBox Expanded:
ComboBox Expanded http://www.googlemapscontrol.net/images/CalendarDropDownOpen.jpg
I am not concerned with the functionality of the timeline or the date range text boxes. Basically I am looking to have something that looks kind of like a ComboBox with a single calendar control. When the date range is selected and the control is closed then the range is shown in the text box.
I don't think that I can get a ComboBox to behave this way and I think that I need to use something along the lines of a textblock, button and a popup.
Does anyone have a sample I can start with?
If you don't have a sample how would you approach this issue?
Thanks
The WPF Toolkit has a Calendar/DatePicker control that could be a suitable base for you to modify into an elaborate date range picker.
I would start with the DatePicker Generic.xaml file from the WPF Toolkit distribution, and examine what they have done with the DatePicker control template. The interesting section for you will be around the area that PART_TextBox and PART_Button is used. They indeed use a combination of grids, textbox, button, and popup controls.
Hope that helps!

Resources