Click to See Complete Forum and Search --> : Making an spreadsheet. How?


kebabbert
June 21st, 2006, 06:00 PM
Hi there!

This seems like a good forum and this is my first post. Anyway, I am trying to learn C# and shall do an Excel-like program, with cells that I can copy and move around etc.

My question is; should I use a data grid class or listview? Or, better yet, is there any free downloadable grid controls to try out? Any hints would be much appreciated!

Sheesh
June 21st, 2006, 10:11 PM
OMG :eek: , don't let me push you away you can do anything you put your mind to. But I'm not sure if you understand how hard it would be to create a spreadsheet program. I wouldn't recommend trying to learn C# by writting a spreadsheet program.

The DataGrid control is one of the best grid controls out there, if fact I think its the only one Microsoft requires a license to use (which always was a problem for me when trying to extend the control. The end user couldn't run the program). It is very powerfull. If you are looking to put a grid into your application you should figure out what you want to do first. The DataGrid control is normally only used for working with data loaded and saved back into database, not as a spreadsheet.

If you want to look into COM you could find a way to use Excel with your application, but that's a completely different issue.

I would strongly recommend you start on something simpler. Do you have any programming background or is this your first time?

kebabbert
June 22nd, 2006, 03:23 AM
Thanx for your advice. Well, I am not going to an spreadsheet. I am going to do an Excel-esque program. Mostly moving around cells and such. I am thinking of using:

http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp

More feedback and advice?

(I have a Master's degree in computer science, and a Master's in Math.)

K7SN
June 22nd, 2006, 11:58 AM
Don’t worry about the naysayer - making Cut, Copy, Paste (And Ctrl-X, Ctrl-C, Ctrl-V) to work on something as simple as a datagrid is a real learning experience. Try adding a simple formula under a cell and update the adjacent cell. Try to total columns and rows all without the aid of “fancy tools” first. It can be a real learning experience.

I know, the first real commercial program I wrote was a “single entry” Bookkeeping program as described above. Some 10 years later, someone wrote the same thing with a few more bells and whistles and called it VisaCalc and shortly after that the name Spreadsheet was invented. I guarantee writing it in C# on .Net environment will be a lot easier than Fortran II on a Sigma Seven (Xerox Mainframe - Circa 1966) . I might have that program somewhere on Mylar punch tape as it was deemed important enough to save on something besides Punch Cards. If I could get hold of an old ASR-33 I might be able to print the code.

The point is you are trying to learn and this task is will improve several skills including C#, .NET and how to find answers to C# questions on the internet.

kebabbert
June 22nd, 2006, 12:26 PM
Thanks for your encouragement! :o)

I wonder, as you have done something similar, what class would you have used? A Data Grid, a ListView or the class in the link I provided?

K7SN
June 22nd, 2006, 01:32 PM
Thanks for your encouragement! :o)

I wonder, as you have done something similar, what class would you have used? A Data Grid, a ListView or the class in the link I provided?

Took a quick gander at your link, seems pretty complete and a kind of advanced first step . When I played with the “spreadsheet” was 1966 and the concept of classes, heck even Object Oriented Programming didn't exist.

I am doing Statistics program here at Lockheed in C# using the FarPoint commercial package but before we started or purchased FarPoint I played around a bit reading an Excel file into a Datatable and binding that DataTable to a DataGrid for display. This was my first C# or .Net experience, all my previous coding on the long-term project had been in C++ and I was able to get a working version in a couple days. I have roughly the same Education Level although I never bothered to get the Math Degree I think I had a enough math credits for a BS in Math just to get into the CS graduate program.

I save everything and have that old play program but didn’t mess with Cut Copy or Paste even though I stubbed out the controls. I was more interested in seeing if I could develop a log class, a recently visited files link to the registry, at such other simple nonsense. It is very much a kludge, first effort etc. but would be glad to zip the project and send it to ya as a simpler starting point.

kebabbert
June 22nd, 2006, 04:07 PM
Thanx for you taking time to advice me. I would appreciate very much if I could look at your program. My emailadress is: CENSORED


I will edit this post and remove the emailadress fairly soon, because I want to avoid spam. Maybe you could write it down, and tell me so I can remove my email?

Anders
June 22nd, 2006, 04:43 PM
K7SN wrote:
I am doing Statistics program here at Lockheed in C# using the FarPoint commercial package
Interesting... I don't know if this is possible at all, and I realize it is a bit off topic, but could you please compare the FarPoint package to the .net 2.0 DataGridView?

I have no experience with FarPoint since 3.0 six or seven years ago (using MFC/C++), but is it possible to compare the two components?

For example:

* Extendability & customisation
* Binding to a data source (xml, database, ...)
* Non databound & dynamically & manually changing rows & columns. Quite possible but not extremely easy with the DataGridView...
* Price...? DataGridView is "free"... is FP Spread a single cost and then freely distributable or do you have to pay per delivered application?
* More...?

Oh, I don't even know if this question makes sense but I fire it away anyway :-) Thanks!

Best regards,
Anders

K7SN
June 22nd, 2006, 05:05 PM
Delete the email address - Project is in the mail - if the zipped version is too big I will still have your address and will let you know.

--bob

K7SN
June 22nd, 2006, 05:28 PM
Hi Anders

Currently I am using FarPoint as a replacement for Formula One and really not doing much with the Spreadsheet qualities although they seem extensive. The one program we are hoping to release by the end of the year goes out for peer review next week. I may get to play more with FarPoint in a month or so but haven’t bound it to any source or done anything intensive yet. Yes it is somewhat cumbersome to change, since my application is not bound, nut other than simple cut/past operations (Fully supported) I don’t do any of that. What we needed was a way to bring in data in from an XLS sheet, number crunch a bunch of statistics, output to a form that could be incorporated in reports. The powers at be determined that ChartFx and FarPoint were the tools to use and .NET was the future. Since what we are doing is not what FarPoint was mainly intended to do it is hard to be critical. As long as it is within an application, you may freely distribute the FarPoint dll To get an idea of what I am doing, the current version written in Visual C++ 6.0 is available for free download at an EPA website. Do a Google search on "ProUCL" if you want to get an idea. I’m an old school scientific programmer, I may get to write one Windows Application program every other year, the rest of the time, it is in house command line simulation programs. Sorry I can't offer you more of a comparison.