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?

Re: DataTable Edit Rows by William

William
Tue Aug 22 11:40:40 CDT 2006

At the point where you assign the value to the Row Item the data is in the
table. You don't need to call AcceptChanges. What evidence do you have that
the column value is not set? What is RowNum set to?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Philip" <Philip@discussions.microsoft.com> wrote in message
news:BA3DBCAB-B622-4789-94F6-C99D294E3CDC@microsoft.com...
> 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?
>