Click here to Skip to main content
15,905,782 members
Home / Discussions / C#
   

C#

 
GeneralRe: Forgot the name of this add-in! Pin
Mohamad Al Husseiny11-Aug-05 4:44
Mohamad Al Husseiny11-Aug-05 4:44 
GeneralObtaining UITypeEditor of an object Pin
Shane Stevens11-Aug-05 3:49
Shane Stevens11-Aug-05 3:49 
GeneralRe: Obtaining UITypeEditor of an object Pin
rudy.net11-Aug-05 17:56
rudy.net11-Aug-05 17:56 
GeneralRe: Obtaining UITypeEditor of an object Pin
Shane Stevens11-Aug-05 17:59
Shane Stevens11-Aug-05 17:59 
GeneralFinding out which row (in the DataTable) has been clicked by the user... Pin
signbit11-Aug-05 3:31
signbit11-Aug-05 3:31 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
Mohamad Al Husseiny11-Aug-05 3:58
Mohamad Al Husseiny11-Aug-05 3:58 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
signbit11-Aug-05 4:12
signbit11-Aug-05 4:12 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
robrich11-Aug-05 4:10
robrich11-Aug-05 4:10 
Found this on Windows Forms FAQ (quoting verbatim without permission):

http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q934q

... but if the grid has been sorted, you can no longer get at the current row in the table through the grid's CurrentRowIndex. But for both unsorted and sorted grids, you can get at the current row through the BindingContext and the Current property of the BindingManagerBase.
[C#]
BindingManagerBase bm = this.dataGrid1.BindingContextr[this.dataGrid1.DataSource, this.dataGrid1.DataMember];
DataRow dr = ((DataRowView)bm.Current).Row;
[VB.NET]
Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember)
Dim dr As DataRow = CType(bm.Current, DataRowView).Row


Me again. I've noticed that if my BindingManager is disconnected (e.g. bm.SuspendBinding() ) that this throws a wonderful exception. I wrap this in a try/catch block or check that bm.Current > -1.

robrich
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
Alomgir Miah11-Aug-05 4:24
Alomgir Miah11-Aug-05 4:24 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
signbit11-Aug-05 4:36
signbit11-Aug-05 4:36 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
signbit11-Aug-05 4:50
signbit11-Aug-05 4:50 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
Alomgir Miah11-Aug-05 5:13
Alomgir Miah11-Aug-05 5:13 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
rudy.net11-Aug-05 18:21
rudy.net11-Aug-05 18:21 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
signbit12-Aug-05 0:32
signbit12-Aug-05 0:32 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
rudy.net12-Aug-05 3:48
rudy.net12-Aug-05 3:48 
GeneralRe: Finding out which row (in the DataTable) has been clicked by the user... Pin
signbit16-Aug-05 6:44
signbit16-Aug-05 6:44 
GeneralWindows Service Pin
horacyjr11-Aug-05 2:35
horacyjr11-Aug-05 2:35 
GeneralRe: Windows Service Pin
Alomgir Miah11-Aug-05 5:47
Alomgir Miah11-Aug-05 5:47 
GeneralTAB Key problem in COM Client Vs C# Component Pin
Sivakumar R11-Aug-05 2:18
Sivakumar R11-Aug-05 2:18 
GeneralRe: TAB Key problem in COM Client Vs C# Component Pin
rudy.net11-Aug-05 18:31
rudy.net11-Aug-05 18:31 
GeneralRe: TAB Key problem in COM Client Vs C# Component Pin
Sivakumar R11-Aug-05 22:15
Sivakumar R11-Aug-05 22:15 
GeneralRe: TAB Key problem in COM Client Vs C# Component Pin
rudy.net12-Aug-05 9:09
rudy.net12-Aug-05 9:09 
GeneralCtrl+C exception Pin
zaboboa11-Aug-05 2:09
zaboboa11-Aug-05 2:09 
GeneralRe: Ctrl+C exception Pin
MicrosoftBob11-Aug-05 3:24
MicrosoftBob11-Aug-05 3:24 
GeneralRe: Ctrl+C exception Pin
zaboboa11-Aug-05 5:23
zaboboa11-Aug-05 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.