Click here to Skip to main content
15,890,282 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Binding a DataSet to a ListBox in a WPF XBAP application Pin
Neeraj Kr14-Mar-09 2:25
Neeraj Kr14-Mar-09 2:25 
GeneralRe: Binding a DataSet to a ListBox in a WPF XBAP application Pin
ABitSmart14-Mar-09 3:15
ABitSmart14-Mar-09 3:15 
GeneralRe: Binding a DataSet to a ListBox in a WPF XBAP application Pin
Dharmesh4U16-Mar-09 4:12
Dharmesh4U16-Mar-09 4:12 
AnswerRe: Binding a DataSet to a ListBox in a WPF XBAP application Pin
RugbyLeague16-Mar-09 4:41
RugbyLeague16-Mar-09 4:41 
QuestionAny body helpme Pin
anishkannan13-Mar-09 19:49
anishkannan13-Mar-09 19:49 
AnswerRe: Any body helpme Pin
ABitSmart13-Mar-09 23:59
ABitSmart13-Mar-09 23:59 
AnswerRe: Any body helpme Pin
Mark Salsbery14-Mar-09 7:05
Mark Salsbery14-Mar-09 7:05 
QuestionWPF Custom Control with a Combo Box Pin
scarfinv13-Mar-09 18:05
scarfinv13-Mar-09 18:05 
I'm very new to WPF so please forgive me if I've missed something obvious.

I've built a "lookless" control that inherits ComboBox. It has three dependancy properties (CountryCode, Label, and ListByName), and a ReadOnly property of DistrictList.
Whenever CountryCode changes, the Label is changed, and the DistrictList is rebuilt. (eg. Country changes from CAN to USA, Label will change from Province to State, and the list contents will change from provinces to states). When the ListByName property changes, the items in the list will flip from names, to two character codes, or back again (eg. Ontario to ON, or ON to Ontario).

In my Generic.xaml file, the ControlTemplate uses a dockpanel that contains a label and a combobox. I've bound the label Content property to the control Label property, and I've bound the combobox ItemSource to the control DistrictList property.

So far so good... I can flip between CAN and USA, and the control flips between provinces and states.

However, I also want to support a country of "Other", and when that country is chosen, the DistrictList that gets built is empty. So after building the list, I check its Count property. If it is 0, I set IsEditable to True, else I set it to False. That way, when there are no items in the list, the user can type something in, but when there are items in the list, the user can't type something in and must select something.

Changing the ComboBox's editable state is the part I can't seem to get working.

I have subs that fire when the CountryCode and ListByName depedancy properties change. Inside those subs they call a private method called LoadDistrictList. That is the method that fills the private member variable for the DistrictList property, and that sets IsEditable to true or false.

I've obviously missed something, but I'm at a loss as to what it is I've done wrong.
AnswerRe: WPF Custom Control with a Combo Box Pin
ABitSmart14-Mar-09 1:41
ABitSmart14-Mar-09 1:41 
GeneralRe: WPF Custom Control with a Combo Box Pin
scarfinv14-Mar-09 5:03
scarfinv14-Mar-09 5:03 
GeneralRe: WPF Custom Control with a Combo Box Pin
scarfinv16-Mar-09 7:43
scarfinv16-Mar-09 7:43 
QuestionConnecting to SQL Server database in XBAP application [modified] Pin
Neeraj Kr13-Mar-09 5:10
Neeraj Kr13-Mar-09 5:10 
AnswerRe: Connecting to SQL Server database in XBAP application Pin
ABitSmart13-Mar-09 6:12
ABitSmart13-Mar-09 6:12 
GeneralRe: Connecting to SQL Server database in XBAP application Pin
Neeraj Kr13-Mar-09 7:14
Neeraj Kr13-Mar-09 7:14 
GeneralRe: Connecting to SQL Server database in XBAP application Pin
ABitSmart13-Mar-09 7:17
ABitSmart13-Mar-09 7:17 
GeneralRe: Connecting to SQL Server database in XBAP application Pin
Neeraj Kr13-Mar-09 7:34
Neeraj Kr13-Mar-09 7:34 
AnswerRe: Connecting to SQL Server database in XBAP application Pin
Eslam Afifi13-Mar-09 6:17
Eslam Afifi13-Mar-09 6:17 
GeneralRe: Connecting to SQL Server database in XBAP application Pin
Neeraj Kr13-Mar-09 7:12
Neeraj Kr13-Mar-09 7:12 
QuestionRe: Connecting to SQL Server database in XBAP application Pin
Eslam Afifi13-Mar-09 8:40
Eslam Afifi13-Mar-09 8:40 
AnswerRe: Connecting to SQL Server database in XBAP application Pin
Neeraj Kr13-Mar-09 8:44
Neeraj Kr13-Mar-09 8:44 
QuestionRe: Connecting to SQL Server database in XBAP application Pin
Eslam Afifi13-Mar-09 8:48
Eslam Afifi13-Mar-09 8:48 
QuestionDouble Animation Hell Pin
emptythetill13-Mar-09 2:55
emptythetill13-Mar-09 2:55 
AnswerRe: Double Animation Hell Pin
Insincere Dave13-Mar-09 8:06
Insincere Dave13-Mar-09 8:06 
GeneralRe: Double Animation Hell Pin
emptythetill14-Mar-09 5:21
emptythetill14-Mar-09 5:21 
QuestionHow to load only needed images? Pin
S.a.n.4.e.s12-Mar-09 7:35
S.a.n.4.e.s12-Mar-09 7:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.