retrieving values of selected row

hello all on gdbg_DoubleClick event how do i capture the values of the selected row ? please send solution in vb.net Thanx

3 Replies

AD Administrator Syncfusion Team May 13, 2006 09:09 AM UTC

Hi Cheryl, To catch the double click event in a grid cell ,You need to handle the CurrentCellControlDoubleClick. Please try this code snippet for getting the data in a selected row. Here is a code snippt. Private Sub gridDataBoundGrid1_CurrentCellControlDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles gridDataBoundGrid1.CurrentCellControlDoubleClick Console.WriteLine("Selected Records") For Each info As GridRangeInfo In Me.gridDataBoundGrid1.Model.SelectedRanges If info.IsRows Then Dim i As Integer = 1 Do While i <= Me.gridDataBoundGrid1.Model.ColCount Console.Write("--" & Me.gridDataBoundGrid1.Model(info.Top, i).Text & "--") i += 1 Loop End If Console.WriteLine() Next info End Sub Here is a sample. http://www.syncfusion.com/Support/user/uploads/SelectDataVB_4d49c2a4.zip Please let me know if this helps. Best Regards, Haneef


CH cheryl May 15, 2006 09:06 AM UTC

hello haneef, This gets the values for each cell in the row . my requirement is , when i double click on a ceratin row the reocrd should be available to the next tab page....... i am not able to manage the same through currency manager..... and also on which EVENT would the code(in vb. net) be in ??? Thanx >Hi Cheryl, > >To catch the double click event in a grid cell ,You need to handle the CurrentCellControlDoubleClick. Please try this code snippet for getting the data in a selected row. Here is a code snippt. > >Private Sub gridDataBoundGrid1_CurrentCellControlDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles gridDataBoundGrid1.CurrentCellControlDoubleClick > Console.WriteLine("Selected Records") > For Each info As GridRangeInfo In Me.gridDataBoundGrid1.Model.SelectedRanges > If info.IsRows Then > Dim i As Integer = 1 > Do While i <= Me.gridDataBoundGrid1.Model.ColCount > Console.Write("--" & Me.gridDataBoundGrid1.Model(info.Top, i).Text & "--") > i += 1 > Loop > End If > Console.WriteLine() > Next info >End Sub > >Here is a sample. >http://www.syncfusion.com/Support/user/uploads/SelectDataVB_4d49c2a4.zip > >Please let me know if this helps. >Best Regards, >Haneef >


AD Administrator Syncfusion Team May 15, 2006 10:20 AM UTC

Hi Cheryl, Could you try this code to get the selected records in a grid.Here is a code snippet. Private Sub gridDataBoundGrid1_CurrentCellControlDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles gridDataBoundGrid1.CurrentCellControlDoubleClick Console.WriteLine("Selected Records") For Each info As GridRangeInfo In Me.gridDataBoundGrid1.Model.SelectedRanges Dim table As DataTable = Me.gridDataBoundGrid1.DataSource Dim drow As DataRow = table.Rows.Item(Me.gridDataBoundGrid1.Binder.RowIndexToListManagerPosition(info.Top)) For j As Integer = 0 To drow.ItemArray.Length - 1 Console.Write(drow.Item(j) & " ") Next j Console.WriteLine() Next info End Sub Let us know if you are trying something different. Thanks for your interest in Syncfusion products. Best Regards, Haneef

Loader.
Up arrow icon