Click here to Skip to main content
15,921,941 members
Home / Discussions / C#
   

C#

 
GeneralRe: VB6 to C# conversion SetIndex issue Pin
Luc Pattyn17-Sep-09 5:38
sitebuilderLuc Pattyn17-Sep-09 5:38 
GeneralRe: VB6 to C# conversion SetIndex issue Pin
xtr33me17-Sep-09 5:44
xtr33me17-Sep-09 5:44 
GeneralRe: VB6 to C# conversion SetIndex issue Pin
N a v a n e e t h17-Sep-09 5:45
N a v a n e e t h17-Sep-09 5:45 
Questionpremature garbage collection of static class causing problem Pin
akhanal17-Sep-09 4:05
akhanal17-Sep-09 4:05 
AnswerRe: premature garbage collection of static class causing problem Pin
Luc Pattyn17-Sep-09 4:19
sitebuilderLuc Pattyn17-Sep-09 4:19 
GeneralRe: premature garbage collection of static class causing problem Pin
akhanal17-Sep-09 4:31
akhanal17-Sep-09 4:31 
GeneralRe: premature garbage collection of static class causing problem Pin
Luc Pattyn17-Sep-09 4:57
sitebuilderLuc Pattyn17-Sep-09 4:57 
GeneralRe: premature garbage collection of static class causing problem Pin
akhanal17-Sep-09 5:18
akhanal17-Sep-09 5:18 
GeneralRe: premature garbage collection of static class causing problem Pin
akhanal17-Sep-09 5:25
akhanal17-Sep-09 5:25 
QuestionError in Loading assembly from Assembly.Load Pin
SRKSHOME17-Sep-09 3:31
SRKSHOME17-Sep-09 3:31 
AnswerRe: Error in Loading assembly from Assembly.Load Pin
Not Active17-Sep-09 4:19
mentorNot Active17-Sep-09 4:19 
AnswerRe: Error in Loading assembly from Assembly.Load Pin
Luc Pattyn17-Sep-09 4:20
sitebuilderLuc Pattyn17-Sep-09 4:20 
QuestionCalling GUI & path finding gurus Pin
izakfick17-Sep-09 3:27
izakfick17-Sep-09 3:27 
AnswerRe: Calling GUI & path finding gurus Pin
Pete O'Hanlon17-Sep-09 4:11
mvePete O'Hanlon17-Sep-09 4:11 
QuestionAllow space in text box - add the code for allowing spaces in regular expression validator Pin
coolsharath17-Sep-09 3:21
coolsharath17-Sep-09 3:21 
AnswerRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
Calla17-Sep-09 3:40
Calla17-Sep-09 3:40 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
coolsharath17-Sep-09 3:51
coolsharath17-Sep-09 3:51 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
coolsharath17-Sep-09 4:06
coolsharath17-Sep-09 4:06 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
Calla17-Sep-09 4:20
Calla17-Sep-09 4:20 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
coolsharath17-Sep-09 4:26
coolsharath17-Sep-09 4:26 
GeneralRe: Allow space in text box - add the code for allowing spaces in regular expression validator Pin
OriginalGriff17-Sep-09 4:36
mveOriginalGriff17-Sep-09 4:36 
Questionhow one can programatically send keystroke, mouse move, mouse click Pin
Tridip Bhattacharjee17-Sep-09 2:18
professionalTridip Bhattacharjee17-Sep-09 2:18 
Questionhow to see datagrid print printpriview in c# windows. Pin
Ramesh Reddy1111117-Sep-09 2:17
Ramesh Reddy1111117-Sep-09 2:17 
AnswerRe: how to see datagrid print printpriview in c# windows. Pin
Henry Minute17-Sep-09 2:48
Henry Minute17-Sep-09 2:48 
The part of your code that is giving the error is
e.Graphics.DrawString(<big>this.dataGridView1(i, j)</big> + " ", f, b, j * 5, i * 5);


You are using this.dataGridView1(i, j) as if there were a DataGridView method that takes a row index and a column index and returns the value stored there. There is no such method.

You need to use square brackets '[]'.
Like this:
e.Graphics.DrawString(<big>this.dataGridView1[i, j]</big> + " ", f, b, j * 5, i * 5);

but as you have it you will get incorrect results, as it is dgrid[colindex, rowindex] and you are using dgrid[rowindex, colindex]

You can use something like
e.Graphics.DrawString(this.dataGridView1.Rows[i].Cells[j].Value.ToString() + " ", f, b, j * 5, i * 5);

so that you do not get confused about cols and rows.

Note also the .Value.ToString() in the last bit of code, you may, or may not need to use it in your code.

Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

QuestionWindows Service Credentials Pin
Sangioo17-Sep-09 2:09
Sangioo17-Sep-09 2:09 

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.