Jump to content


Photo

Need to obtain the cell that is dropped on.

drag drop cells

  • Please log in to reply
19 replies to this topic

#1 lsquez

lsquez
  • Members
  • 18 posts

Posted 22 May 2017 - 01:35 AM

In v5 there was a GetCellAtPos function. I can't find anything similar in the latest version. I need to control the dragging and dropping of cells.

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 22 May 2017 - 05:35 PM

Hi,

It's inside view now:

NextGrid61.ActiveView.GetCellAtPos

or if you have NxReportGridView61.GetCellAtPos

Maybe I can map property in TNextGrid6 class to.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 lsquez

lsquez
  • Members
  • 18 posts

Posted 23 May 2017 - 03:00 AM

That worked. I am looking at the native dragdrop within the NextGrid61. It works better, but I would have a lot of code to rewrite on my end.

 

The only problem I am running into is if a column has a NxButtonEdit control assigned as the inplace editor, the dropped row exhibits a painting issue. The content in the row is not written correctly. A refresh of the NxGrid61 fixes it, but I don't see any way to refresh the grid when the drop is finished.

 

Any ideas?



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 May 2017 - 07:16 AM

Hi,

Can you write me mini demo project so I can test it to?
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 lsquez

lsquez
  • Members
  • 18 posts

Posted 23 May 2017 - 07:17 AM

Also, is there any documentation on how the validator works? I need to validate input before it gets written to the control or grid. Currently if a user types a number on a row that is not allowed, that number will initially appear in a NxButtonEdit.



#6 lsquez

lsquez
  • Members
  • 18 posts

Posted 23 May 2017 - 07:25 AM

Sure, I sent it to the support email.



#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 May 2017 - 07:26 AM

Hi,

I suggesting following page and diagram:
http://developer.ber...=683&lang=en-us

OnAcceptEdit is probably what you need (in the middle of page above)
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#8 lsquez

lsquez
  • Members
  • 18 posts

Posted 23 May 2017 - 07:26 AM

Same subject line as the forum topic.



#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 May 2017 - 07:34 AM

Thank you, received.

I hope that I will have an answer today.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#10 lsquez

lsquez
  • Members
  • 18 posts

Posted 23 May 2017 - 08:19 AM

So the link you sent me helps a lot. Unfortunately I was not able to find that link initially.

 

I have been able to narrow it down to the inplace control itself. Even with the code below, the NxButtonEdit will still display the first key pressed. But only when moving with arrow keys between cells.

 

I can at least lock the 'CanLeave' preventing the value from being entered. I would like it to not display anything and not allow key entry. I am also manually validating the 'key' entry to prevent keystrokes that are not valid.

 

This is a 20+ year old program that I am attempting to update. Unfortunately the original grid vendor is no longer available and I need to update for newer versions of Windows. I already have 20+ hours invested in re-coding for this control. If all works well, I will be purchasing full support. I don't want to loose support again.

 

procedure TfrmMain.Grid1AcceptEdit(Sender: TObject; ACol, ARow: Integer;
  var Text: WideString; var Accept, CanLeave: Boolean);
begin

  If NOT rType[ARow] then {this array controls the type of row it is, number or a text/information}{not = it is not a number row}
  begin
      Accept := False; {does not appear to do anything}
      CanLeave := False; {works and prevents moving with invalid data}
      Text := ''; {does not pass back to the grid}
  end;

end;



#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 May 2017 - 08:43 AM

Hi,

For edit events, I suggest demo project in:

..\Next Suite 6\Demos\Next Grid\Delphi XE6\Edit Events

I think it will help you.

Accept when set to False, it tells grid to reject update. For example if you set CanLeave to True, but still don't want to accept change.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#12 lsquez

lsquez
  • Members
  • 18 posts

Posted 24 May 2017 - 04:19 AM

Turns out I needed the ‘NxGrid6BeforeEdit’ to capture the event. Thanks.

 

One further issue, I’ve been testing the events on the NxButtonEdit6. It appears that the enter key CHR(13) is not responded to by any events. Is this true? Is there any way to respond to it? Basically I need when the enter key is pressed on the control for it to write the contents to the grid and allow other code to be executed. Right now it writes the contents, but I have to hit enter a second time (NxGrid6KeyPress event) for any other code to execute.

 

I’ve tested capturing other keystrokes in the NxGridButton6ButtonKeyPress event and they allow code to be executed, just not the enter key.

 

Thanks,



#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 24 May 2017 - 08:08 AM

Hi,

I think that I'll need to add WantReturn property (similar to ones I use in other places). I will add it in day or two.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 26 May 2017 - 07:54 PM

Hi,

I have added WantReturns property to all TNxEdit6 descendants. It will be included in next update. If you need it now, I can send you updated files.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#15 lsquez

lsquez
  • Members
  • 18 posts

Posted 27 May 2017 - 06:15 AM

That would be great. I am planning on coding all this weekend. It would be nice to put that issue to bed. As for the grid painting issue after a row drag with an inplace edit. Have you had a chance to look at the code I sent?

 

Thanks,



#16 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 27 May 2017 - 11:59 AM

Hi,

I have uploaded new update. It contain this 2 fixes. Refresh problem is not fully optimized, but maybe it will fit well until I find better solution.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#17 lsquez

lsquez
  • Members
  • 18 posts

Posted 05 June 2017 - 05:10 AM

I've been able to resolve all my issues with the TNextGrid.OnAfterEdit and the TNextGrid.OnBeforeEdit events.

 

Question. Is the intern update only available for purchased users? I don't see the download on the main site.

 

Is it possible to have an event for the completion of the internal row drag-drop completion? Not only would a TNextGrid.Refresh work there but I could also respond to any changes that would affect calculations.

 

Also, I sent you a question on the source code purchase to support@bergsoft.net. I referenced this thread.

 

Thanks,



#18 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 05 June 2017 - 01:39 PM

Hi,

Yes, I update source more often than free version (for example after quick fix).

There is OnRowMoveDrop event in NxReportGridView. Maybe this is what you need?
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#19 lsquez

lsquez
  • Members
  • 18 posts

Posted 06 June 2017 - 02:24 AM

Thanks for the information. I attempted to use the event an it generated the following error...

 

[Error] MAIN.PAS(533): Undeclared identifier: 'INxRow'

 

procedure TfrmMain.NxReportGridView61RowMoveDrop(Sender: TObject; Row,
  ParentRow: INxRow; CurIndex, NewIndex: Integer);



#20 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 06 June 2017 - 10:45 PM

Hi,

You can find this interface in NxCells6 unit. Just add it to uses in interface section.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users