Click here to Skip to main content
15,503,369 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp31-May-13 8:22
rbsbscrp31-May-13 8:22 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 8:30
professionalEddy Vluggen31-May-13 8:30 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp31-May-13 8:39
rbsbscrp31-May-13 8:39 
GeneralRe: ListBox does not update when DataSource is changed Pin
Eddy Vluggen31-May-13 9:32
professionalEddy Vluggen31-May-13 9:32 
GeneralRe: ListBox does not update when DataSource is changed Pin
TnTinMn6-Jun-13 10:08
TnTinMn6-Jun-13 10:08 
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp6-Jun-13 13:38
rbsbscrp6-Jun-13 13:38 
GeneralRe: ListBox does not update when DataSource is changed Pin
TnTinMn6-Jun-13 14:26
TnTinMn6-Jun-13 14:26 
AnswerRe: ListBox does not update when DataSource is changed Pin
Chirag Baroliya R24-May-13 3:25
Chirag Baroliya R24-May-13 3:25 
Try This :

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
List<KeyValuePair<int, string>> data = new List<KeyValuePair<int, string>>();

KeyValuePair<int, string> item;

for (int i = 1; i < 10; i++)
{
item = new KeyValuePair<int, string>(i, "Item " + i.ToString());
data.Add(item);

}

listBox1.DataSource = data;
listBox1.DisplayMember = "Value";
listBox1.ValueMember = "Key";

}

private void button1_Click(object sender, EventArgs e)
{
KeyValuePair<int, string> item = new KeyValuePair<int,string>(11,"Item 11");

List<KeyValuePair<int, string>> data = (List<KeyValuePair<int, string>>)listBox1.DataSource;
data.Add(item);

listBox1.DataSource = null;
listBox1.DataSource = data;

}
}
GeneralRe: ListBox does not update when DataSource is changed Pin
rbsbscrp24-May-13 21:11
rbsbscrp24-May-13 21:11 
QuestionBinding a DataGridView column to a nullable property, using a ComboBox bound to a non-nullable property. Pin
Brady Kelly14-May-13 22:20
Brady Kelly14-May-13 22:20 
QuestionControl hide/show(should be post here, right?) Pin
kenmaMoon23-Apr-13 22:20
kenmaMoon23-Apr-13 22:20 
AnswerRe: Control hide/show(should be post here, right?) Pin
Richard MacCutchan23-Apr-13 22:57
mveRichard MacCutchan23-Apr-13 22:57 
GeneralRe: Control hide/show(should be post here, right?) Pin
kenmaMoon23-Apr-13 23:00
kenmaMoon23-Apr-13 23:00 
GeneralRe: Control hide/show(should be post here, right?) Pin
Richard MacCutchan23-Apr-13 23:42
mveRichard MacCutchan23-Apr-13 23:42 
AnswerRe: Control hide/show(should be post here, right?) Pin
Eddy Vluggen23-Apr-13 23:50
professionalEddy Vluggen23-Apr-13 23:50 
GeneralRe: Control hide/show(should be post here, right?) Pin
kenmaMoon23-Apr-13 23:55
kenmaMoon23-Apr-13 23:55 
AnswerRe: Control hide/show(should be post here, right?) Pin
Eddy Vluggen24-Apr-13 7:29
professionalEddy Vluggen24-Apr-13 7:29 
QuestionC# Winform controls not drawing Pin
Member 783446019-Apr-13 8:01
Member 783446019-Apr-13 8:01 
AnswerRe: C# Winform controls not drawing Pin
Eddy Vluggen22-Apr-13 9:52
professionalEddy Vluggen22-Apr-13 9:52 
QuestionChanging BackColor for tabControl Pin
_katon_11-Apr-13 3:54
_katon_11-Apr-13 3:54 
AnswerRe: Changing BackColor for tabControl Pin
Alan N11-Apr-13 4:48
Alan N11-Apr-13 4:48 
GeneralRe: Changing BackColor for tabControl Pin
_katon_11-Apr-13 5:29
_katon_11-Apr-13 5:29 
AnswerRe: Changing BackColor for tabControl Pin
Dave Kreskowiak11-Apr-13 6:02
mveDave Kreskowiak11-Apr-13 6:02 
QuestionHow to link drawings on on-line maps to the map Pin
Member 843537226-Mar-13 12:40
Member 843537226-Mar-13 12:40 
AnswerRe: How to link drawings on on-line maps to the map Pin
Bernhard Hiller26-Mar-13 23:47
Bernhard Hiller26-Mar-13 23:47 

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.