Click here to Skip to main content
15,896,201 members
Home / Discussions / C#
   

C#

 
GeneralSerializing an object with two events; need to store the hooked-up event handlers somehow Pin
PilsnerDk22-Oct-04 8:32
PilsnerDk22-Oct-04 8:32 
QuestionRegOpenKey and similar .... marshal/P-Invoke?? Pin
Paolo Ponzano22-Oct-04 7:56
Paolo Ponzano22-Oct-04 7:56 
AnswerRe: RegOpenKey and similar .... marshal/P-Invoke?? Pin
Nick Parker22-Oct-04 10:57
protectorNick Parker22-Oct-04 10:57 
AnswerRe: RegOpenKey and similar .... marshal/P-Invoke?? Pin
Ami Bar22-Oct-04 13:56
Ami Bar22-Oct-04 13:56 
GeneralRe: RegOpenKey and similar .... marshal/P-Invoke?? Pin
Paolo Ponzano23-Oct-04 1:35
Paolo Ponzano23-Oct-04 1:35 
GeneralRe: RegOpenKey and similar .... marshal/P-Invoke?? Pin
Ami Bar23-Oct-04 5:01
Ami Bar23-Oct-04 5:01 
Generalfind the contents of a cell in a datagrid row Pin
steve_rm22-Oct-04 6:09
steve_rm22-Oct-04 6:09 
GeneralRe: find the contents of a cell in a datagrid row Pin
Heath Stewart22-Oct-04 12:59
protectorHeath Stewart22-Oct-04 12:59 
You use either the DataView you might have assigned to the DataGrid, or get the CurrencyManager and query for the DataRow with that index. Don't simply use the DataSet or DataTable because after sorting the DataGrid those rows our out of sync. An example follows:
CurrencyManager cm = (CurrencyManager)dataGrid1.BindingContext[
  dataGrid1.DataSource, dataGrid1.DataMember];
if (cm != null)
{
  // You could also just cast 'Current' to a DataRowView.
  DataView view = cm.List as DataView;
  if (view != null)
  {
    DataRowView rowView = view[rowIndex];
    object value = rowView[0];
    if (value != null) return value.ToString();
    else return null;
  }
}
An IndexOutOfRangeException may be thrown in this sample at view[rowIndex], but that should actually be a desired effect from this code (make sure you handle it, though).

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralEfficient implementation of multidimensional arrays Pin
Andrew Kuklin22-Oct-04 5:03
sussAndrew Kuklin22-Oct-04 5:03 
GeneralRe: Efficient implementation of multidimensional arrays Pin
J4amieC22-Oct-04 5:24
J4amieC22-Oct-04 5:24 
GeneralRe: Efficient implementation of multidimensional arrays Pin
Utwig26-Oct-04 0:29
Utwig26-Oct-04 0:29 
QuestionWhich is faster?? Pin
exhaulted22-Oct-04 4:46
exhaulted22-Oct-04 4:46 
AnswerRe: Which is faster?? Pin
J4amieC22-Oct-04 5:16
J4amieC22-Oct-04 5:16 
GeneralRe: Which is faster?? Pin
exhaulted22-Oct-04 5:25
exhaulted22-Oct-04 5:25 
GeneralRe: Which is faster?? Pin
Colin Angus Mackay22-Oct-04 13:59
Colin Angus Mackay22-Oct-04 13:59 
GeneralRe: Which is faster?? Pin
exhaulted24-Oct-04 21:49
exhaulted24-Oct-04 21:49 
AnswerRe: Which is faster?? Pin
yoaz22-Oct-04 7:34
yoaz22-Oct-04 7:34 
AnswerRe: Which is faster?? Pin
Jankinsoo22-Oct-04 19:01
Jankinsoo22-Oct-04 19:01 
GeneralMFC/C++ app can't acquire C# mutex Pin
sjhart22-Oct-04 0:44
sjhart22-Oct-04 0:44 
GeneralRe: MFC/C++ app can't acquire C# mutex Pin
Uwe Keim23-Oct-04 4:49
sitebuilderUwe Keim23-Oct-04 4:49 
Generalhook 2 forms Pin
StateOfTrance21-Oct-04 22:54
StateOfTrance21-Oct-04 22:54 
GeneralRe: hook 2 forms Pin
Alex Korchemniy22-Oct-04 18:49
Alex Korchemniy22-Oct-04 18:49 
GeneralEvents in DataGrid Pin
Anonymous21-Oct-04 21:12
Anonymous21-Oct-04 21:12 
GeneralRe: Events in DataGrid Pin
KSEI22-Oct-04 0:50
KSEI22-Oct-04 0:50 
GeneralRe: Events in DataGrid Pin
Anonymous22-Oct-04 3:38
Anonymous22-Oct-04 3:38 

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.