Solved

insert blank rows to datagridview

Posted on 2009-04-03
4
490 Views
Last Modified: 2012-05-06
Can someone give me some code in vb.net to insert blank rows into a datagridview?
0
Comment
Question by:ddepuemd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 300 total points
ID: 24061072
You don't say whether the DataGridView is bound or unbound. Assuming it is unbound...

' Insert a single blank row
dg.Rows.Add()

' Insert a bunch of blank rows
For i As Integer = 1 To 100
     dg.Rows.Add()
Next
0
 

Author Comment

by:ddepuemd
ID: 24061408
i tried that method and it didn't work...
0
 
LVL 21

Expert Comment

by:Craig Wagner
ID: 24061969
I just wrote a prototype form that had that very code in it and it worked fine. You'll have to be (much) more specific about your application and what you're trying to do.
0
 
LVL 48

Assisted Solution

by:jpaulino
jpaulino earned 200 total points
ID: 24067488
Does the datagridview is bound to any datasource ? If so you have to insert into a new item in the datasource and you could not use the CraigWagner solution.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP/VB email question 4 63
ASP.NET Calendar Control 5 30
ModalPopup  question 22 39
how to remove error in database 6 37
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question