Jump to content
Software FX Community

How to customize subcommands in C#


User (Legacy)

Recommended Posts

Hi,

I'm using ChartFx 5.5 in C#. I'm trying to remove few chart types in gallery

tool button. But I couldn't succeed from this code.

ChartfxLib.ChartFXClass oChart = new ChartfxLib.ChartFXClass();

SfxBar.CommandBar oCmdBar = oChart.Commands;

But oCmdBar doesn't expose FindSubCommandID and RemoveSubCommand methods as

in ASP sample code

(http://support.softwarefx.com/Samples/CfxIE/UserInterface/Commands.asp).

Should I do it in different approach?

Thanks for Ur help in advance.

-Venkat

Link to comment
Share on other sites

CommandBar doesn't expose this methods, this methods are exposed by the

Command class. I you look at the code in the ASP sample:

Set GalleryList = chart.Commands(CFX_ID_GALLERY)

nIndex = GalleryList.FindSubCommandID(CFX_ID_CONTOUR)

GalleryList.RemoveSubCommand(nIndex)

nIndex = GalleryList.FindSubCommandID(CFX_ID_SURFACE)

GalleryList.RemoveSubCommand(nIndex)

Notice that FindSubCommandID is called on a Command obtained by doing

chart.Commands(CFX_ID_GALLERY) not just chart.Commands.

I do not have a sample that does this in C#, all of our C# samples use Chart

FX for .NET.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

I do aggree with U. I got this sample in ASP as mentioned thru a link in

previous thread.

In C#,

1. chart.Commands returns SfxBar.CommandBar object. But SfxBar.CommandBar

does not expose FindSubCommandID and RemoveSubCommand methods.

2. SfxBar namespace does not expose Command class.

3. chart.Commands is a read only property w/o any i/p parameters.

If U have some time, could U give me the sample for this?

Thanks for Ur help.

-Venkat

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:eGsnE22uDHA.3512@WEBSERVER1...

> CommandBar doesn't expose this methods, this methods are exposed by the

> Command class. I you look at the code in the ASP sample:

>

>

> Set GalleryList = chart.Commands(CFX_ID_GALLERY)

> nIndex = GalleryList.FindSubCommandID(CFX_ID_CONTOUR)

> GalleryList.RemoveSubCommand(nIndex)

> nIndex = GalleryList.FindSubCommandID(CFX_ID_SURFACE)

> GalleryList.RemoveSubCommand(nIndex)

>

> Notice that FindSubCommandID is called on a Command obtained by doing

> chart.Commands(CFX_ID_GALLERY) not just chart.Commands.

>

> I do not have a sample that does this in C#, all of our C# samples use

Chart

> FX for .NET.

>

>

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

You are missing the indexer. The ASP code is chart.Commands(CFX_ID_GALLERY).

chart.Commands does return a ComandBar object,

chart.Commands(CFX_ID_GALLERY) return a Command object.

It doesn't matter where you use it from (ASP or C#) the properties return

the same, it is just the syntax that changes.

As I said before I do not have a sample in C#, and I don't the syntax for

obtaining an Array Property, but it might be something like:

oCmdBar[index]

or

oCmdBar.Item[index]

All of the C# code I have is for Chart FX for .NET. Have you though of

upgrading ? It will make your life much easier if you use a component

designed for the .NET framework instead of a COM component.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

I had tried this, before posting this problem. I couldn't get compiled the

code.

1. Ideally, oChart.Commands(ChartfxLib.CfxToolID.CFX_ID_GALLERY) should

return command object. But it doesn't. Then I tried like this:

object oMyCmd = oChart.Commands(ChartfxLib.CfxToolID.CFX_ID_GALLERY);

Then I got this compilation error: 'ChartfxLib.ChartFXClass.Commands'

denotes a 'property' where a 'method' was expected.

2. Let's assume the above statement returns command object. Somewhere (in

any namespace) command class should be available so that I could make an

instance of that to use the above statement.

Reg .NET ver, we thought the same as U. Then we evaluated the trial version.

We had an imperession that loading the chart control (on client side) is

slow compared to 5.5 version. Do U agree w/ this? If so, is this fixed now?

Thx

Venkat

"Software FX Support" <support@softwarefx.com> wrote in message

news:gPx3YeBvDHA.3512@WEBSERVER1...

> You are missing the indexer. The ASP code is

chart.Commands(CFX_ID_GALLERY).

> chart.Commands does return a ComandBar object,

> chart.Commands(CFX_ID_GALLERY) return a Command object.

>

> It doesn't matter where you use it from (ASP or C#) the properties return

> the same, it is just the syntax that changes.

>

> As I said before I do not have a sample in C#, and I don't the syntax for

> obtaining an Array Property, but it might be something like:

>

> oCmdBar[index]

>

> or

>

> oCmdBar.Item[index]

>

> All of the C# code I have is for Chart FX for .NET. Have you though of

> upgrading ? It will make your life much easier if you use a component

> designed for the .NET framework instead of a COM component.

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

> 1. Ideally, oChart.Commands(ChartfxLib.CfxToolID.CFX_ID_GALLERY) should

> return command object. But it doesn't. Then I tried like this:

> object oMyCmd = oChart.Commands(ChartfxLib.CfxToolID.CFX_ID_GALLERY);

Did you try any of the options I suggested ? the above line is not a valid

C# expression. Arrays in C# are accessed with [] not (). I suggested:

oCmdBar[index]

or

oCmdBar.Item[index]

> 2. Let's assume the above statement returns command object. Somewhere (in

> any namespace) command class should be available so that I could make an

> instance of that to use the above statement.

The object returned supports the ICommandItem interface which exposes

FindSubCommandID and others. The classes an interfaces are there, otherwise

it wouldn't work in ASP, it is just a matter find out how a COM object is

converted into a .NET object and that's where I'm not much help. You need to

check MSDN and other Microsoft sources to understand this conversion, we do

not document this (and I have no experience with this) because we already

provide a fully manage .NET version of our product.

> Reg .NET ver, we thought the same as U. Then we evaluated the trial

version.

> We had an imperession that loading the chart control (on client side) is

> slow compared to 5.5 version. Do U agree w/ this? If so, is this fixed

now?

Not necessarily, while it is true in general that.NET controls load slower

in IE (the .NET framework needs to be loaded as IE is not a managed app), in

practice the difference shouldn't be relevant. New versions of Chart FX for

.NET use new techniques to improve this performance, also there is some

manual "twicking" that can be done to improve loading speed. Here is a

couple of KB articles (Chart FX for .NET support site) that will help you:

Q6123061. New MainClient Property improves rendering time for charts

displayed using the .NET Client

Q7121000. Improving loading time when using the Chart FX for .NET Client

Component

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...