2009-07-02 18 views
0

HALLO,Syncfusion Gridlist Steuer

Verwendung Syncfusions Gridlist control:

Der Benutzer sollte in verschiedenen Reihen (1 oder mehrere) wählen können, dann muss ich einen Weg programmatisch zu bestimmen, welche Zeilen ausgewählt sind. Ich werde ein Kontextmenü im Raster verwenden, also muss ich herausfinden, welche an diesem Punkt ausgewählt sind.

Jede mögliche Hilfe bei der oben würde große

Antwort

0

prüfen für ein Gitter Ereignis, das ausgelöst wird, wenn Sie mit der rechten auf das Raster, und sehen, welche Argumente Sie gegeben (durch ‚e‘ verwendet wird).

1

Sie können die ausgewählten Elemente wie folgt zugreifen:

foreach (SelectedRecord selectedRecord in Grid.Table.SelectedRecords) 
       { 
        TypeBoundToDataGrid typeBound= selectedRecord.Record.GetData() as TypeBoundToDataGrid ; 

       } 

Bitte beachten Sie: Sie müssen auf den Auswahlmodus im Netz machen, indem dies zu tun:

Für Multiselection:

Grid.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended; 
     Grid.TableOptions.AllowSelection = GridSelectionFlags.None; 
     Grid.TableOptions.ListBoxSelectionColorOptions = GridListBoxSelectionColorOptions.ApplySelectionColor; 
     Grid.TableOptions.ListBoxSelectionCurrentCellOptions = 
      GridListBoxSelectionCurrentCellOptions.WhiteCurrentCell 
      | GridListBoxSelectionCurrentCellOptions.MoveCurrentCellWithMouse; 

Für SingleSelection

Grid.TableOptions.ListBoxSelectionMode = SelectionMode.One; 
     Grid.TableOptions.AllowSelection = GridSelectionFlags.None; 
     Grid.TableOptions.ListBoxSelectionColorOptions = GridListBoxSelectionColorOptions.ApplySelectionColor; 
     Grid.TableOptions.ListBoxSelectionCurrentCellOptions = 
      GridListBoxSelectionCurrentCellOptions.WhiteCurrentCell 
      | GridListBoxSelectionCurrentCellOptions.MoveCurrentCellWithMouse; 

Josh