i still can't get this to work.
i expanded the auto-coded portion as u said, and placed the datasource at the end, but still get System.Data.DataRowView.
wat im doin is using an OwnerDrawFixed draw mode. my data source is a dataset. the reason don't need the currently selected item, but rather the item that the listbox is trying to draw.
for the life of me, i can't figure out how to simply get the text for the listbox item it wants to draw.
my component initialization looks like this (with your suggested change *if i did it rite*) :
this.listBox1.DisplayMember = "firstname";
this.listBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.listBox1.Location = new System.Drawing.Point(16, 16);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(160, 238);
this.listBox1.TabIndex = 4;
this.listBox1.Tag = "";
this.listBox1.ValueMember = "mateid";
this.listBox1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.listBox1_DrawItem);
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged_1);
this.listBox1.DataSource = this.buddiesData11.mates;
-------------
and my Draw function (with the drawing removed while i debug) looks like this....
private void listBox1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
Font myFont;
myFont = new System.Drawing.Font("Comic Sans", 11);
int itemIndex = e.Index;
//debug purposes
String WHY = this.listBox1.Items[itemIndex].ToString();
String ME = this.listBox1.Items[itemIndex].ToString();
}
}
hopefully thats not too mangled... but both "WHY" and "ME" are System.Data.DataRowView
help?