Click here to Skip to main content
15,904,416 members
Home / Discussions / C#
   

C#

 
GeneralRe: Not enough memory to run Microsoft Excel. Please close other applications and try again Pin
mav.northwind17-Dec-07 19:26
mav.northwind17-Dec-07 19:26 
GeneralRe: Not enough memory to run Microsoft Excel. Please close other applications and try again Pin
gauthee17-Dec-07 20:01
gauthee17-Dec-07 20:01 
QuestionImage and Viewport - Drag Move, Pixel Positons etc Pin
Shailesh Appukuttan17-Dec-07 17:45
Shailesh Appukuttan17-Dec-07 17:45 
GeneralRe: Image and Viewport - Drag Move, Pixel Positons etc Pin
Christian Graus17-Dec-07 18:18
protectorChristian Graus17-Dec-07 18:18 
GeneralRe: Image and Viewport - Drag Move, Pixel Positons etc Pin
Shailesh Appukuttan17-Dec-07 21:31
Shailesh Appukuttan17-Dec-07 21:31 
Generalmember function or not C# Pin
tasumisra17-Dec-07 17:08
tasumisra17-Dec-07 17:08 
GeneralRe: member function or not C# Pin
CKnig17-Dec-07 18:31
CKnig17-Dec-07 18:31 
QuestionVS 2008 Walkthroughs on WPF? Pin
David Veeneman17-Dec-07 17:02
David Veeneman17-Dec-07 17:02 
GeneralRe: VS 2008 Walkthroughs on WPF? Pin
CKnig17-Dec-07 18:37
CKnig17-Dec-07 18:37 
GeneralRe: VS 2008 Walkthroughs on WPF? Pin
David Veeneman18-Dec-07 2:25
David Veeneman18-Dec-07 2:25 
GeneralRe: VS 2008 Walkthroughs on WPF? Pin
CKnig18-Dec-07 3:21
CKnig18-Dec-07 3:21 
GeneralRe: VS 2008 Walkthroughs on WPF? Pin
David Veeneman18-Dec-07 3:41
David Veeneman18-Dec-07 3:41 
GeneralRe: VS 2008 Walkthroughs on WPF? Pin
Paul Conrad24-Dec-07 19:57
professionalPaul Conrad24-Dec-07 19:57 
QuestionAny mapping tool for NHibernate ? Pin
imagic17-Dec-07 15:29
imagic17-Dec-07 15:29 
AnswerRe: Any mapping tool for NHibernate ? Pin
ekynox17-Dec-07 16:15
ekynox17-Dec-07 16:15 
AnswerRe: Any mapping tool for NHibernate ? Pin
Mark Churchill17-Dec-07 20:57
Mark Churchill17-Dec-07 20:57 
QuestionEnhanced Listbox Pin
tcsoccerman17-Dec-07 15:08
tcsoccerman17-Dec-07 15:08 
GeneralRe: Enhanced Listbox Pin
Anthony Mushrow17-Dec-07 15:35
professionalAnthony Mushrow17-Dec-07 15:35 
GeneralRe: Enhanced Listbox Pin
Luc Pattyn17-Dec-07 15:38
sitebuilderLuc Pattyn17-Dec-07 15:38 
GeneralRe: Enhanced Listbox Pin
tcsoccerman18-Dec-07 15:18
tcsoccerman18-Dec-07 15:18 
GeneralRecursively calling a generic method with runtime parameters Pin
Skippums17-Dec-07 12:38
Skippums17-Dec-07 12:38 
GeneralRe: Recursively calling a generic method with runtime parameters Pin
PIEBALDconsult17-Dec-07 16:14
mvePIEBALDconsult17-Dec-07 16:14 
QuestionHow to enter foreign key values to combobox Pin
AndrusM17-Dec-07 10:30
AndrusM17-Dec-07 10:30 
I found that ComboBox does not allow to enter data using foreign keys.

To reproduce:

1. Run code
2. Enter Walter from keyboard
3. Click button.

Observed:

J

Expected:

W


How to fix ?

using System.Windows.Forms;<br />
using System.Collections.Generic;<br />
<br />
class testForm : Form {<br />
<br />
  Storage s = new Storage();<br />
<br />
  testForm() {<br />
    Customer c = new Customer();<br />
    c.Id = "J";<br />
    c.Name = "John";<br />
<br />
    List<Customer> l = new List<Customer>();<br />
    l.Add(c);<br />
    c = new Customer();<br />
    c.Id = "W";<br />
    c.Name = "Walter";<br />
    l.Add(c);<br />
<br />
    ComboBox cm = new ComboBox();<br />
    cm.DisplayMember = "Name";<br />
    cm.ValueMember = "Id";<br />
    cm.DataSource = l;<br />
<br />
    s.CustId = "W";<br />
<br />
    cm.DataBindings.Add("SelectedValue", s, "CustId");<br />
<br />
    Controls.Add(cm);<br />
    Button b = new Button();<br />
    b.Top = 80;<br />
    b.Click += new System.EventHandler(b_Click);<br />
    Controls.Add(b);<br />
<br />
  }<br />
<br />
  void b_Click(object sender, System.EventArgs e) {<br />
    if (s.CustId == null)<br />
      MessageBox.Show("Empty combobox must store null value");<br />
    else<br />
      MessageBox.Show(s.CustId.ToString());<br />
<br />
  }<br />
<br />
  class Customer {<br />
    public string Id { get; set; }<br />
    public string Name { get; set; }<br />
<br />
  }<br />
<br />
  class Storage {<br />
    public string CustId { get; set; }<br />
  }<br />
<br />
  static void Main() {<br />
    Application.Run(new testForm());<br />
  }<br />
}

Andrus

AnswerRe: How to enter foreign key values to combobox Pin
darkelv17-Dec-07 16:04
darkelv17-Dec-07 16:04 
GeneralReflection with Generic Lists [modified] Pin
DaveyM6917-Dec-07 9:23
professionalDaveyM6917-Dec-07 9:23 

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.