Solved

How to add new row in DBGrid?

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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 …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

734 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