Click here to Skip to main content
15,920,633 members
Home / Discussions / C#
   

C#

 
AnswerRe: Two way data binding (DataGridView to SortedList) Pin
Eddy Vluggen10-Feb-11 4:16
professionalEddy Vluggen10-Feb-11 4:16 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan10-Feb-11 4:27
mveRichard MacCutchan10-Feb-11 4:27 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Eddy Vluggen10-Feb-11 4:52
professionalEddy Vluggen10-Feb-11 4:52 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan10-Feb-11 5:09
mveRichard MacCutchan10-Feb-11 5:09 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Eddy Vluggen10-Feb-11 7:16
professionalEddy Vluggen10-Feb-11 7:16 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan10-Feb-11 10:23
mveRichard MacCutchan10-Feb-11 10:23 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Henry Minute10-Feb-11 13:06
Henry Minute10-Feb-11 13:06 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan11-Feb-11 4:08
mveRichard MacCutchan11-Feb-11 4:08 
Henry, the following is the method that sets up the DGV.
private void ShowVolunteers(SortedList<string, Volunteer> vols)
{
	volList = vols.Values.ToList();
	// use the list as the binding source
	bindingSource.DataSource = volList;

	// use the bindingsource as the data source of the view
	volunteerGrid.DataSource = bindingSource;
	volunteerGrid.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
	// auto fill the view
	volunteerGrid.AutoGenerateColumns = true; // create columns automatically
	volunteerGrid.Focus();
}

The Volunteer class contains three string values which show up fine in the DGV. I tried adding the INotifyPropertyChanged interface to my Volunteer class (as suggested by Eddy) but it never gets called, since the actual objects do not get changed. The only 'changes' I want to allow is for the user to delete some rows from the DGV, and the data source to be updated automatically.

To be honest, I would not spend too much time on this as I have a work around, which is to use the DGV rows that remain to get the final results I need. However, if you can spot an obvious fix I would certainly be interested in knowing about it.
I must get a clever new signature for 2011.

GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Henry Minute11-Feb-11 8:28
Henry Minute11-Feb-11 8:28 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan12-Feb-11 3:09
mveRichard MacCutchan12-Feb-11 3:09 
GeneralRe: Two way data binding (DataGridView to SortedList) Pin
Richard MacCutchan13-Feb-11 1:40
mveRichard MacCutchan13-Feb-11 1:40 
QuestionHow to localize BackgroundWorker thread? Pin
Chesnokov Yuriy10-Feb-11 1:54
professionalChesnokov Yuriy10-Feb-11 1:54 
AnswerRe: How to localize BackgroundWorker thread? Pin
Pete O'Hanlon10-Feb-11 2:05
mvePete O'Hanlon10-Feb-11 2:05 
AnswerRe: How to localize BackgroundWorker thread? Pin
Chesnokov Yuriy10-Feb-11 2:29
professionalChesnokov Yuriy10-Feb-11 2:29 
AnswerRe: How to localize BackgroundWorker thread? Pin
Bernhard Hiller10-Feb-11 5:04
Bernhard Hiller10-Feb-11 5:04 
QuestionRe: How to localize BackgroundWorker thread? Pin
Chesnokov Yuriy10-Feb-11 6:27
professionalChesnokov Yuriy10-Feb-11 6:27 
QuestionRun Application With Non Administrator Mode Pin
Anubhava Dimri9-Feb-11 18:54
Anubhava Dimri9-Feb-11 18:54 
AnswerRe: Run Application With Non Administrator Mode Pin
Eddy Vluggen10-Feb-11 7:19
professionalEddy Vluggen10-Feb-11 7:19 
QuestionValidation techneques? Pin
venomation9-Feb-11 16:19
venomation9-Feb-11 16:19 
AnswerRe: Validation techneques? Pin
Keith Barrow9-Feb-11 22:51
professionalKeith Barrow9-Feb-11 22:51 
AnswerRe: Validation techneques? Pin
Dalek Dave9-Feb-11 23:02
professionalDalek Dave9-Feb-11 23:02 
AnswerRe: Validation techneques? Pin
Bernhard Hiller10-Feb-11 5:13
Bernhard Hiller10-Feb-11 5:13 
GeneralRe: Validation techneques? Pin
venomation10-Feb-11 7:43
venomation10-Feb-11 7:43 
AnswerRe: Validation techneques? Pin
Matty2210-Feb-11 16:07
Matty2210-Feb-11 16:07 
QuestionHelp with excel and hyperlinks Pin
turbosupramk39-Feb-11 10:11
turbosupramk39-Feb-11 10:11 

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.