Click here to Skip to main content
15,895,656 members
Home / Discussions / C#
   

C#

 
Generaliterate over datagrid Pin
kloepper22-Jul-04 15:26
kloepper22-Jul-04 15:26 
GeneralRe: iterate over datagrid Pin
Roman Rodov22-Jul-04 15:40
Roman Rodov22-Jul-04 15:40 
GeneralRe: iterate over datagrid Pin
kloepper22-Jul-04 15:55
kloepper22-Jul-04 15:55 
GeneralRe: iterate over datagrid Pin
Colin Angus Mackay23-Jul-04 0:22
Colin Angus Mackay23-Jul-04 0:22 
GeneralRe: iterate over datagrid Pin
kloepper23-Jul-04 4:28
kloepper23-Jul-04 4:28 
GeneralRe: iterate over datagrid Pin
DougW4822-Jul-04 15:41
DougW4822-Jul-04 15:41 
GeneralRe: iterate over datagrid Pin
kloepper22-Jul-04 16:00
kloepper22-Jul-04 16:00 
GeneralRe: iterate over datagrid Pin
DougW4822-Jul-04 16:09
DougW4822-Jul-04 16:09 
Actually, I messed the syntax up. You can get the value of a cell with:

dataGrid[rowNum, colNum]

I agree with the other post about using the dataset instead of the grid...but if you have to, you can use the grid. Keep in mind that if you use the datagrid instead of the dataset, you will have to find a way of counting the rows. This is why I used the try/catch block of stopping the loop in my example. I'm sure there are better ways...I'm just too lazy tonight to look anything up. Also, if you use the datagrid, you may have to check the values you get from the cells to make sure they are usable. If the grid is editable, you'll (almost) always have that extra row at the bottom that will have nothing, but you'll still be able to return the value from those cells.

Good luck!

- D
GeneralMultiple icons compiled within an .exe Pin
cdengler22-Jul-04 14:58
cdengler22-Jul-04 14:58 
GeneralRe: Multiple icons compiled within an .exe Pin
Roman Rodov22-Jul-04 15:42
Roman Rodov22-Jul-04 15:42 
GeneralRe: Multiple icons compiled within an .exe Pin
Heath Stewart23-Jul-04 5:41
protectorHeath Stewart23-Jul-04 5:41 
GeneralRe: Multiple icons compiled within an .exe Pin
Heath Stewart23-Jul-04 5:49
protectorHeath Stewart23-Jul-04 5:49 
GeneralExporting Crystal Reports to Excel Pin
KSEI22-Jul-04 14:27
KSEI22-Jul-04 14:27 
QuestionSearching for opponents, what do I need? Pin
Link260022-Jul-04 13:04
Link260022-Jul-04 13:04 
AnswerRe: Searching for opponents, what do I need? Pin
TalkingBabb0t22-Jul-04 16:13
TalkingBabb0t22-Jul-04 16:13 
AnswerRe: Searching for opponents, what do I need? Pin
Dave Kreskowiak22-Jul-04 16:33
mveDave Kreskowiak22-Jul-04 16:33 
GeneralRe: Searching for opponents, what do I need? Pin
Link260022-Jul-04 16:45
Link260022-Jul-04 16:45 
GeneralRe: Searching for opponents, what do I need? Pin
Dave Kreskowiak22-Jul-04 16:53
mveDave Kreskowiak22-Jul-04 16:53 
GeneralRe: Searching for opponents, what do I need? Pin
Link260022-Jul-04 16:58
Link260022-Jul-04 16:58 
GeneralRe: Searching for opponents, what do I need? Pin
Colin Angus Mackay22-Jul-04 23:56
Colin Angus Mackay22-Jul-04 23:56 
GeneralRe: Searching for opponents, what do I need? Pin
Link260023-Jul-04 7:13
Link260023-Jul-04 7:13 
GeneralRe: Searching for opponents, what do I need? Pin
Bill Dean23-Jul-04 8:25
Bill Dean23-Jul-04 8:25 
GeneralRe: Searching for opponents, what do I need? Pin
Dave Kreskowiak23-Jul-04 10:40
mveDave Kreskowiak23-Jul-04 10:40 
GeneralReceiving NoNullAllowedException setting SelectedValue from code. Pin
Brett Slaski22-Jul-04 12:01
Brett Slaski22-Jul-04 12:01 
GeneralRe: Receiving NoNullAllowedException setting SelectedValue from code. Pin
Heath Stewart22-Jul-04 12:11
protectorHeath Stewart22-Jul-04 12:11 

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.