Forum
Sign Up

How to add a row to the grid

9 years 2 months ago #1 by Orren
In the add row example it shows that there is some id field that is auto generated. How can you add a row in the grid if there is no id field? We get an error saying a particular field must have a value and theData provider is invalid.

How do we add a row for editing?

Thanks!

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #2 by Developer Machines
You can't add row to the grid directly. You have to add row to the DataSet via DataSet.Add; DataSet.Post; sequence. Other way is to get TFireModelAbstract reference from the grid view VIew.GetModel: TFireModelAbstract; and then use this routine:
TFireModelAbstract.InsertRow(Row: Integer; const Parent: TModelIndex): Boolean; //It will invoke the right features in the dataset.

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #3 by Orren
Replied by Orren on topic How to add a row to the grid
The idea is that we would have a blank row to enter into. If I do :
dataset.append;
the row doesnt appear

If I do
dataset.append;
<fill the row>
dataset.post;

The row does appear - but we do not know at this point what to fill it with.

If I do
dataset.append;
dataset.post;
it violates the field constraints of the dataset - certain fields require data.

How is the component designed to handle new empty rows to be entered?

Thanks!

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.122 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )