Solved

How to add new row in DBGrid?

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

831 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