Click here to Skip to main content
15,902,275 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to add the data from text box to already created list data item source Pin
Rocky2313-Apr-11 5:32
Rocky2313-Apr-11 5:32 
GeneralRe: How to add the data from text box to already created list data item source Pin
Pete O'Hanlon13-Apr-11 6:26
mvePete O'Hanlon13-Apr-11 6:26 
GeneralRe: How to add the data from text box to already created list data item source Pin
Rocky2313-Apr-11 19:12
Rocky2313-Apr-11 19:12 
GeneralRe: How to add the data from text box to already created list data item source Pin
Pete O'Hanlon13-Apr-11 21:57
mvePete O'Hanlon13-Apr-11 21:57 
GeneralRe: How to add the data from text box to already created list data item source Pin
Tarun.K.S13-Apr-11 7:46
Tarun.K.S13-Apr-11 7:46 
QuestionSorting a listbox when SortDescription won't cut it [modified] Pin
Jean-Louis Leroy12-Apr-11 23:29
Jean-Louis Leroy12-Apr-11 23:29 
AnswerRe: Sorting a listbox when SortDescription won't cut it Pin
SledgeHammer0113-Apr-11 13:34
SledgeHammer0113-Apr-11 13:34 
GeneralRe: Sorting a listbox when SortDescription won't cut it Pin
Jean-Louis Leroy13-Apr-11 21:06
Jean-Louis Leroy13-Apr-11 21:06 
Relevant lines from Window_Loaded:
dataset = new DNLMHDataSet(); // a designer-generated typed dataset
reportingUserAdapter = new ReportingUserTableAdapter();
reportingUserAdapter.Fill(dataset.ReportingUser);
listBoxSelectedReporting.DataContext = dataset;

I run my program and make it break. In the Immediate window:
?System.Windows.Data.CollectionViewSource.GetDefaultView(listBoxSelectedReporting.DataContext)
{System.Windows.Data.BindingListCollectionView}
    [System.Windows.Data.BindingListCollectionView]: {System.Windows.Data.BindingListCollectionView}
    CanFilter: false
    CanGroup: true
    CanSort: false
    Culture: null
    CurrentItem: {System.Data.DataViewManagerListItemTypeDescriptor}
    CurrentPosition: 0
    Filter: null
    GroupDescriptions: {System.Collections.ObjectModel.ObservableCollection<System.ComponentModel.GroupDescription>}
    Groups: null
    IsCurrentAfterLast: false
    IsCurrentBeforeFirst: false
    IsEmpty: false
    SortDescriptions: {System.ComponentModel.SortDescriptionCollection.EmptySortDescriptionCollection}
    SourceCollection: {System.Data.DataViewManager}

Let's try the cast:
?(ListCollectionView)System.Windows.Data.CollectionViewSource.GetDefaultView(listBoxSelectedReporting.DataContext)
Cannot cast 'System.Windows.Data.CollectionViewSource.GetDefaultView(listBoxSelectedReporting.DataContext)' (which has an actual type of 'System.Windows.Data.BindingListCollectionView') to 'System.Windows.Data.ListCollectionView'

When I look at the MS headers I see that both ListCollectionView and BindingListCollectionView derive from CollectionView. They're siblings, hence no cast...
GeneralRe: Sorting a listbox when SortDescription won't cut it Pin
SledgeHammer0114-Apr-11 5:13
SledgeHammer0114-Apr-11 5:13 
GeneralRe: Sorting a listbox when SortDescription won't cut it Pin
Jean-Louis Leroy15-Apr-11 1:11
Jean-Louis Leroy15-Apr-11 1:11 
GeneralRe: Sorting a listbox when SortDescription won't cut it Pin
SledgeHammer0115-Apr-11 4:45
SledgeHammer0115-Apr-11 4:45 
AnswerRe: Sorting a listbox when SortDescription won't cut it Pin
Jean-Louis Leroy13-Apr-11 22:09
Jean-Louis Leroy13-Apr-11 22:09 
QuestionWifi robot Pin
Solomon Emiru12-Apr-11 20:17
Solomon Emiru12-Apr-11 20:17 
AnswerRe: Wifi robot Pin
Pete O'Hanlon12-Apr-11 21:39
mvePete O'Hanlon12-Apr-11 21:39 
QuestionData Access for dummies... Pin
Johnny J.12-Apr-11 4:03
professionalJohnny J.12-Apr-11 4:03 
AnswerRe: Data Access for dummies... Pin
Ian Shlasko12-Apr-11 4:15
Ian Shlasko12-Apr-11 4:15 
GeneralRe: Data Access for dummies... Pin
Johnny J.12-Apr-11 4:20
professionalJohnny J.12-Apr-11 4:20 
GeneralRe: Data Access for dummies... Pin
Ian Shlasko12-Apr-11 4:34
Ian Shlasko12-Apr-11 4:34 
GeneralRe: Data Access for dummies... Pin
Johnny J.12-Apr-11 5:34
professionalJohnny J.12-Apr-11 5:34 
GeneralRe: Data Access for dummies... Pin
Ian Shlasko12-Apr-11 6:28
Ian Shlasko12-Apr-11 6:28 
AnswerRe: Data Access for dummies... Pin
Abhinav S12-Apr-11 4:35
Abhinav S12-Apr-11 4:35 
AnswerRe: Data Access for dummies... Pin
Vimalsoft(Pty) Ltd12-Apr-11 21:25
professionalVimalsoft(Pty) Ltd12-Apr-11 21:25 
GeneralRe: Data Access for dummies... Pin
Johnny J.12-Apr-11 21:51
professionalJohnny J.12-Apr-11 21:51 
GeneralRe: Data Access for dummies... Pin
Vimalsoft(Pty) Ltd12-Apr-11 22:01
professionalVimalsoft(Pty) Ltd12-Apr-11 22:01 
AnswerRe: Data Access for dummies... Pin
V.13-Apr-11 0:41
professionalV.13-Apr-11 0: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.