customisd dbgrid

I need to respond to a change of state in the datasource attached to my customised dbgrid. Its to make sure my inline editor is hidden when any edits are posted programmatically so I need a generic solution built into the grid rather than one for a specific instance.

The only way I've been able to think of myself is to override the datasources OnStateChange event, replacing it with my own and calling any user assigned one as part of my replacement code.

I'm not very happy with this because I think it will cause problems somewhere else at some point.

Anyone have a good way to accomplish this?

Roy Lambert
0
Roy
7/1/2014 7:24:25 AM
public.delphi.vcl.writing 510 articles. 0 followers. Follow

2 Replies
577 Views

Similar Articles

[PageSpeed] 8

Roy Lambert wrote:

> I need to respond to a change of state in the datasource attached to
> my customised dbgrid. Its to make sure my inline editor is hidden
> when any edits are posted programmatically so I need a generic
> solution built into the grid rather than one for a specific instance.
> 
> The only way I've been able to think of myself is to override the
> datasources OnStateChange event, replacing it with my own and calling
> any user assigned one as part of my replacement code.
> 
> I'm not very happy with this because I think it will cause problems
> somewhere else at some point.

Definitely.

> Anyone have a good way to accomplish this?

Override the grid's CreateDatalink method and create and return a
custom descendent of TGridDatalink. In that descendent you can override
some of the virtual methods the link class has to react to changes in
the dataset the grid is attached to.



-- 
Peter Below (TeamB)
0
Peter
7/1/2014 4:48:38 PM
Peter


>Override the grid's CreateDatalink method and create and return a
>custom descendent of TGridDatalink. In that descendent you can override
>some of the virtual methods the link class has to react to changes in
>the dataset the grid is attached to.

I don't know why but I assumed that the datalink would just be created in the grids constructor. Never even thought there would be a separate method for this. Thanks as always.

Roy Lambert
0
Roy
7/2/2014 7:35:19 AM
Reply:

Similar Artilces:

Delphi IS the VCL
Delphi IS the VCL! Oh, wait... sorry. I meant Winforms, not VCL. What was I thinking? I know! they got me too. Don't know what I was thinking. :) > {quote:title=Jay Faubion wrote:}{quote} > Delphi IS the VCL! > > Oh, wait... sorry. I meant Winforms, not VCL. > > What was I thinking? Jay Faubion wrote: > Delphi IS the VCL! > TButton Forever! ;-) W Jay Faubion wrote: > What was I thinking? Wasn't it called CLX ? Turbo Vision -> OWL -> VCL -> CLX -> Winforms -> ...... (to be continued) -- ...

Text.Write speed
Hi ! I have speed troubles for using Text.Write method in Delphi 2006, particularly with distant files (local network). For example, with the following code ("F" is a text file ; "Line" is an about 200-character string): ----- AssignFile(F, FileName); try Rewrite(F); for l := 1 to 100 do begin for c := 1 to Length(Line) do Write(F, Line[c]); Writeln(F); end; finally CloseFile(F); end; ----- On a distant file: Delphi 5 -> 0.08 seconds Delphi 2006 -> close to 8 seconds Is there a speci...

Delphi + DBGrid / DBView
All, we use Delphi 4.0 and search a fast component to view/edit a ASA 6.0.2 DB table with 50.000 records. The "DBGrid" must be differ between colum entry and DBGrid. Example: DB Table "SparePart": DBGrid: Name Type Screw S Screw Spare Part Engine A Engine Assembly Thanks J�rg Peters Are you using BDE? If not, then what? This is important because "fast searching" depends on whether you are client-side caching or server-side. If server-side cu...

How to write this code in delphi
How can I write the below operation in Delphi? I thought about something like (2x5)^3 but it is not. (2 x 5)3 // is the same of 10 x 10 x10 = 1000 Thanks CB Cid Benac wrote: > How can I write the below operation in Delphi? I thought about > something like (2x5)^3 but it is not. > > (2 x 5)3 // is the same of 10 x 10 x10 = 1000 > > Thanks > > CB There is no operator for power, and the operator for multiplication is *. There is a library function that can do powers though, in unit Math: x := Power(2 * 5, 3); I guess IntPo...

Profiler for Delphi VCL
Hello, i still use D7 :-)) i have a big application with a lot of forms and on some forms are hundreds of objects. The forms are loaded at runtime when they will be needed the first time. One of this big forms needed normaly around 3 seconds to open, suddenly it needs more than 20 seconds. Other (also big) forms in this app are still as fast as always. I can't find out what had changed, because this time is used between the Application.CreateForm() call and the entry in the create-event of the created form. Any ideas how i can find out what wastes the time? I think i need some...

Transparent DBGrid for Delphi
Can anyone here help me with a transparent DBGrid? The first thread got no replies, or is this not the correct forum to target. Maybe I should try some other forums. Any good forums out there? vcl.components.using would be a better group. or perhaps the 3rd party group if the standard DBgrid can't do what you want. <Sihaam Kiraam> wrote in message news:146846@forums.codegear.com... > Can anyone here help me with a transparent DBGrid? The first thread got no replies, or is this not the correct forum to target. Maybe I should try some other forums. Any good forums out th...

Delphi + DBGrid / DBView #2
All, we use Delphi 4.0 and search a fast component to view/edit a ASA 6.0.2 DB table with 50.000 records. The "DBGrid" must be differ between colum entry and DBGrid. Example: DB Table "SparePart": DBGrid: Name Type Screw S Screw Spare Part Engine A Engine Assembly Thanks J�rg Peters ...

Nice Delphi VCL App
https://plus.google.com/u/0/+LarsFosdal/posts/JSNDFmtNhM3?cfem=1 -- Nick Delphi Programming is Fun Nick Hodges wrote: > https://plus.google.com/u/0/+LarsFosdal/posts/JSNDFmtNhM3?cfem=1 Very well designed, indeed. -- Rudy Velthuis (TeamB) http://www.teamb.com "When I told the people of Northern Ireland that I was an atheist, a woman in the audience stood up and said, 'Yes, but is it the God of the Catholics or the God of the Protestants in whom you don't believe?" -- Quentin Crisp. On 14/05/14 15:04, Nick Hodges wrote: > https://plus.go...

Delphi DLL That Writes to File
Hey ho! First, I'd like to apologize if i'm posting on the wrong forum, but my brains are starting to fall out from my ears. I'm a Delphi programmer and currently i'm working on a DLL. In very few words, my DLL is using an TIdTCPClient to connect to a Server Application, sends some requests and receives the answers. All the communication is set up by exported functions, so the Client Application that uses the DLL, calls the functions and retrieves the Server's answers. Since the communication is done by strings, i've set all the outgoing and incoming messages on th...

XE3 Delphi VCL and DataModules
VM with Windows 7 and XE3. Many 3rd party components. When I tried to create a new DataModule to add to the project, the IDE crashes. Has this happened to others? Fault Module Version: 17.0.4625.53395 Fault Module Timestamp: 50400227 Exception Code: c0000005 Exception Offset: 00016f36 OS Version: 6.1.7601.2.1.0.256.4 Locale ID: 1033 Additional Information 1: 8df4 Additional Information 2: 8df4e92201aa034aa9797467e9f342c8 Additional Information 3: 1c84 Additional Information 4: 1c8452195d96ca947ca02660f30e029c Problem signature: Problem Event Name: AP...

FastReport VCL for Delphi XE7
Hello everyone, Where can I download a proper version of FastReport VCL for Delphi XE7 Professional? Thanks Vladimir > {quote:title=Vladimir Nelenson wrote:}{quote} > Hello everyone, > Where can I download a proper version of FastReport VCL for Delphi XE7 Professional? > Thanks > Vladimir FR Trial here: http://www.fast-report.com/en/download/fast-report-vcl-5/ Registered users can download FR 5.1.7 with XE7 support here: http://cp.fast-report.com > FR Trial here: http://www.fast-report.com/en/download/fast-report-vcl-5/ > Registered users can download FR 5....

Delphi VCL Memory Leak?
I am dealing with a slow memory leak that causes a massive program to fail after more than a week running. So I started a leak hunt by stripping down the app to the first self written unit and checking. Low and Behold, it leaked. So I started with just a bare bones App - frame only, and it Leaked. I have duplicated it on Delphi 6 and on Borland Developer Studio 2006. Start with a new VCL app. Add nothing, but compile and run. Now Ctrl-alt-Del and set up to watch the memory of your empty app with out overl apping the app screen. Now click on your app and watch the memory size grow with every c...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

DBGrid : VCL + Styles or FM ?
Hello I have a project with a lot of DBGrids, sometimes with a large number of rows (+/- 100 000). As I want to have 'style' function for my project I want to know the best way for it : 1/ VCL + DBGrid 2/ VCL + StringGrid + LiveBindings 3/ FM + StringGrid + LiveBindings 4/ 3rd party library (TMS/ XFiles...) What is, for you the best choice ? And why ? > I have a project with a lot of DBGrids, sometimes with a large number of rows (+/- 100 000). Can you users read and handle as much rows? :-) If you really like/need to load as much (intead of delivering what'...

Web resources about - customisd dbgrid - public.delphi.vcl.writing

Resources last updated: 12/23/2015 11:40:31 AM