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.
Unfortunately, activation email could not send to your email. Please try again.

Insert Row to DataGrid

Thread ID:

Created:

Platform:

Replies:

4471 May 14,2003 03:13 PM Windows Forms 0
loading
Tags: FAQ
Jawed Hadi
Asked On May 14, 2003 03:13 PM

Hi I have two questions (problems) 1. I am using the following code to add a new Row. It does add a new row to my Datagrid and it lets me add data to it, when I move to the next row it deletes all the data from this new row and moves the blank row one down and replaces it with the older row. Then it does not accept any data when you write into the cells of this row. Maybe I need to add some extra line of code to this. Can some help please? Thanks Dim dr as Datarow Dim dt as New Datatable() = mydataSet.tables(0) dr = dt.NewRow If myGrid.IsSelected(myGrid.CurrentRowIndex) Then dt.Rows.InsertAt((dr, myGrid.CurrentRowIndex) dt.AcceptChages() Else msgBox("Select a row first") End If 2. If I close my data Grid Window how can I know whether my Data Grid was Modified? Thanks for taking the time to help

CONFIRMATION

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.

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.

;