Avatar of jackjohnson44
jackjohnson44

asked on 

datagridview insert rows between

How do you insert a row between two rows in a datagridview?
.NET ProgrammingVisual Basic.NETEditors IDEs

Avatar of undefined
Last Comment
vbturbo
SOLUTION
Avatar of vbturbo
vbturbo
Flag of Denmark image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Sancler
Sancler

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of vbturbo
vbturbo
Flag of Denmark image


That is correct Roger, the row added always end up as the last row in the datasource table.
Bound or not it will be the last row in the datasource table. Except for dynamical list's and stack's

But for the given temporary state
<<How do you insert a row between two rows in a datagridview?

It will succed.

vbturbo
Avatar of Sancler
Sancler

Jens

You're right.  I hadn't read down in the link past Chaosian's suggestion that had the blue header (and I took, without actually reading, to be the Accepted Answer) but which was still talking about using DataGridView.Rows.InsertAt.  That won't work.  

But having gone back to the link, I see there was more.  It did fail, and you changed it to DataTable.Rows.InsertAt.  I agree that will work.  And that that, rather than Chaosian's proposal, was the Accepted Answer.

Sorry ;-(

Roger
Avatar of vbturbo
vbturbo
Flag of Denmark image

Roger

No problem at all. for one times sake i didn't have to swallow a camel... -:) hence you lecturing.....

Jens
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo