Jump to content
  • Advertisement
Sign in to follow this  
shrek2

[.net] c# how to make my datagridview work like Excel?

This topic is 3257 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way to get my datagridview to work like Excel? For example, then the user types =1+1 into any of the cells, then then cell will return 2. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I'm sure there is a "CellTextChanged" or similar event that you can catch. Check if the value begins with a "=", then you parse the expression and calculate the result.

There is no "WorkLikeExcel" property though :).

Share this post


Link to post
Share on other sites
hmm can you please explain how that works in more detail? can it do cell referencing and if statements?

Share this post


Link to post
Share on other sites
Quote:
Original post by shrek2
hmm can you please explain how that works in more detail? can it do cell referencing and if statements?

[google]

Share this post


Link to post
Share on other sites
How much like excel does it need to be, the syntax is a bit different but Python is a complete language that is more than enough for basic in app scripting.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kaze
How much like excel does it need to be, the syntax is a bit different but Python is a complete language that is more than enough for basic in app scripting.


basic arithmetic, if statements, and cell referencing.

For example,

=1+1
=if(c2=c3,4,0)

can u give me an idea on how to implement this? i guess i don't understand what needs to be done her if i use python. thanks.

Share this post


Link to post
Share on other sites
Unless you take ChaosEngine's solution, then there is nothing (that I am aware of) that lets you do it without having to parse and evaulate the cells yourself.

Why do you think Microsoft charge so much for Excel/Office if it could all be built using off-the-shelf components for free anyway?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!