Click here to Skip to main content
15,905,915 members
Home / Discussions / C#
   

C#

 
QuestionFormula Translation Pin
punitxsmart28-Apr-09 1:56
punitxsmart28-Apr-09 1:56 
AnswerRe: Formula Translation Pin
CPallini28-Apr-09 1:58
mveCPallini28-Apr-09 1:58 
GeneralRe: Formula Translation Pin
punitxsmart28-Apr-09 2:09
punitxsmart28-Apr-09 2:09 
GeneralRe: Formula Translation Pin
CPallini28-Apr-09 2:12
mveCPallini28-Apr-09 2:12 
QuestionMSBuild / Microsoft.Build... nyaaargh! Pin
Wenff28-Apr-09 1:32
professionalWenff28-Apr-09 1:32 
AnswerRe: MSBuild / Microsoft.Build... nyaaargh! Pin
SeMartens28-Apr-09 1:41
SeMartens28-Apr-09 1:41 
AnswerRe: MSBuild / Microsoft.Build... nyaaargh! Pin
Wenff29-Apr-09 6:00
professionalWenff29-Apr-09 6:00 
QuestionDataGridView index problem = VS2008 C# Pin
DlogDash28-Apr-09 1:08
DlogDash28-Apr-09 1:08 
Has anyone else had issues similar to this?
If a row is selected in the DataGridView on a form the following event handling code correctly gets the index value of the row. However, the code to extract values from the row actually gets values from the next row. For example if the fourth row is selected, index has the correct value of 3 but the row values are from the fifth row. Decrementing the value returned from vDateDataGridView.CurrentRow.Index then referenced the third row! Decrementing and then incrementing the value again referenced the fifth row. If the index value is assigned from a constant (e.g. index = 3), the problem does not occur.

string str;
int index;
index = vDateDataGridView.CurrentRow.Index;// gives correct index
str = vDateDataGridView.Rows[index].Cells[0].Value.ToString();
str = vDateDataGridView[0, index].Value.ToString();

CurrentRow.Index supposedly returns an int, but this behaviour suggests rounding issues or similar. Recasting after using the CurrentRow.Index.ToString() function did not make any difference.

I have replicated this behaviour in a fresh form in the same project. The underlying data source is a View joining three tables. I will see if the same problem occurs with a single table datasource. Yes, it did.

Tony Horsham
AnswerRe: DataGridView index problem = VS2008 C# Pin
musefan28-Apr-09 2:20
musefan28-Apr-09 2:20 
GeneralRe: DataGridView index problem = VS2008 C# [modified] Pin
DlogDash28-Apr-09 11:27
DlogDash28-Apr-09 11:27 
QuestionRegular Expression validator for currecny Pin
Member 254517628-Apr-09 1:03
Member 254517628-Apr-09 1:03 
AnswerRe: Regular Expression validator for currecny Pin
musefan28-Apr-09 2:16
musefan28-Apr-09 2:16 
GeneralRe: Regular Expression validator for currecny Pin
Member 254517628-Apr-09 2:20
Member 254517628-Apr-09 2:20 
GeneralRe: Regular Expression validator for currecny Pin
musefan28-Apr-09 2:48
musefan28-Apr-09 2:48 
GeneralRe: Regular Expression validator for currecny Pin
Member 254517629-Apr-09 18:00
Member 254517629-Apr-09 18:00 
QuestionAbout the certification validation period Pin
Roshanakak28-Apr-09 0:56
Roshanakak28-Apr-09 0:56 
QuestionUsing Block - Call Function Pin
dataminers28-Apr-09 0:46
dataminers28-Apr-09 0:46 
AnswerRe: Using Block - Call Function Pin
SeMartens28-Apr-09 0:51
SeMartens28-Apr-09 0:51 
QuestionHelp with drawing Pin
Johnny Jackson28-Apr-09 0:10
Johnny Jackson28-Apr-09 0:10 
AnswerRe: Help with drawing Pin
Henry Minute28-Apr-09 0:32
Henry Minute28-Apr-09 0:32 
AnswerRe: Help with drawing Pin
Bharat Jain28-Apr-09 0:34
Bharat Jain28-Apr-09 0:34 
AnswerRe: Help with drawing Pin
Rob Philpott28-Apr-09 0:56
Rob Philpott28-Apr-09 0:56 
GeneralRe: Help with drawing Pin
Johnny Jackson28-Apr-09 1:40
Johnny Jackson28-Apr-09 1:40 
GeneralRe: Help with drawing Pin
musefan28-Apr-09 2:04
musefan28-Apr-09 2:04 
GeneralRe: Help with drawing Pin
Johnny Jackson28-Apr-09 20:15
Johnny Jackson28-Apr-09 20:15 

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.