Click here to Skip to main content
14,845,580 members
Home / Discussions / C#
   

C#

 
GeneralRe: cancel button [X] Pin
Luc Pattyn9-Jul-08 15:21
sitebuilderLuc Pattyn9-Jul-08 15:21 
GeneralRe: cancel button [X] Pin
PIEBALDconsult10-Jul-08 4:19
professionalPIEBALDconsult10-Jul-08 4:19 
GeneralRe: cancel button [X] Pin
PIEBALDconsult10-Jul-08 12:40
professionalPIEBALDconsult10-Jul-08 12:40 
Questiontitle bar Pin
nelsonpaixao9-Jul-08 14:01
Membernelsonpaixao9-Jul-08 14:01 
AnswerRe: title bar Pin
Luc Pattyn9-Jul-08 15:23
sitebuilderLuc Pattyn9-Jul-08 15:23 
AnswerRe: title bar Pin
Christian Graus9-Jul-08 15:25
protectorChristian Graus9-Jul-08 15:25 
AnswerRe: title bar Pin
Thomas Stockwell10-Jul-08 5:03
professionalThomas Stockwell10-Jul-08 5:03 
QuestionControl doesn't get update Pin
verkniss9-Jul-08 9:45
Memberverkniss9-Jul-08 9:45 
Hey guys,

I been trying to update my Listbox Control from importerCollection with no luck(importerCollection -class derived from List<importer>) .
Everytime I update/add item to my list, the LoadImporters() Method runs.
The problem is that it doesn't update my Listbox Control,
I been trying to use the Listbox.Refresh Method which didn't really worked.
The Only thing which worked is creating a new instance of ImporterCollection and settings the
Listbox datasource to this new instance.
I don't see any reason creating a new instance of it everytime I want to update/add Item in my List, it suppose to get update automatically.

I also have another problem, I dont know how to set the Databindings to update automatically. I think this problem might be the solution for the first problem Smile | :)

I will glad to hear some solutions to my problems. Thank you very much!

ImporterCollection importerCollection = new ImporterCollection();

public FormManageImporters()
{
    InitializeComponent();
    LoadImporters();
    SetDataset();
    SetBindings();
}

private void LoadImporters()
{
    importerCollection.FillImporters();
}

private void SetDataset()
{
    listBoxImporters.DataSource = importerCollection;
    listBoxImporters.ValueMember = "ImporterID";
    listBoxImporters.DisplayMember = "ImporterName";
}

private void SetBindings()
{
    textBoxPhone.DataBindings.Add("Text", importerCollection, "Phone");
    textBoxAlternativePhone.DataBindings.Add("Text", importerCollection, "AlternativePhone");
    textBoxCellularPhone.DataBindings.Add("Text", importerCollection, "CellularPhone");
    textBoxFax.DataBindings.Add("Text", importerCollection, "Fax");
}

private void Importer_Changed(object sender, EventArgs e)
{
    LoadImporters();
}

private void buttonAdd_Click(object sender, EventArgs e)
{
    FormImporter formImporter = new FormImporter();
    formImporter.ImporterChanged += new FormImporter.ImporterChangedEventHandler(Importer_Changed);
    formImporter.Show();
}

AnswerRe: Control doesn't get update Pin
verkniss10-Jul-08 4:28
Memberverkniss10-Jul-08 4:28 
Questioncalculate totalprice base on checkbox Pin
benjamin yap9-Jul-08 9:00
Memberbenjamin yap9-Jul-08 9:00 
AnswerRe: calculate totalprice base on checkbox Pin
KaptinKrunch9-Jul-08 10:12
MemberKaptinKrunch9-Jul-08 10:12 
AnswerRe: calculate totalprice base on checkbox Pin
Wes Aday9-Jul-08 10:15
professionalWes Aday9-Jul-08 10:15 
AnswerRe: calculate totalprice base on checkbox Pin
Paul Conrad9-Jul-08 13:24
professionalPaul Conrad9-Jul-08 13:24 
QuestionHow do change the properties of tool in Form1 from other Form2? Pin
zeeShan anSari9-Jul-08 8:44
MemberzeeShan anSari9-Jul-08 8:44 
AnswerRe: How do change the properties of tool in Form1 from other Form2? Pin
Christian Graus9-Jul-08 8:49
protectorChristian Graus9-Jul-08 8:49 
AnswerRe: How do change the properties of tool in Form1 from other Form2? Pin
TheFM2349-Jul-08 10:37
MemberTheFM2349-Jul-08 10:37 
AnswerRe: How do change the properties of tool in Form1 from other Form2? Pin
nelsonpaixao9-Jul-08 15:32
Membernelsonpaixao9-Jul-08 15:32 
Questionhashtable Pin
benjamin yap9-Jul-08 8:40
Memberbenjamin yap9-Jul-08 8:40 
AnswerRe: hashtable Pin
Christian Graus9-Jul-08 8:43
protectorChristian Graus9-Jul-08 8:43 
AnswerRe: hashtable Pin
snorkie9-Jul-08 9:00
professionalsnorkie9-Jul-08 9:00 
QuestionSelect particular types tool and then change their properties at a time,How? Pin
zeeShan anSari9-Jul-08 8:34
MemberzeeShan anSari9-Jul-08 8:34 
AnswerRe: Select particular types tool and then change their properties at a time,How? Pin
Christian Graus9-Jul-08 8:39
protectorChristian Graus9-Jul-08 8:39 
QuestionRe: Select particular types tool and then change their properties at a time,How? Pin
zeeShan anSari9-Jul-08 8:56
MemberzeeShan anSari9-Jul-08 8:56 
AnswerRe: Select particular types tool and then change their properties at a time,How? Pin
hammerstein059-Jul-08 9:00
Memberhammerstein059-Jul-08 9:00 
QuestionRe: Select particular types tool and then change their properties at a time,How? Pin
zeeShan anSari9-Jul-08 9:08
MemberzeeShan anSari9-Jul-08 9:08 

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.