New Posts New Posts RSS Feed: ComboBox Validation
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

ComboBox Validation

 Post Reply Post Reply
Author
Waahnsinn View Drop Down
Newbie
Newbie


Joined: 16-Apr-2010
Posts: 4
Post Options Post Options   Quote Waahnsinn Quote  Post ReplyReply Direct Link To This Post Topic: ComboBox Validation
    Posted: 21-Apr-2011 at 6:25am
Hi!
I've got a WPF Form on which I want to display a ComboBox. The selection of a value of this ComboBox is required so I need to display e.g. a RedBorder for this ComboBox if no value is selected.
The SelectedItem of the ComboBox is bound to the Property of the corresponding Entity.
The Validation is working - I only need a way to display the error...


Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 21-Apr-2011 at 11:09am
Waahnsinn,

Is it a pre-defined verifier, or a customer verifier which is generating the error status that's not being shown by the combobox control?

Could you post some code, so I can see how you're doing this? I can't really tell you what's wrong without being able to see what you're doing.

There are a few differences between DF validation in WPF and either Silverlight or WinForms. You may also want to look at the writeup for this on the DRC: http://drc.ideablade.com/xwiki/bin/view/Documentation/verification-ui#HVerificationwithaWPFUI

-- Robert
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 21-Apr-2011 at 1:34pm
You could try something like this to force the validation to display:
 
public void Window_Loaded(object sender, RoutedEventArgs e)
{
// we manually fire the bindings so we get the validation initially
cboName
.GetBindingExpression(TextBox.TextProperty).UpdateSource();
   

}

 

Greg


Back to Top
Waahnsinn View Drop Down
Newbie
Newbie


Joined: 16-Apr-2010
Posts: 4
Post Options Post Options   Quote Waahnsinn Quote  Post ReplyReply Direct Link To This Post Posted: 26-Apr-2011 at 9:42am
Hello!

I've attached a Sample (works with the NorthwindIB Database).

I want the combobox to display an error when there is no category selected in the ComboBox.


uploads/743/WpfApplicationComboBox.zip
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 26-Apr-2011 at 10:42am
Thanks for the upload, I'll take a look at your solution.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down