Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
How / When to refresh a dataset/grid |
Wed, Sep 23 2015 4:13 AM | Permanent Link |
Petter Topp | From a "UserAdmin" form with a grid (bound to a dataset) I open a new form (Modal) in which user data can be entered.
Data is stored in my database using a method on the server. When the "NewUser" form is closed I return to my "UserAdmin" form, where I would like to automatically update my grid/dataset to reflect the changes (new record). What would the best approach for this be? Br Petter |
Wed, Sep 23 2015 8:40 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Petter,
<< What would the best approach for this be? >> The easiest way is to simply re-load the rows for the dataset using Database.LoadRows. If you want to save the current dataset position, just save the RowNo property, and then restore it afterward. http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TDataSet&prop=RowNo Tim Young Elevate Software www.elevatesoft.com |
Thu, Sep 24 2015 12:37 AM | Permanent Link |
Petter Topp | Hi Tim.
I have been unclear - what I'm looking for is an event that tells me that the last form was closed / insert was successful. Br Petter |
Thu, Sep 24 2015 4:54 AM | Permanent Link |
Walter Matte Tactical Business Corporation | Petter:
What I do is have a procedure in the calling form - example "DoSelectedSearch" - I pass this procedure to the form being called. The called form then executes the procedure before "close/ insert". The is similar to the MessageDlg where you pass the procedure to be called. Walter // TfrmOrganization public { Public declarations } procedure DoSelectedSearch(Sender: TObject); end; procedure TfrmOrganization.DoSelectedSearch(Sender: TObject); begin Org.Close; Org.Params.Clear; Org.Params.Add('iOrgId='+ Inttostr(frmOrgSearch.OrgId)); Database.LoadRows(org,false); end; // Clicj Search to see search Form procedure TfrmOrganization.btnSearchClick(Sender: TObject); begin frmOrgSearch.SelectedSearch := DoSelectedSearch; frmOrgSearch.ShowModal; end; //------ The Search Form ------ // TfrmOrgSearch private { Private declarations } FSelectedSearch : TNotifyEvent; public { Public declarations } OrgId : integer; property SelectedSearch : TNotifyEvent read FSelectedSearch write FSelectedSearch; end; // Click Select Button to choose the record procedure TfrmOrgSearch.btnSelectClick(Sender: TObject); begin // Find is the dataset that displays the list of records to choose from if Find.RowCount = 0 then exit; OrgId := Find.Columns['OrgId'].AsInteger; Find.Close; if Assigned(FSelectedSearch) then FSelectedSearch(nil); Close; end; |
Thu, Sep 24 2015 5:28 AM | Permanent Link |
Petter Topp | Perfect Walter, I'm still learning.
Thank you very much. Petter |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |