🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.winforms.controls.using
Article #233

Re: 3rd party .NET based control import in VCL.NET

#233
From: Arie Zilberstein
Date: Thu, 03 Aug 2006 11:58
91 lines
5364 bytes
Hi Jitender,


"Jitender" <jitender.mahinderkar@ge.com> wrote in message 
news:44cf60fe$1@newsgroups.borland.com...
>
> Rather than generalities, I will ask very specific's behind the question 
> that I have raised:
>
> The advantage I thought I will get using Essential Grid/XtraGrid (.NET 
> based control imported in VCL.NET) is that I will move to .NET (C#) easily 
> at later stage from the intermediate VCL.NET build.

This advantage is real. I suggest that you consider going to C# right now 
instead of VCL.NET. This means that you'll program the form hosting the 
XtraGrid as a WinForms form. After compiling the C# code into an assembly, 
you can reference this assembly from Delphi.NET and display this form 
straight away, even if it's not a VCL.NET control.

You only need the Winforms Control Import Wizard if you need to host a 
Winforms control inside a VCL.NET TForm (or TControl). If your entire form 
is in WinForms, you don't need the wizard.

> Question 1:
> I don't see any control specific properties of 3rd party .NET controls 
> such as Xtragrid/EssentialGrid whereas I can able to see only properties 
> that are usually visible for all the controls in Delphi 2006 say 
> standard/Win32 etc. delphi controls.

After invoking the wizard, you end up with a class such as TImpXtraGrid. 
This class exposes a public property Control. You can acquire this Control, 
cast it into the actual type, XtraGrid in this case, and from there you have 
full access to all its properties, methods, events and fields.

> Question 2:
> The vendor confirmed that designer (XtraGrid Design-time-Xtragrid 
> designer, Level Designer and Band and Columns customization design-time) 
> feature are not implementable in VCL.NET as they have built it 
> specifically for VS.NET platform. I have asked the vendor to explain why 
> it is not possible in runtime.
> EssentialGrid also has design-time feature such as Gridboundcolumn editor 
> to add columns and configure each column properties individually with 
> StyleInfo. But I am not able to create the equivalent code of VS.NET (C#) 
> for this functionality in VCL.NET.

It's true; you lose almost all design-time support. But all the designer 
does it injects code into the InitializeComponent() method of the Winforms 
class. So what I usually do is, design the control using C#, then look at 
the resulting code in InitializeComponent, and translate it into Delphi. I 
find it hard to believe that there are things that you can do only in 
design-time, but not in run-time.


> Question 3:
> I get an error when I assign Datasource property of Essential grid with a 
> Datasource (TDatasource- with ADOConnection and ADODataset or ADODB) on 
> Delphi VCL.NET form(nfm file). The exception message is 
> "BadDataSourceForComplexBinding".
>
> Whereas for VCL.NET based DBgrid control/data-aware controls the 
> datasource is working fine.

Yes, all WinForms controls expect a DataSet and you can't give them a 
TDataSet. You must convert the TDataSet into a DataSet for this to work, or 
just to work with a DataSet instead. You can use the TADONETConnector class 
to encapsulate a DataSet into a TDataSet. I don't know how to do it easily 
the other way around.

>
> Question 4:
> The controls that I would like to know whether works in VCL.NET are 
> Xtragrid control and Essential Grid control.
>
> I am sure there are some light weight Winform .NET controls works in 
> VCL.NET using this wizard.
>
> Basically, both XtraGrid & Essential Grid is targetted for .NET (C#.NET) 
> development and it is working fine.
>
> Am I still going in right direction which is technically feasible or do 
> you think I have to use specific Grid for VCL.NET i.e. ExpressQuantumGrid 
> and target for C# based Grid (Essential Grid/XtraGrid) control at later 
> stage of development.

As I said, using WinForms controls in VCL.NET can be done, but it involves a 
non-trivial amount of custom conversions, workarounds, translations and 
time. If you can't afford it, my advice is:  either (a) stick to VCL.NET 
controls, or (b) use WinForms controls only with C# Winforms projects.

Hope that helps,
Arie 
Technical Details
Message-ID: <44d1e4d7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44c9c986$1@newsgroups.borland.com> <44cc5121@newsgroups.borland.com> <44cdff12$1@newsgroups.borland.com> <44cf018b$1@newsgroups.borland.com> <44cf3547$1@newsgroups.borland.com> <44cf60fe$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1eff29,bf4ef7cd68d26c8e
X-Google-Attributes: gid1eff29,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Arie Zilberstein" <azilberstein@mercury.com>
Newsgroups: borland.public.delphi.winforms.controls.using
References: <44c9c986$1@newsgroups.borland.com> <44cc5121@newsgroups.borland.com> <44cdff12$1@newsgroups.borland.com> <44cf018b$1@newsgroups.borland.com> <44cf3547$1@newsgroups.borland.com> <44cf60fe$1@newsgroups.borland.com>
Subject: Re: 3rd party .NET based control import in VCL.NET
Date: Thu, 3 Aug 2006 14:58:15 +0300
Lines: 93
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: 192.118.45.2
Message-ID: <44d1e4d7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1154606295 192.118.45.2 (3 Aug 2006 04:58:15 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail