We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding a new row to a datatable

Thread ID:





6336 Aug 8,2003 04:11 PM UTC Aug 8,2003 09:32 PM UTC WinForms 1
Tags: GridControl
Steli Andrei
Asked On August 8, 2003 04:11 PM UTC

Back to my question: I have a GridDataBoundGrid bound to a datatable: dtblParts, and in it I display the following columns: CategoryID, PartID, Price and Quantity. Price column gets populated based on my selection in CategoryID and PartID. What I want now is that when I put in a value for Quantity a TotalPrice to be calculated and displayed somewhere on the form. To do that I do have a routine that checks the number of rows datatable has. Here is the problem: the number of rows is: 0. This is the way I initiate a "New part " operation: dtblParts.rows.Clear dtblParts.NewRow grdParts.DataSource = dtblParts grdParts.Refresh Why when I start editing Quantity column my datatable does not have any rows, because I just added one. You have to click on the next blank row and back in to get a row added to the datatable. (I check to rows.Count property)

Administrator [Syncfusion]
Replied On August 8, 2003 09:32 PM UTC

Instead of dtblParts.NewRow, try this code. dtblParts.Rows.Add(dtblParts.NewRow)


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon