Simple Grid

  • Thread starter Thread starter Wayne
  • Start date Start date
W

Wayne

I need to make a simple grid in which the user can cut and paste the
contents of a region of cells from this simple grid to excel.

I thought about ganging a bunch of textboxes (1 textbox = 1 cell)
together which would work for me but I cannot cut and paste a
collection of cells to excel using this approach.

Any ideas where to go next? I know I can buy such a capability and
have done so in the past but I would like to write it in vb.net. I
don't need all the power that comes from commercial versions.

I have tried datagrid and I cannot cut and paste a collection of cells
to excel.

I have played with listview also and did not get what I want either.

I don't need scrolling or binding ... I just need cells that the user
can type in and then cut and paste to excel.

Thanks in advance.

Wayne
 
You can write a routine that select all textboxes you want
A mouse move will give you the coordinates of the selection rectangle
You can check wich text boxes is inside the rectangle, you can change the
bgcolor of selected textboxes to reflect the ideea of selection. On cut, can
arrange the text of each textbox "selected", as you need to be pasted in
excel and fill the clipboard with it
 
Just add the Excel spreadsheet control to the project. Go to Add/Remove
items on the toolbar and go to COM. It will be under Microsoft Office
Spreadsheet x depending on your version. Its a fully featured control and
you can turn off the option to display the title bar to make it look more
integrated.

Stephen
 
Stephen,

I should add that I want to stay in managed code - hence I don't want
to use com objects.

What I want to do is build a grid using the tools that vb.net has
provided.

Wayne.
 
Back
Top