Solved

How to add new row in DBGrid?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now