Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 16 Apr 2024, 21:02

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 11 Nov 2012, 01:09 
Offline

Joined: 11 Nov 2012, 00:51
Posts: 1
Backgroud:
Delphi 7 + Ehlib5.6
First delete a row:
DBGridEh1.DataSource.DataSet.Delete;
Then add a new row:
if DBGridEh1.DataSource.DataSet.Active = False then
DBGridEh1.DataSource.DataSet.Active := True;
DBGridEh1.DataSource.DataSet.Append;
DBGridEh1.DataSource.DataSet.Edit;
DBGridEh1.DataSource.DataSet.FieldByName('F1').Value := v1;
DBGridEh1.DataSource.DataSet.FieldByName('F2').Value := v2;
DBGridEh1.DataSource.DataSet.Post;
Problem:
Can't create a blank row, and modify the last row of DBGridEh1.
If delete a row, and click a cell, then add a new row, no problem.


Top
 Profile  
 
PostPosted: 11 Nov 2012, 14:51 
Offline
Администратор

Joined: 22 Dec 2011, 20:19
Posts: 335
Hello

Quote:
Can't create a blank row, and modify the last row of DBGridEh1.

In the DBGrid every row is bound to a DataSet Record.
So "Can't create a blank row" maens Can't create empty record in DataSet.
Check if your dataset allow to post record with all values is Null. I think very few DataSets support it.

Same about last row of DBGridEh1.
Last row of DBGridEh1 is a last record in the DataSet.
Use DataSet.Last to go to the last record.

Best regards
Admin

_________________
Best regards
Admin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group