Click here to Skip to main content
15,908,013 members
Home / Discussions / C#
   

C#

 
Generalcheck box... Pin
ramya8313-Nov-03 22:50
ramya8313-Nov-03 22:50 
GeneralRe: check box... Pin
Corinna John13-Nov-03 23:48
Corinna John13-Nov-03 23:48 
GeneralRe: check box... Pin
ramya8314-Nov-03 2:45
ramya8314-Nov-03 2:45 
GeneralRe: check box... Pin
Heath Stewart14-Nov-03 3:08
protectorHeath Stewart14-Nov-03 3:08 
QuestionHow to use C# Pin
Xuan Thuy13-Nov-03 22:12
Xuan Thuy13-Nov-03 22:12 
AnswerRe: How to use C# Pin
Heath Stewart14-Nov-03 2:56
protectorHeath Stewart14-Nov-03 2:56 
Questionhow to get the indexes of selected items in DataGrid? Pin
wangier13-Nov-03 21:13
wangier13-Nov-03 21:13 
AnswerRe: how to get the indexes of selected items in DataGrid? Pin
Heath Stewart14-Nov-03 2:49
protectorHeath Stewart14-Nov-03 2:49 
Create a collection of some type (like an ArrayList), then enumerate the rows in your DataGrid. You can do this using the BindingContext of the DataGrid to get the CurrencyManager which associates rows in the DataSource to their displayed rows (since sorting or filtering may change index mapping).

For each row index, you can call DataGrid.IsSelected, passing the row index. If true, add to the collection of selected rows.

The only real question is whether or not multiple rows are truly selected (i.e., they make look it but their state is a matter of the DataGrid's implementation).

I don't know why there isn't a much easier way (like with the ListView). Perhaps MS thought it wouldn't be oft-used enough to warrant the resources. Of course, this could be said about a lot of things in the .NET 1.x BCL! Mad | :mad:

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralTab control issue Pin
Gambit00713-Nov-03 20:05
Gambit00713-Nov-03 20:05 
GeneralSimple Question: COM interop Pin
CillyMe13-Nov-03 17:15
CillyMe13-Nov-03 17:15 
GeneralRe: Simple Question: COM interop Pin
Heath Stewart14-Nov-03 2:29
protectorHeath Stewart14-Nov-03 2:29 
Generalresizing controls Pin
udaan200313-Nov-03 13:16
udaan200313-Nov-03 13:16 
GeneralRe: resizing controls Pin
Heath Stewart14-Nov-03 2:41
protectorHeath Stewart14-Nov-03 2:41 
GeneralRe: resizing controls Pin
udaan200314-Nov-03 4:24
udaan200314-Nov-03 4:24 
GeneralRe: resizing controls Pin
Heath Stewart14-Nov-03 4:31
protectorHeath Stewart14-Nov-03 4:31 
Generalreleasing System.IO.FileInfo Pin
assinine13-Nov-03 11:35
assinine13-Nov-03 11:35 
GeneralRe: releasing System.IO.FileInfo Pin
Heath Stewart14-Nov-03 2:35
protectorHeath Stewart14-Nov-03 2:35 
GeneralToolbar Component Setting Pin
zuhx13-Nov-03 11:08
zuhx13-Nov-03 11:08 
GeneralRe: Toolbar Component Setting Pin
Heath Stewart14-Nov-03 2:37
protectorHeath Stewart14-Nov-03 2:37 
Generalhandling a voice event Pin
eafares26513-Nov-03 10:15
eafares26513-Nov-03 10:15 
GeneralRe: handling a voice event Pin
Kentamanos13-Nov-03 10:47
Kentamanos13-Nov-03 10:47 
GeneralRe: handling a voice event Pin
eafares26514-Nov-03 5:03
eafares26514-Nov-03 5:03 
GeneralBlock scope when using 'using' statement. Pin
Bill Priess13-Nov-03 6:29
Bill Priess13-Nov-03 6:29 
GeneralRe: Block scope when using 'using' statement. Pin
Heath Stewart13-Nov-03 7:06
protectorHeath Stewart13-Nov-03 7:06 
GeneralRe: Block scope when using 'using' statement. Pin
Bill Priess13-Nov-03 7:34
Bill Priess13-Nov-03 7:34 

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.