Click here to Skip to main content
15,900,532 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to run the dropped file ? Pin
Xmen Real 1-Jul-08 2:31
professional Xmen Real 1-Jul-08 2:31 
AnswerRe: how to run the dropped file ? Pin
Jimmanuel30-Jun-08 10:20
Jimmanuel30-Jun-08 10:20 
GeneralRe: how to run the dropped file ? Pin
Xmen Real 30-Jun-08 14:45
professional Xmen Real 30-Jun-08 14:45 
AnswerRe: how to run the dropped file ? Pin
DaveyM691-Jul-08 2:53
professionalDaveyM691-Jul-08 2:53 
GeneralRe: how to run the dropped file ? Pin
Xmen Real 1-Jul-08 5:12
professional Xmen Real 1-Jul-08 5:12 
QuestionUnable to Connect to Visual Studios Local Host server Pin
kibromg30-Jun-08 5:14
kibromg30-Jun-08 5:14 
AnswerRe: Unable to Connect to Visual Studios Local Host server Pin
John_Adams30-Jun-08 8:44
John_Adams30-Jun-08 8:44 
Questionremoving row from dataTable / DataGridView Issue Pin
Harvey Saayman30-Jun-08 5:12
Harvey Saayman30-Jun-08 5:12 
hey guys

ive got two dataTables and two DataGrids on a form

The first datagrid's data is bound perfectly, now on a button click i need to add the selected row of the 1st DataGridView to the 2nd dataGridViews dataTable and remove it from the first

i tried this to remove the row...

private void button1_Click(object sender, EventArgs e)
{
    foreach (DataGridViewRow row in dataGridView1.SelectedRows)
    {
        avalibalTimeCatRow = avalibalTimeCatTable.NewRow();
        avalibalTimeCatRow[avalibalTimeCatIdColumn] = Int32.Parse(row.Cells[0].Value.ToString());
        avalibalTimeCatRow[avalibalTimeCatNameColumn] = row.Cells[1].Value.ToString();

        avalibalTimeCatTable.Rows.Remove(avalibalTimeCatRow); // error occurs here
    }
}


the error is " The given DataRow is not in the current DataRowCollection."

any other ideas on how to remove the row?

thanx

Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL

you.suck = (you.passion != Programming)

AnswerRe: removing row from dataTable / DataGridView Issue Pin
Xmen Real 30-Jun-08 5:21
professional Xmen Real 30-Jun-08 5:21 
GeneralRe: removing row from dataTable / DataGridView Issue Pin
Harvey Saayman30-Jun-08 20:14
Harvey Saayman30-Jun-08 20:14 
GeneralRe: removing row from dataTable / DataGridView Issue Pin
Xmen Real 30-Jun-08 22:46
professional Xmen Real 30-Jun-08 22:46 
GeneralRe: removing row from dataTable / DataGridView Issue Pin
Harvey Saayman30-Jun-08 22:59
Harvey Saayman30-Jun-08 22:59 
GeneralRe: removing row from dataTable / DataGridView Issue Pin
Xmen Real 30-Jun-08 23:02
professional Xmen Real 30-Jun-08 23:02 
GeneralRe: removing row from dataTable / DataGridView Issue Pin
Harvey Saayman30-Jun-08 23:07
Harvey Saayman30-Jun-08 23:07 
GeneralRe: removing row from dataTable / DataGridView Issue Pin
Xmen Real 30-Jun-08 23:08
professional Xmen Real 30-Jun-08 23:08 
GeneralRe: removing row from dataTable / DataGridView Issue Pin
Harvey Saayman30-Jun-08 23:13
Harvey Saayman30-Jun-08 23:13 
AnswerRe: removing row from dataTable / DataGridView Issue Pin
Kjetil Svendsen30-Jun-08 22:28
Kjetil Svendsen30-Jun-08 22:28 
GeneralRe: removing row from dataTable / DataGridView Issue Pin
Harvey Saayman30-Jun-08 22:43
Harvey Saayman30-Jun-08 22:43 
QuestionSorting Data using BindingSource.Sort Pin
Alessandra7730-Jun-08 4:46
Alessandra7730-Jun-08 4:46 
AnswerRe: Sorting Data using BindingSource.Sort Pin
PIEBALDconsult30-Jun-08 5:41
mvePIEBALDconsult30-Jun-08 5:41 
QuestionAuto update of program (Downloading from web) Pin
Casper Hansen30-Jun-08 4:35
Casper Hansen30-Jun-08 4:35 
AnswerRe: Auto update of program (Downloading from web) Pin
User 665830-Jun-08 4:59
User 665830-Jun-08 4:59 
GeneralRe: Auto update of program (Downloading from web) Pin
Casper Hansen30-Jun-08 5:43
Casper Hansen30-Jun-08 5:43 
AnswerRe: Auto update of program (Downloading from web) Pin
Kjetil Svendsen30-Jun-08 22:34
Kjetil Svendsen30-Jun-08 22:34 
QuestionHelp with data update Pin
anton-0930-Jun-08 3:56
anton-0930-Jun-08 3:56 

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.