hi,
iam working in windows application in C#,so i have a list view.how to retrive the data when double click event. and how to add the column in listview and its also add in to datatable.plz help me
thanks in advance
roy
How to retrive data and adding the column in list view+ datatable ?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

jingeRank #2,527 · 554 reputationPosted Sep 27, 2009, 7:57 PM EDT
public partial class Form1 : Form { public Form1() { InitializeComponent(); this.listView1.Columns.Add("AA"); this.listView1.Columns.Add("BB"); this.listView1.Items.Add(new ListViewItem(new string[] { "32", "55" })); this.listView1.Items.Add(new ListViewItem(new string[] { "3d2", "5a5" })); this.listView1.MouseDown += new MouseEventHandler(listView1_MouseDown); } void listView1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { ListViewHitTestInfo hti = this.listView1.HitTest(e.X, e.Y); if (hti.Item != null) { this.contextMenuStrip2.Show(this.listView1, e.X, e.Y); } else { Point p = new Point(e.X,e.Y); this.listView1.Focus(); this.BeginInvoke(new ShowContextDelegate(ShowContext), p); } } } public delegate void ShowContextDelegate(Point o); public void ShowContext(Point p) { this.contextMenuStrip1.Show(this.listView1, p); } }