Solved

How to add new row in DBGrid?

Posted on 2002-07-30
3
381 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

Technology Partners: 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

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 …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

696 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