Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
GeneralDatagrid / Datarow Pin
MrEyes28-Jul-03 23:04
MrEyes28-Jul-03 23:04 
I have an application that takes a load of data and pumps it into a Datagrid, the problem I have is that I want to be able to retrieve all the values for the currently selected row in the grid.

Is there a way of using the current row index to retrieve all values into a DataRow (I also need the column header names aswell)?

At the moment I am doing this a god awful and rather restrictive way, by using :

int selectedrow = myGrid.CurrentRowIndex
string val0 = myGrid[selectedrow, 0].ToString();
string val1 = myGrid[selectedrow, 1].ToString();
string val2 = myGrid[selectedrow, 2].ToString();
string val3 = myGrid[selectedrow, 3].ToString();
.....


I am open to any other suggestions, as I dont have to use a DataRow - so over to you guys.

Thanks
GeneralRe: Datagrid / Datarow Pin
MrEyes29-Jul-03 0:16
MrEyes29-Jul-03 0:16 
GeneralListView complication Pin
aeros28-Jul-03 22:48
aeros28-Jul-03 22:48 
GeneralRe: ListView complication Pin
Ista30-Jul-03 4:25
Ista30-Jul-03 4:25 
GeneralRe: Multibyte character Pin
Julian Bucknall [MSFT]29-Jul-03 9:33
Julian Bucknall [MSFT]29-Jul-03 9:33 
GeneralRe: Multibyte character Pin
Nick Parker29-Jul-03 17:33
protectorNick Parker29-Jul-03 17:33 
QuestionHow to compile to native app? Pin
EastDragon28-Jul-03 21:27
EastDragon28-Jul-03 21:27 
AnswerRe: How to compile to native app? Pin
Alexander Kojevnikov28-Jul-03 23:10
Alexander Kojevnikov28-Jul-03 23:10 
QuestionWhy C# app build by vs.net 2003 can resize itself? Pin
EastDragon28-Jul-03 21:04
EastDragon28-Jul-03 21:04 
QuestionWhy C# Builder build program faster and smaller than vs.net? Pin
EastDragon28-Jul-03 20:20
EastDragon28-Jul-03 20:20 
AnswerRe: Why C# Builder build program faster and smaller than vs.net? Pin
[sharp]28-Jul-03 22:01
[sharp]28-Jul-03 22:01 
GeneralRe: Why C# Builder build program faster and smaller than vs.net? Pin
EastDragon28-Jul-03 23:07
EastDragon28-Jul-03 23:07 
GeneralRe: Why C# Builder build program faster and smaller than vs.net? Pin
Julian Bucknall [MSFT]29-Jul-03 9:08
Julian Bucknall [MSFT]29-Jul-03 9:08 
GeneralRe: Why C# Builder build program faster and smaller than vs.net? Pin
Kevin McFarlane29-Jul-03 6:54
Kevin McFarlane29-Jul-03 6:54 
AnswerRe: Why C# Builder build program faster and smaller than vs.net? Pin
Kevin McFarlane29-Jul-03 6:50
Kevin McFarlane29-Jul-03 6:50 
GeneralRe: Why C# Builder build program faster and smaller than vs.net? Pin
EastDragon29-Jul-03 16:13
EastDragon29-Jul-03 16:13 
GeneralRe: Why C# Builder build program faster and smaller than vs.net? Pin
Kevin McFarlane31-Jul-03 0:15
Kevin McFarlane31-Jul-03 0:15 
GeneralWhy cannot dasm the release version app using vs.net 2003 Pin
EastDragon28-Jul-03 20:06
EastDragon28-Jul-03 20:06 
GeneralRe: Why cannot dasm the release version app using vs.net 2003 Pin
LongRange.Shooter29-Jul-03 8:12
LongRange.Shooter29-Jul-03 8:12 
GeneralRe: Checking for Errors Pin
Member 9628-Jul-03 18:48
Member 9628-Jul-03 18:48 
GeneralRe: Checking for Errors Pin
totig28-Jul-03 22:05
totig28-Jul-03 22:05 
GeneralRe: Checking for Errors Pin
Rocky Moore28-Jul-03 22:36
Rocky Moore28-Jul-03 22:36 
GeneralRe: Checking for Errors Pin
Rocky Moore29-Jul-03 0:25
Rocky Moore29-Jul-03 0:25 
QuestionMinimize a maximized window ? Pin
heelios28-Jul-03 17:34
heelios28-Jul-03 17:34 
AnswerRe: Minimize a maximized window ? Pin
LongRange.Shooter29-Jul-03 5:46
LongRange.Shooter29-Jul-03 5:46 

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.