Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Every one,

i Want to create Grid smiler to the MS Excel.

My required feature are:
1)resizing cell(S)/Colum(s)/Row(s)
2)selecting row(s),Colum(s),single cell and cell matrix.

I need Help for the,

1. Which data Structure is correct for the cell??
2. How to change appearance of cell if Length of inserted data is larger than the cell size??

Thank You.
Posted

1 solution

The data structure is up to you. Something like a cell is a certain object with a reference to the row and column it belongs and some other properties like the data. Then you have the rows and columns with a collection of cell references that it contains and also the width or height and some other data needed. This is then captured in a nice grid class that also gives certain functionality.

The appearance of the cell and drawing of the text inside it can be done with DrawString (http://support2.dundas.com/OnlineDocumentation/WebGauge2003/topic645.html[^])

Further you could also look at this:
MFC Grid control 2.27[^]

or simply search for grid in the article section to get some very nice results:
http://www.codeproject.com/info/search.aspx?artkw=+grid&sbo=kw[^]

Good luck!
 
Share this answer
 
v2
Comments
Bhavin Jagad 25-Aug-10 2:17am    
Hello, thanks for your supports.

I have created some what smiler to excel.
You may check it over here.
http://hotfile.com/dl/64505005/51f6799/Excel.exe.html

its only 86 KB.
i started programming with Visual c++ last month.


its supporsts
1) resizing of columns and rows
2) scroll bar(only click and thumb movements)
3) writing content in the cell
3) copy on Ctrl+c and paste on Ctrl+v of cell matrix
4) Rows selection, columns selection and cell matrix selection
5) Multiple selection
6) Key board threw movement in cell
7) Selection with Shift+(arrow key)
8) mouse hover effect on the Rows and Column title.

i know there is much more laking but this is my first SDI application and .
Please suggest me the improvements can be done in this application.

thank you.
Bhavin Jagad 6-Sep-10 1:58am    
hello every one,

You may check My grid at Follwing

http://hotfile.com/dl/64505005/51f6799/Excel.exe.html
Its only 86KB
thank you all for support.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900