i have a listview in my windows application,i am able to edit particular column in listview and place textbox in that position, now i want to add the textbox text into the listview edited column, No databinding involved in this application.and my code is below..
void ListView1MouseDoubleClick(object sender, MouseEventArgs e)
{
ListViewHitTestInfo hit=listView1.HitTest(e.X,e.Y);
foreach(ListViewItem mitem in listView1.Items)
{
if (mitem.Selected==true)
{
textBox1.Left = listView1.Left + hit.SubItem.Bounds.Left + 3;
textBox1.Top = listView1.Top + hit.SubItem.Bounds.Top;
textBox1.Width = hit.SubItem.Bounds.Width;
textBox1.Text = hit.SubItem.Text;
textBox1.Visible = true;
textBox1.Focus();
textBox1.SelectAll();
}
}
}
void textBox1LostFocus(object sender, EventArgs e)
{
try
{
//here i want the code for the text to be placed in the listview selected column.
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}