Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

Question about DataRows/DataGrids

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rustyryan - 13 Jul 2006 18:14 GMT
Hey all, I have a question about using DataRows (and ultimately, its
interplay with a DataGrid)

So I create my DataSet, create a DataTable, configure it with columns
and then add rows like so:
(C++ .NET)
DataTable* table; //assume setup
DataRow* row = table->NewRow();

//columns 0,1, and 2 are all setup in the table
row->set_Item(0,fi[i]->get_Name()); //assume fi[i]->GetName() returns
some string*
row->set_Item(1,S"Queued");
row->set_Item(2, S"---");
table->get_Rows()->Add(row);

After I have added the row to the table, can I still use the DataRow
object to change data in the row, or is this a no-no ? Do I need to
wrap the changes with calls to DataRow::BeginEdit and DataRow::EndEdit?

After I have added the DataTable to the DataSet and, set a DataGrid to
refer to the DataSet and display the DataTable I setup, can I still
change stuff then?

If I do, what is the proper way to update things? Should I call
DataGrid::Update()?

I'm dealing with some nasty problems where I get the "No original data"
error from my datagrid while I'm updating literally all the rows in the
table by just directly referring to the DataRow object I got from
DataTable::NewRow() in the beginning.

tia,
rj ryan
Johnny - 14 Jul 2006 12:10 GMT
I am not sure but don't you have to AcceptChanges() to the dataset after
adding new rows to the table. This way the rows will take the state of
original. Of course if you have to report changes to a database then you have
no way to know what was changed but worth a try and maybe code to keep track
of additions

> Hey all, I have a question about using DataRows (and ultimately, its
> interplay with a DataGrid)
[quoted text clipped - 30 lines]
> tia,
> rj ryan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.