G
Guest
I've searched and tried a few of the things I seen but nothing really helped
me. I am in visual studio 2003 and using visual c++. I created a table by
typing in the data inside the IDE. Inside the load event for the form I
added rows to the table
ataRow *myRow;
myRow = dataTable1->NewRow();
myRow->Item[COL_COMPONENTS] = S"X-Axis";
myRow->Item[COL_UNITS] = S"Inches";
dataTable1->Rows->Add(myRow);
myRow = dataTable1->NewRow();
myRow->Item[COL_COMPONENTS] = S"Y-Axis";
myRow->Item[COL_UNITS] = S"Inches";
dataTable1->Rows->Add(myRow);
Now I want to edit a row. Change a column that was previously set to a null
value.
What I have so far is
myRow = dataTable1->Rows->Item[rowNum];
myRow->BeginEdit();
myRow->Item[COL_CURRPOS] = tmp;
myRow->EndEdit();
dataTable1->AcceptChanges();
Where rowNum = a known index number of the row I want to change, and
COL_CURPOS is the column I want to make changes to. tmp is the variable
holding the value I want to post to that column of said row. I have tried
without the begin/end edit and without the acceptchanges... nothing seems to
result in the column on my table being changed?
me. I am in visual studio 2003 and using visual c++. I created a table by
typing in the data inside the IDE. Inside the load event for the form I
added rows to the table
ataRow *myRow;
myRow = dataTable1->NewRow();
myRow->Item[COL_COMPONENTS] = S"X-Axis";
myRow->Item[COL_UNITS] = S"Inches";
dataTable1->Rows->Add(myRow);
myRow = dataTable1->NewRow();
myRow->Item[COL_COMPONENTS] = S"Y-Axis";
myRow->Item[COL_UNITS] = S"Inches";
dataTable1->Rows->Add(myRow);
Now I want to edit a row. Change a column that was previously set to a null
value.
What I have so far is
myRow = dataTable1->Rows->Item[rowNum];
myRow->BeginEdit();
myRow->Item[COL_CURRPOS] = tmp;
myRow->EndEdit();
dataTable1->AcceptChanges();
Where rowNum = a known index number of the row I want to change, and
COL_CURPOS is the column I want to make changes to. tmp is the variable
holding the value I want to post to that column of said row. I have tried
without the begin/end edit and without the acceptchanges... nothing seems to
result in the column on my table being changed?