We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

GridDesktop and Shapes

Is it possible to click on a shape to select it in GridDesktop or some manner of finding a shape based on where you’ve clicked? I’m trying to build a UI that requires a user to select a shape and name it and it’s filled/unfilled status as a template for similar spreadsheets to be processed automatically by Aspose.cells on a backend application, but, there doesn’t seem to be any events related to shapes that I can find.

Hi,

Thanks for your posting and using Aspose.Cells for GridDesktop.

We are afraid, this feature is not available. Could you please explain your requirements in more detail with some screenshots, we will then investigate and see if we could implement such a feature in our newer versions and let you know.

Thanks for your cooperation.

I’m attaching an image, but, essentially what I want to be able to do is allow the user to select shapes, provide a mapping that says that shape 1 when filled in means this, shape 2 means this, etc… without them having to know the shape name.



Which leads to a new problem…the 3.0.0.0 version of Aspose.Cells appears to have a problem. The Shapes collection is NOT the shapes collection but a duplicate of the Pictures collection. Also, the name being returned is NOT the name that appears in Excel but a sequential name…Picture 1, Picture 2, etc… rather than the true name.



CORRECTION: It would appear the problem with the Shapes and Pictures both returning Pictures and the names being wrong is due to a problem with the GridDesktop Export routine. It would appear to incorrectly handle them…if I load the workbook directly from disk rather than from an export/import to/from a memorystream, the shapes are all there and named properly and the pictures are in the pictures collection correctly named as well. So, this appears that this particular issue is not Aspose.Cells but Aspose.Cells.Griddesktop.

Hi,

Thanks for your posting and using Aspose.Cells for GridDesktop.

We have logged a New Feature request for this issue in our database. We will look into it and implement it if possible. Once, it is implemented or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43180 - Select shapes and trigger an event on backend

Hi,

Thanks for using Aspose.Cells for GridDesktop.

We will add ShapeClick event to support this requirement. And the shape class is also public now. You can get some readonly properties.

Below is the demo code:


C#


public CELLSNET_43180shapeevent()

{

InitializeComponent();

this.gridDesktop1.ImportExcelFile(System.IO.Path.Combine(Application.StartupPath, “DS207-A-G120B-1.myreplace.xls”));

this.gridDesktop1.ShapeClick += new Aspose.Cells.GridDesktop.CellEventHandler(DoShapeClickResponse);


}


private void DoShapeClickResponse(object sender, Aspose.Cells.GridDesktop.CellEventArgs e)

{

Aspose.Cells.GridDesktop.Shape tshape = (Aspose.Cells.GridDesktop.Shape)e.Argument;

MessageBox.Show(“get shape here:” + tshape.Name + “,left:” + tshape.LeftToCorner + “,top:” + tshape.TopToCorner);

PictureBox pb = new PictureBox();

pb.Image = tshape.Image;

this.Controls.Add(pb);

pb.SetBounds(0, 0, tshape.ActualWidth, tshape.ActualHeight);

pb.Show();

pb.Click += new EventHandler(pb_Click);

}


void pb_Click(object sender, EventArgs e)

{

PictureBox s = (PictureBox)sender;

this.Controls.Remove(s);

}

The issues you have found earlier (filed as CELLSNET-43180) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.