Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MmPicker ItemSelected Index Value
Message
De
14/03/2005 13:29:06
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
MmPicker ItemSelected Index Value
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00995605
Message ID:
00995605
Vues:
46
I need to navigate my Company Business Object DataSet to the position of the ItemSelected in an mmPicker.
Below is what I have done so far, but I need the ItemSelected's index after the Find has been successfully completed. This is needed because BindingContext.Postion is based on the index not the PK value.

1. How do I get the index of the PK value found using the Rows.Find() method of Me.oCompany.GetCurrentDataSet.Tables("Companies")?
2. Is there an eaisier way to get the form's binding context to navigate after selecting a value in an mmPicker (other than calling a GetById method of the BO - as I need all BO records)?
Private Sub CompanySelectionPicker_ItemSelected _
        (ByVal sender As Object, _
        ByVal e As OakLeaf.MM.Main.Windows.Forms.mmPickerItemSelectedEventArgs) _
        Handles CompanySelectionPicker.ItemSelected

        ' Find the position of the primary key selected in the Picker
        Dim companyIdSelected As Integer = _
            CInt(e.dsSelectedItems.Tables.Item(0).Rows(0).Item("CompanyId"))
        Try
            Me.oCompany.GetCurrentDataSet.Tables("Companies").Rows.Find(companyIdSelected)
            ' HOW DO I GET THE INDEX OF THIS PK VALUE FOUND IN THE DATASET?????

            ' Assign the index of the value found in the Current DataSet
            ' TODO Replace hardcoded companyIdSelectedIndex value with the index of the primary key value found previously
            Dim companyIdSelectedIndex As Integer = 2

            ' Use the form's BindingContext object to set the position
            Me.BindingContext _
                (CompanyDataset, CompanyDataset.Tables(0).TableName). _
                Position = companyIdSelectedIndex
        Catch ex As Exception

        End Try

    End Sub
THANKS
Joe Salvatore, Programmer/Analyst - The Stellar Group
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform