Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
GeneralRe: Loading app.config from a remote location fails to load section handler. Pin
Larantz11-Nov-09 23:50
Larantz11-Nov-09 23:50 
GeneralRe: Loading app.config from a remote location fails to load section handler. Pin
Shameel12-Nov-09 0:00
professionalShameel12-Nov-09 0:00 
GeneralRe: Loading app.config from a remote location fails to load section handler. Pin
Larantz12-Nov-09 0:11
Larantz12-Nov-09 0:11 
Questionadd row to data grid view problem Pin
Rinad11-Nov-09 22:51
Rinad11-Nov-09 22:51 
AnswerMessage Closed Pin
11-Nov-09 22:55
stancrm11-Nov-09 22:55 
GeneralRe: add row to data grid view problem Pin
Rinad11-Nov-09 23:31
Rinad11-Nov-09 23:31 
GeneralRe: add row to data grid view problem Pin
Gerry Schmitz12-Nov-09 1:39
mveGerry Schmitz12-Nov-09 1:39 
GeneralRe: add row to data grid view problem Pin
Luc Pattyn12-Nov-09 2:34
sitebuilderLuc Pattyn12-Nov-09 2:34 
Rinad wrote:
DataGridViewRow row = new DataGridViewRow();
row = GridOne.Rows[GridOne.CurrentRow.Index];

DataGridViewRow row2 = new DataGridViewRow();
row2 = row;


So this is what you're doing:

row = new DataGridViewRow();                   // create a new row (will never be used)
row = GridOne.Rows[GridOne.CurrentRow.Index];  // get reference to row from GridOne

DataGridViewRow row2 = new DataGridViewRow();  // create a new row (will never be used)
row2 = row;                                    // copy reference to row from GridOne


the new rows you create are thrown away in the next line!

For copying a DGV row to another DGV what you probably need (I've never done this) is:
1. get the source row
2. clone it
3. add the clone to DGV2

For moving a DGV row to another DGV what you probably need is:
1. get the source row
2. remove it from DGV1
3. add the clone to DGV2

In both cases, there is no new DataGridViewRow() involved (it wouldn't even now how your row is supposed to look).

Smile | :)

Luc Pattyn

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


QuestionInheritence Pin
sris 42611-Nov-09 22:27
sris 42611-Nov-09 22:27 
AnswerRe: Inheritence Pin
The Man from U.N.C.L.E.11-Nov-09 22:38
The Man from U.N.C.L.E.11-Nov-09 22:38 
GeneralRe: Inheritence Pin
sris 42611-Nov-09 22:59
sris 42611-Nov-09 22:59 
GeneralRe: Inheritence Pin
dan!sh 11-Nov-09 23:09
professional dan!sh 11-Nov-09 23:09 
GeneralRe: Inheritence Pin
sris 42611-Nov-09 23:14
sris 42611-Nov-09 23:14 
GeneralRe: Inheritence Pin
dan!sh 11-Nov-09 23:23
professional dan!sh 11-Nov-09 23:23 
GeneralRe: Inheritence Pin
The Man from U.N.C.L.E.12-Nov-09 5:05
The Man from U.N.C.L.E.12-Nov-09 5:05 
GeneralRe: Inheritence Pin
sris 42612-Nov-09 5:33
sris 42612-Nov-09 5:33 
GeneralRe: Inheritence Pin
The Man from U.N.C.L.E.12-Nov-09 5:45
The Man from U.N.C.L.E.12-Nov-09 5:45 
GeneralRe: Inheritence Pin
PIEBALDconsult12-Nov-09 6:00
mvePIEBALDconsult12-Nov-09 6:00 
GeneralRe: Inheritence Pin
sris 42612-Nov-09 6:08
sris 42612-Nov-09 6:08 
AnswerRe: Inheritence Pin
Eduard Keilholz11-Nov-09 22:45
Eduard Keilholz11-Nov-09 22:45 
GeneralRe: Inheritence Pin
dan!sh 11-Nov-09 22:53
professional dan!sh 11-Nov-09 22:53 
AnswerRe: Inheritence Pin
PIEBALDconsult12-Nov-09 4:11
mvePIEBALDconsult12-Nov-09 4:11 
Questionclick on combobox then display new form Pin
vikas shukla11-Nov-09 21:12
vikas shukla11-Nov-09 21:12 
AnswerRe: click on combobox then display new form Pin
Christian Graus11-Nov-09 21:13
protectorChristian Graus11-Nov-09 21:13 
AnswerRe: click on combobox then display new form Pin
dan!sh 11-Nov-09 21:18
professional dan!sh 11-Nov-09 21:18 

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.