3rd party list box?
-
Hey guys i need my listBox items to be editable in the listBox itself. For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list. It seems the normal
System.Windows.Forms.ListBox
cant do it like that... unless im missing something? are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome ThanksHarvey Saayman - South Africa Junior Developer .Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111 -
Hey guys i need my listBox items to be editable in the listBox itself. For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list. It seems the normal
System.Windows.Forms.ListBox
cant do it like that... unless im missing something? are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome ThanksHarvey Saayman - South Africa Junior Developer .Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111There's a few in articles[^] on here Harvey. I think the standard way of doing this it to get overlay a textbox on the field that needs editing and remove it on enter or lost focus (obviously saving the data first). It is possible to embed controls in the list view (again a few articles) but that can be pretty memory intensive in a large list.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Expect everything to be hard and then enjoy the things that come easy. (code-frog) -
There's a few in articles[^] on here Harvey. I think the standard way of doing this it to get overlay a textbox on the field that needs editing and remove it on enter or lost focus (obviously saving the data first). It is possible to embed controls in the list view (again a few articles) but that can be pretty memory intensive in a large list.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Expect everything to be hard and then enjoy the things that come easy. (code-frog)Thanks dave I'll have a look :)
Harvey Saayman - South Africa Junior Developer .Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111 -
Hey guys i need my listBox items to be editable in the listBox itself. For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list. It seems the normal
System.Windows.Forms.ListBox
cant do it like that... unless im missing something? are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome ThanksHarvey Saayman - South Africa Junior Developer .Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111Hi Have you tried listview. No databinding, but otherwise perfect Kjetil
-
Hi Have you tried listview. No databinding, but otherwise perfect Kjetil
Hey Kjetil i found this[^] and it seems like its going to do what i need it to Thanks for replying though
Harvey Saayman - South Africa Junior Developer .Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111 -
Hey guys i need my listBox items to be editable in the listBox itself. For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list. It seems the normal
System.Windows.Forms.ListBox
cant do it like that... unless im missing something? are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome ThanksHarvey Saayman - South Africa Junior Developer .Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111You can switch to ListView and set .View = View.List; Then use ListView's label editing feature.
private void button2_Click(object sender, EventArgs e)
{
var item = listView1.Items.Add("");
listView1.LabelEdit = true;
item.BeginEdit();
}
private void listView1_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
listView1.LabelEdit = false;
}Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.