Solved

How to add new row in DBGrid?

Posted on 2002-07-30
3
360 Views
Last Modified: 2008-02-01
dear experts,
     i am using DBGrid(not for database purpose) and i directly enter the datas into it.
   i want to add a new 'row' after entering the datas in the last column(automatically). how to get
this. Help me.

with luv,
princyRajan.
0
Comment
Question by:princyrajan
[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
3 Comments
 

Expert Comment

by:maheshmail_21
ID: 7187763
The best way to handle dbgrid is by using temporary table.
U add the row to the recordset and assign it to the datagrid datasource
0
 
LVL 3

Accepted Solution

by:
RodStephens earned 50 total points
ID: 7187955
You can use a DBGrid to display data in unbound mode. You need to implement the control's UnboundAddData, UnboundReadData, UnboundWriteData, and UnboundDeleteRow event handlers to let the control know how to load its data from your data structure (array or whatever).

To add a new row, add the data to your data structure and then call the DBGrid's Refresh method. For an example that shows how to do this, look at:

    http://www.vb-helper.com/HowTo/dbgrid3.zip
0
 

Author Comment

by:princyrajan
ID: 7190161
My heartful thanks to RodStephens and Mahesh.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 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