Click here to Skip to main content
15,886,873 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
Mark Salsbery21-May-09 8:21
Mark Salsbery21-May-09 8:21 
AnswerRe: Remove Selection of Listbox Inside of a Template Pin
Niladri_Biswas13-Jun-09 3:27
Niladri_Biswas13-Jun-09 3:27 
GeneralIntegration problem of Sub-reports using Bar-Charts with Main Report in a WPF application Pin
JiteshK20-May-09 2:59
JiteshK20-May-09 2:59 
QuestionBinding images to datagrid from database using silverlight Pin
pavanip20-May-09 2:16
pavanip20-May-09 2:16 
AnswerRe: Binding images to datagrid from database using silverlight Pin
Mark Salsbery20-May-09 4:54
Mark Salsbery20-May-09 4:54 
GeneralRe: Binding images to datagrid from database using silverlight Pin
pavanip20-May-09 18:02
pavanip20-May-09 18:02 
GeneralRe: Binding images to datagrid from database using silverlight Pin
Mark Salsbery21-May-09 7:12
Mark Salsbery21-May-09 7:12 
QuestionWPF Issue Concerning Binding [modified] Pin
Tee12319-May-09 17:02
Tee12319-May-09 17:02 
I have a project that I'm working on. Currently, I'm using 3 Expanders in my xaml file and I've got a listbox in within each expander. I load each listbox by binding the name member of the Person object to the DisplayMemberPath. I load 3 different collections with a Person objects representing a list of males, females, and juveniles. Once the objects are loaded I assign them each to the item source of their respected Listbox:

Collection<person> male = sql.getinfo('M'); //returns a collection of male names and info.
Collection<person> females = sql.getinfo('F');
maleListBox.ItemSource = male; //malelist represents listbox
FemaleListBox.ItemSouce = females;

When I click on the name of the male in the ListBox I cast the object so that I can disapply it in serveral labels. The casting is occurring in a method called generic_ListBox:

private void genericListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
lblName.Content = ((personData.person)((ListBox)sender).SelectedItem).personName;
...
}
I'm doing this so that I can get the information from each additional ListBox which is in it's own seperate expander.When I scroll through the list all is fine. The name shows the current person's name with the respected data; however if I toggle between the male list and female list for example the data is not updating. For example: I click on Todd Smith (it shows), I then click Cindy Jackson it shows, if I click back on Todd Smith Cindy Jackson's info still shows.

It seems that the selectedChanged event is not being fired because in the male list Todd Smith is still selected but has lost focus. I've tried changing focus but it gives me a null error. The closes that I have come was by calling a UnSelectAll() method and checking for a null value; I not a fan of this because it doesn't tell me which name is selected in the list. Can someone help? Any ideas as to how to get the item to show up when I click on a item that regains focus and is already selected?

Terrance C.

modified on Wednesday, May 20, 2009 8:45 PM

QuestionRe: WPF Issue Concerning Binding Pin
Mark Salsbery20-May-09 10:52
Mark Salsbery20-May-09 10:52 
AnswerRe: WPF Issue Concerning Binding Pin
Tee12320-May-09 14:44
Tee12320-May-09 14:44 
GeneralRe: WPF Issue Concerning Binding Pin
Mark Salsbery20-May-09 14:58
Mark Salsbery20-May-09 14:58 
GeneralRe: WPF Issue Concerning Binding Pin
Tee12321-May-09 2:32
Tee12321-May-09 2:32 
GeneralRe: WPF Issue Concerning Binding Pin
Mark Salsbery21-May-09 6:21
Mark Salsbery21-May-09 6:21 
QuestionCustom window template and events Pin
armax7519-May-09 10:39
professionalarmax7519-May-09 10:39 
AnswerRe: Custom window template and events Pin
Niladri_Biswas13-Jun-09 3:29
Niladri_Biswas13-Jun-09 3:29 
QuestionCan I put Polygon inside Button Template Dynamically? Pin
salon18-May-09 23:51
salon18-May-09 23:51 
AnswerRe: Can I put Polygon inside Button Template Dynamically? Pin
Abhinav S19-May-09 3:56
Abhinav S19-May-09 3:56 
GeneralRe: Can I put Polygon inside Button Template Dynamically? Pin
salon19-May-09 23:35
salon19-May-09 23:35 
GeneralRe: Can I put Polygon inside Button Template Dynamically? Pin
Abhinav S20-May-09 4:55
Abhinav S20-May-09 4:55 
QuestionRegarding treeview using MVVM pattern Pin
Ravi Mori18-May-09 21:42
Ravi Mori18-May-09 21:42 
AnswerRe: Regarding treeview using MVVM pattern Pin
Pete O'Hanlon19-May-09 0:15
mvePete O'Hanlon19-May-09 0:15 
AnswerRe: Regarding treeview using MVVM pattern Pin
Mike Fuchs8-Jul-10 22:38
Mike Fuchs8-Jul-10 22:38 
GeneralRe: Regarding treeview using MVVM pattern Pin
Robert Graves6-Sep-11 9:02
Robert Graves6-Sep-11 9:02 
QuestionUserControl does not assume height of parent container Pin
ausadmin18-May-09 19:47
ausadmin18-May-09 19:47 
AnswerRe: UserControl does not assume height of parent container [modified] Pin
Mark Salsbery19-May-09 6:41
Mark Salsbery19-May-09 6:41 

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.