Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Get index of selected item in lookuplist column ?

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Get index of selected item in lookuplist column ?
Link Posted: 05-Mar-2006 22:30
In the 'How to bind to LookupListColumn and use this column with FlyGrid.Net' sample, please add the following code:


  
Private Sub FlyGrid1_NodeCellChange(ByVal sender As Object, ByVal node As NineRays.Windows.Forms.Data.NodeBase, ByVal index As Integer, ByVal value As Object) Handles FlyGrid1.NodeCellChange
        Dim idx As Integer

        'cast FlyGrid as IServiceProvider
        Dim sp As IServiceProvider = CType(FlyGrid1, IServiceProvider)
        ' get a IDropDownListService instance
        Me.FlyGrid1.GetType().Assembly.GetType("NineRays.Windows.Forms.Grids.IDropDownListService")

        'use node.GetType instead of grid.GetType as our flygrid is inherited from myFlyGrid in DataRiseControls
        'it wouldn't work otherwise.
        Dim idls As NineRays.Windows.Forms.Grids.IDropDownListService = CType(sp.GetService(node.GetType().Assembly.GetType("NineRays.Windows.Forms.Grids.IDropDownListService")), IDropDownListService)
        If (Not idls Is Nothing) Then 'get selected index
            idx = idls.SelectedIndex
        End If

    End Sub


Then double click on the new row and you will see that idx is -1, although there isn't twice the same value in this sample.
Please can you fix this bug
Link Posted: 07-Mar-2006 16:05
This problem is solved and you no not need to use this code(published in your previous topic), value will correctly increment/decrement ono double click in the LookupListcolumn's cell.
Link Posted: 07-Mar-2006 22:24
[quote="NineRays"]This problem is solved and you no not need to use this code(published in your previous topic), value will correctly increment/decrement ono double click in the LookupListcolumn's cell.

solved in which version? I've got latest (01/03/06).
If I don't need to use the code above, could show me quickly how to do?
Link Posted: 09-Mar-2006 19:57
solved in which version? I've got latest (01/03/06).

In the v1.3.5.
If I don't need to use the code above, could show me quickly how to do?

Try to double click on the problem cell to see that the problem is solved. But to determine index of selected value in dropdown you should use IDropdownListService.