Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
Questioncomponent for datagridview Pin
SajjadZare6-Jan-10 5:14
SajjadZare6-Jan-10 5:14 
AnswerRe: component for datagridview Pin
dan!sh 6-Jan-10 5:34
professional dan!sh 6-Jan-10 5:34 
GeneralRe: component for datagridview Pin
SajjadZare6-Jan-10 5:38
SajjadZare6-Jan-10 5:38 
GeneralRe: component for datagridview Pin
dan!sh 6-Jan-10 5:46
professional dan!sh 6-Jan-10 5:46 
QuestionHow do I access row and cell information in a bound DataGridView? Pin
arnold_w6-Jan-10 5:11
arnold_w6-Jan-10 5:11 
AnswerRe: How do I access row and cell information in a bound DataGridView? Pin
dan!sh 6-Jan-10 5:45
professional dan!sh 6-Jan-10 5:45 
GeneralRe: How do I access row and cell information in a bound DataGridView? Pin
arnold_w6-Jan-10 21:27
arnold_w6-Jan-10 21:27 
GeneralRe: How do I access row and cell information in a bound DataGridView? Pin
dan!sh 7-Jan-10 4:05
professional dan!sh 7-Jan-10 4:05 
arnold_w wrote:
The code is posted here and the printing code is the second row from the end


Sorry. I thought you are speaking of printing (hard copy) datagridview. I took a look at your code. Here are some comments:

1. Get rid of binding source and use this:

DataGridView dataGridView2 = new DataGridView();
      DataTable dataTable = new DataTable();
      dataTable.Columns.Add("My Column");
      dataTable.Rows.Add("My Cell Value");
      dataGridView2.DataSource = dataTable;


2. What I found from debugging is that unless form is loaded, you don't get the row count. Not sure of reason* but you do get the count in load. So probably if you check for row count in the load event, you would get the correct result.

The second exception is also for the same reason. Put that as well in the Load event and I guess it should work.

*I have posted a question regarding same. You can check that and get to know the reason.

50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

GeneralRe: How do I access row and cell information in a bound DataGridView? Pin
arnold_w7-Jan-10 4:24
arnold_w7-Jan-10 4:24 
GeneralRe: How do I access row and cell information in a bound DataGridView? Pin
arnold_w7-Jan-10 4:30
arnold_w7-Jan-10 4:30 
GeneralRe: How do I access row and cell information in a bound DataGridView? Pin
dan!sh 7-Jan-10 6:27
professional dan!sh 7-Jan-10 6:27 
GeneralRe: How do I access row and cell information in a bound DataGridView? Pin
arnold_w7-Jan-10 22:05
arnold_w7-Jan-10 22:05 
QuestionSingleton Class and Static Class Pin
dataminers6-Jan-10 4:01
dataminers6-Jan-10 4:01 
AnswerRe: Singleton Class and Static Class Pin
#realJSOP6-Jan-10 4:07
mve#realJSOP6-Jan-10 4:07 
AnswerRe: Singleton Class and Static Class Pin
harold aptroot6-Jan-10 4:07
harold aptroot6-Jan-10 4:07 
AnswerRe: Singleton Class and Static Class Pin
Abhinav S6-Jan-10 5:52
Abhinav S6-Jan-10 5:52 
AnswerRe: Singleton Class and Static Class Pin
carlecomm6-Jan-10 19:13
carlecomm6-Jan-10 19:13 
QuestionGenerating partitions Pin
varsha parmar6-Jan-10 3:39
varsha parmar6-Jan-10 3:39 
AnswerRe: Generating partitions Pin
Luc Pattyn6-Jan-10 3:46
sitebuilderLuc Pattyn6-Jan-10 3:46 
GeneralRe: Generating partitions Pin
varsha parmar6-Jan-10 3:56
varsha parmar6-Jan-10 3:56 
GeneralRe: Generating partitions Pin
#realJSOP6-Jan-10 4:00
mve#realJSOP6-Jan-10 4:00 
GeneralRe: Generating partitions Pin
Luc Pattyn6-Jan-10 4:05
sitebuilderLuc Pattyn6-Jan-10 4:05 
GeneralRe: Generating partitions Pin
OriginalGriff6-Jan-10 5:43
mveOriginalGriff6-Jan-10 5:43 
GeneralRe: Generating partitions Pin
Luc Pattyn6-Jan-10 5:52
sitebuilderLuc Pattyn6-Jan-10 5:52 
GeneralRe: Generating partitions Pin
OriginalGriff6-Jan-10 6:05
mveOriginalGriff6-Jan-10 6:05 

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.