ListView that allows the user to edit it contents???

  • Thread starter Thread starter Bob Rock
  • Start date Start date
B

Bob Rock

Hello,

how can I create a ListView that allows to user to edit its columns contents?
Thx.


Bob Rock
 
Hi Bob,
Listview has a LabelEdit property; when you set it "true", then in an event handler you can call Listview.Items[x].BeginEdit(), and edit an item. As an example, you can handle ListView.DoubleClick event and call BeginEdit right there:

private void Form1_Load(object sender, System.EventArgs e)
{
listView1.LabelEdit = true;
}

private void listView1_DoubleClick(object sender, System.EventArgs e)
{
if(this.listView1.SelectedItems.Count==1)
{
this.listView1.SelectedItems[0].BeginEdit();
}
}

I hope this will help you,
Good Luck
 
you could try this:
http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp


Dincer Ozturan said:
Hi Bob,
Listview has a LabelEdit property; when you set it "true", then in an event handler you can call Listview.Items[x].BeginEdit(), and edit an item. As an example, you can handle ListView.DoubleClick event and call BeginEdit right there:

private void Form1_Load(object sender, System.EventArgs e)
{
listView1.LabelEdit = true;
}

private void listView1_DoubleClick(object sender, System.EventArgs e)
{
if(this.listView1.SelectedItems.Count==1)
{
this.listView1.SelectedItems[0].BeginEdit();
}
}

I hope this will help you,
Good Luck
-------------
Dincer Ozturan


Bob Rock said:
Hello,

how can I create a ListView that allows to user to edit its columns contents?
Thx.


Bob Rock
 
Back
Top