StrataFrame Forum

What is the best approche to emulate the (auto navigate) available in the standard listview

http://forum.strataframe.net/Topic27081.aspx

By Jocelyn Dagrain - 5/4/2010

Bonjour

Using the strataListview

What is the best approche to emulate the (auto navigate) available in the standard listview

Thank you

By Edhy Rijo - 5/4/2010

Hi Jocelyn,



Look in the OnSelectedIndexChanged method in the ListView.vb of the source code project MicroFour.StrataFrame.UI\WinForms Controls



There you will find the code that is currently use in the SF ListView and can implement it in your own class until the new listview is released with these features.
By Jocelyn Dagrain - 5/6/2010

Thank you

I was able to do it using (SeekToPrimaryKey) in the SelectedItemChanged event

private void strataListViewNotes_SelectedItemChanged(object sender, EventArgs e)
        {
            if (strataListViewNotes.SelectedItems.GetLength(0) > 0)
            {
                this.toolStripButtonEdit.Enabled = true;
                this.toolStripButtonDelete.Enabled = true;

                this.notesBO1.SeekToPrimaryKey((Int32)strataListViewNotes.SelectedItems[0].CustomData["PrimaryKey"]);
                txtNote.Text = this.notesBO1.Tbl_Notes;
            }
            else
            {
                this.toolStripButtonEdit.Enabled = false;
                this.toolStripButtonDelete.Enabled = false;
               
            }
        }

By Edhy Rijo - 5/7/2010

Hi Jocelyn,



I am glad it worked for you and thanks for sharing the code.



One observation, I believe the SeekToPrimaryKey() method will return True/False, so if that is the case you may want to test that before updating txtNote.Text = this.notesBO1.Tbl_Notes;
By Jocelyn Dagrain - 5/11/2010

thank you for the observation I made de change Smile