Search the Community
Showing results for tags 'refresh'.
Found 2 results
-
Hello Everyone, I'm working on an old XE7 project and have come across an issue with TDBGrid. Basically, when you refresh the underlying table with one or more grid rows selected, all rows get selected. Interestingly, the CurrentlySelectedRow does remain the same. Has anyone heard of this before? If so, have you been able to fix it? I can't seem to find anything on it and it's driving me crazy! LOL TDBGrid All table fields are defined as grid columns dgMultiSelect is true Underlying table has a TLargeIntField unique & autoinc key field TForm The form has only two methods, OnCreate and OnDestroy to open and close the query I've attached a video of the behavior to clarify the issue. Thanks for any insight you can provide... John TDBGrid selectedrows refresh issue.mp4
-
- tdbgrid
- selectedrecords
-
(and 1 more)
Tagged with:
-
Long story short: How can I refresh a dbedit box with data from a table I have just inserted data into? Long story long: My sql table and UI has fields for PresentationID, DesignID, StockID plus 5 other initially blank fields. With no input from the user I populate the PresentationID, DesignID, StockID fields in the database using values gotten from elsewhere in the application, the 5 fields are populated with null because they are not included in the insert (see code below). If I did include them they would be null anyway since I don't enter data into them until after the row is inserted with the 3 values. After I insert values into the database using the code below I am able to enter text in the other 5 fields or update the 3 fields but when I click on another tab in the application, and leave the tab I am on, the code written elsewhere that posts the data kicks in and attempts to update the database with the values any of the 8 fields. At that point I get the following Cannot insert the value NULL into column 'Presentation', table 'AdiMS2.dbo.ValuePackLinks'; column does not allow nulls. INSERT fails. because the application doesn't recognize the values just inserted for PresentationID, DesignID, StockID. If I leave the app and come back in the 3 fields are populated with data and the post works just fine with values from the 8 fields. How can I refresh a dbedit box with data from a table I have just inserted data into so that I can immediately start editing and not have to leave the app? Does that make sense? Thank you! PresentationID := dm.tb_dm_presentation_design_links.fieldbyname('presentation').asstring; DesignID := dm.tb_design_master.fieldbyname('design_id').asstring; StockID := dm.tb_design_master.fieldbyname('jmc_stock_num').asstring; q_InsValuePackLinks.SQL.Add ('insert into ValuePackLinks '); q_InsValuePackLinks.SQL.Add ('(Presentation,Design_id,Stock_pack)'); q_InsValuePackLinks.SQL.Add ('VALUES('+Quotedstr(PresentationID)+','+Quotedstr(DesignID)+','+Quotedstr(StockID)+')'); q_InsValuePackLinks.ExecSQL ;