troubleshooting Question

Select a new row in a listview.

Avatar of Peter Kiers
Peter KiersFlag for Netherlands asked on
.NET ProgrammingC#
4 Comments1 Solution481 ViewsLast Modified:
Hi,

I have a listview with 1 button on my form, and the listview is connected to a database.
When I press on the button a childform appears with a textbox on it where the user
can enter text. After pressing the x-button of the childform the text of the textbox will be
written on the listview on the mainform, so a new row will be inserted into the listview.
But how can I automaticly select the new inserted row in the listview?


        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
          {
            if (frmNote.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
            {
               listView1.Items.Add(frmNote.textBox1.Text, 0);
               //SELECT THE NEW INSERTED ROW
            }
        }

Greetings, Peter Kiers
ASKER CERTIFIED SOLUTION
Minh Võ Công

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros