451

(9 replies, posted in General)

Hi Dmitry,


Thank you very much..............
Truly appreciated....................


Could you possibly let me have the code to replicate pressing keyboard ENTER key please.
In this case, I like to use it for save grid button.


Derek's workaround is nice but if user clicks on SAVE GRID button after entering a row of data, it doesn't commit the entered row data, unless user press on ENTER key on keyboard or clicks on somewhere on editable grid (except first row)

452

(9 replies, posted in General)

Hi Derek,


Thank you very much for the workaround...................
Truly appreciated...........................


I hit another wall that I couldn't go through, dig under or jump over.


My intention was to use editable grid as a part of the record details. For example we have contacts (people), when adding / editing contact I was planning to add their phone numbers using editable grid rather than many fields. However, I couldn't connect editable grid data to selected contact so that editable grid on frmPeople shows only edited person's phone numbers not all (When editing)
On Form1, non editable grid shows the phone numbers of only selected person from TableGrid1 in this case.


Please see the attached sample project below:

453

(3 replies, posted in General)

Hi EHW,


Thank you very much.............
Truly appreciated...................

454

(9 replies, posted in General)

I have an editable tGrid on a form with save button.


Is it possible to have a separate "Save" button for editable tGrid only so that users can see they need to save entered tGrid data before clicking on the form save button?
Currently, if user clicks on form save button while grid edit line in edit mode data is not saved.


I understand that editable tGrid saves entered data automatically by clicking on other parts of the tGrid or pressing enter/return key on keyboard (if there is no save button with closeon the form.)

455

(3 replies, posted in General)

Looks like EHW or Derek are not available to offer their kind help for this matter at present days.


Dmitry, is the solution I'm seeking on my previous post not clear? If so, I'll attempt to illustrate again.

456

(3 replies, posted in General)

https://i.imgur.com/Eg44g6J.png


I like to display inv DBCR reference on column labeled with asterisk. In this case (purchase inv refunds) Db.


When a purchase refund invoice/s issued against a purchase inv, Db text is displayed under asterisk column for the purchase inv with refund/s.
If purchase refund/s (there can be more than one purch refund for same purch inv, issued at different dates or products) deleted from purch refund tGrid then Db text is cleared from relevant purch inv record on purch inv tGrid.


Solutions were provided by Derek and EHW for different structure but I couldn't apply them in this case, where I'm using different tables and forms.


Please see the attached sample project below:

Hi Derek,


Thank you very much.......


It'll certainly be useful in different circumstances but in this case disabling just close button needed as minimize and restore buttons will be used.


Hopefully Dmitry will give us the solution.

Is it possible to disable or hide win form close (x) button, referred as border icons on MVD?


https://s1.postimg.org/6xd0i7gjhb/zzzzz_Temp66.png


If it's not possible, what's the syntax for it so that I can refer to it with sql such as;

SQLExecute('DELETE FROM PI WHERE id='+IntToStr(frmPI.CloseButton.dbGeneralTableId));

I tried CloseButton but it didn't work.

459

(5 replies, posted in General)

Thank you very much Dmitry..........................
Truly appreciated.................................

460

(5 replies, posted in General)

In order to avoid sorting issue (when both tGrids are not sorted in the same sequence) I have added a line to Derek's one but didn't work:

procedure frmProduct_OnShow (Sender: string; Action: string);
begin
  frmproduct.tgprodproducts.selectedRow := form1.tgmainprod.selectedrow; // Derek
  frmproduct.tgprodproducts.sortedColumn := form1.tgmainprod.sortedColumn;
end;

Perhaps it needs record ID or rowID added but I cannot construct it correctly

procedure frmProduct_OnShow (Sender: string; Action: string);
begin
  frmproduct.tgprodproducts.selectedRow + RecodID := form1.tgmainprod.selectedrow + RecodID ; 
end;

Dmitry, could you please help?
Please see post #1 on this thread/topic

461

(5 replies, posted in General)

Hi Derek,


Thank you very much.....


I haven't seen you around here for few days. I hope all things are OK at your end.


I was wandering if it is possible to do it by using something unique such as code column or record ID, in order to avoid the issue when each table is sorted differently as you mentioned?

462

(5 replies, posted in General)

https://s1.postimg.org/4t0wpbpm7z/zzzzz_Temp65.png


As illustrated on the image above;
Same products tGrid on FORM1 used on frmProducts with less fields.
On click of edit button (ShowRecord) I like it to focus on selected row as in FORM1 tGrid on frmProducts tGrid too. In this case "Door Bell" row.
Is this possible, if so how.


Please see the attached sample project if needed

463

(2 replies, posted in General)

Hi Dmitry,


Thank you very much............
Truly appreciated........................


One more question...
How can I place a horizontal line between desired menu items - like on default popup menu items?


=============
EDIT:
I found the following solution for horizontal menu item separator

MyItem := TMenuItem.Create (PopupMenu);
MyItem.Caption := '-';
PopupMenu.Items.Add(MyItem);

464

(2 replies, posted in General)

I wanted to have more user friendly tGrid right click popup menu.


I did the visuals but need the code behind buttons so that they can function. I know all this functions are already in MVD but I like to customize the tGrid right click menu also want to add cell copying to popup menu, instead of explaining users that they need to ctrl+mouse click to copy a cell.


Hopefully, Dmitry can provide the code.
If anybody else can, please do so.


Please see the sample project attached below:

465

(3 replies, posted in General)

Hi EHW,


Thank you very much for the help................


I was trying to add that literal between sqlexecute lines due to lack of proper understanding at my end.

466

(3 replies, posted in General)

The following seems to be almost working:


procedure Form1_Button7_OnClick (Sender, v1, v2, v3: string; var Cancel: boolean);
begin
  v1 := 'https://www.google.com/maps/?q=' ;
  v2 := sqlexecute('select street from people where id = ' + inttostr(form1.tablegrid1.dbitemid)); // Searching for street (1 OXBOW CL)
  v3 := sqlexecute('select postcode from people where id = ' + inttostr(form1.tablegrid1.dbitemid)); // Searching for post code (NG2 2NN)
  openurl(v1+v2+v3);
end;

However, I couldn't get search query displayed on Google maps search box correctly.
It's displayed as: 1 OXBOW CLNG2 2NN
It needs to send search query as: 1 OXBOW CL, NG2 2NN


Tried various things but couldn't get it to include comma and space after street  in search query. Please help....

467

(3 replies, posted in General)

Using Derek's contacts app for Google maps search.

It uses search by postal / zip code and works fine.
I wanted to add address to search to locate street  too beside postal code as some parts of the world there may not be established postal codes.
I have tried the following but couldn't get the syntax right.
Could somebody correct it please?


procedure Form1_Button7_OnClick (Sender, v1, v2: string; var Cancel: boolean);  //** check on google maps
begin
  v1 := 'https://www.google.com/maps/?q=' ;
  v2 := (sqlexecute('select street from people where id = ' + inttostr(form1.tablegrid1.dbitemid)))
  and
  (sqlexecute('select postcode from people where id = ' + inttostr(form1.tablegrid1.dbitemid)));
  openurl(v1+v2);
end;

468

(7 replies, posted in General)

Bullet3203 wrote:

maybe it will solve the problem of changing the height of the slides?

procedure Form1_GridSearch_OnChange (Sender: string);
begin
Form1.GridSearch.SlideSize := 150; // height of slides
end;

Thanks Bullet3203...
Notes field is a memo text field. Text length will wary. Therefore increasing slide size will not solve the issue.


Best solution I can think of atm is to limit text display for notes on slide tGrid (not on actual notes entry form) by specifying maximum characters to be displayed.


Hopefully Dmitry can offer a solution.

469

(7 replies, posted in General)

Is it possible to have a bottom spacing on slide tGrid cells?


https://s26.postimg.org/47bcpajah/zzzzz_Temp60.png


As it can be seen on the image above, when content of notes field takes more space than specified height, it looks ugly.


I have tried adding bottom spacing with:

Form1.GridSearch.Columns[7].SlideBounds.Bottom := 16;

but didn't work, I guess there is no bottom function on tGrid or I'm applying it incorrectly


Tried with line spacing below but it didn't work too:

procedure gridSearchOnChange03;
var i, c: integer;
begin
for i := 0 to c do
  begin
    c := Form1.GridSearch.Columns.Count - 1;
    Form1.GridSearch.Cells[7,i] := Form1.GridSearch.Cells[0,i]+#10#13;
    Form1.GridSearch.BestFitRow(i);
  end;
end;

Could there be another approach by way of specifying maximum character count display on a specified tGrid cell? If so how?

470

(7 replies, posted in General)

Hi Dmitry,


Thank you very much for the updated MVD and sample project..........


I have tried to add image field to the slide grid but failed?


--------------------------------------------------------------
EDIT:
Done, I was missing calculated photo field on person table.
https://i.imgur.com/8BUhBec.png


It's bit of a riddle getting field coordinates correct. It'd be nice to have next grid visual editor within mvd so that we can just visually drop, resize and move them on grid as needed.

471

(9 replies, posted in General)

I'm not sure if it's a bug or I'm missing something. Compiled using MVD 3.5


Please see the screen caps below:


https://s26.postimg.org/js0z06lgp/zzzzz_Temp57.png


Settings of the tGrid above:
https://s26.postimg.org/hbz5mc3e1/zzzzz_Temp58.png

472

(7 replies, posted in General)

prahousefamily wrote:

In   MVD  TableGrid  have class GridStyle : GsSlides

how to edit and show slide in tablegrid

http://dn.bergsoft.net/res/uploads/nextgrid-slide-style-tutorial/slides_sample.gif
Reference
http://dn.bergsoft.net/nextgrid-slide-s … torial.htm


Thanks for the post prahousefamily...
It's nice but is it possible in MVD?

473

(9 replies, posted in General)

Hi EHW,


Thank you very much for much more cleaner version.............................


I wanted prevent removing sale invoice with refund (Cr) using a message dialog as follows:

procedure Form1_btnSaleDelete_OnClick (Sender: string; var Cancel: boolean);
begin
If (Form1.tgMainSaleInvs.Cells[1,Form1.tgMainSaleInvs.SelectedRow] = '') and
   (MessageBox('Are you sure you want to remove the selected sale','Confirm',MB_YESNO+MB_ICONQUESTION) = IDYES) then
   Begin
   SqlExecute('Update Invoice Set DBCRValue = "Purchase", Counter1 = "", SIPrice = 0 Where id = ' + Form1.tgMainSaleInvs.sqlValue);
   Form1.tgMainPurchInvs.dbUpdate;
   Form1.tgMainSaleInvs.dbUpdate;
   Exit;
   End;

   If Form1.tgMainSaleInvs.Cells[1,Form1.tgMainSaleInvs.SelectedRow] = 'Cr' then
   begin
   Cancel := true;
   MessageDlg ('Sale Invoice with Refund cannot be removed.',mtInformation,MB_OK,0);
   end;
end;

It seems to be working but not so sure it's the correct way of doing it tho...

474

(9 replies, posted in General)

Hi EHW,


I did something using inv type DBCR value and it seems to be working excluding certain points I may have missed. However, I think it's bit messy. Most likely there is cleaner and simpler way to do it.


- Added "Convert to Purchase Invoice" btn (marked on properties as visible false) on frmInvoice under sale tab for changing DBCR value to Porvhase. Extra DBCR value field just for visual effect where I may hide actual DBCR field.  "Convert to Purchase Invoice" btn and additional filed with Clear btn visible only on edit of a sale inv
- Disabled  "Convert to Purchase Invoice" btn when sale inv with Cr (Refund) to be edited.
- It wasn't clearing customer details when purchase inv converted to sale then converted back to purchase and converting to sale inv again. So I added clear fields lines under invOnShow event


Please see the attached sample project:

475

(9 replies, posted in General)

Hi again EHW,


I wanted to apply on sale invoice delete moving record back to purchase inv tGrid for 1 table (sale and purchase) Invoice table and 1 form(sale and purchase) frmInvoice version.
Tried following but no success:

procedure Form1_btnSaleDelete_OnAfterClick (Sender: string);
begin
  frmInvoice.cbInvoiceDBCR.Text := 'Purchase';
  frmInvoice.edDBCR.Text := 'Purchase';
  Form1.tgMainPurchInvs.dbUpdate;
end;

On filters front I couldn't think of adding anything to existing one:

Invoice.DBCRvalue= "Purchase"