[.net] c# how to make my datagridview work like Excel?
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.
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 :).
There is no "WorkLikeExcel" property though :).
hmm can you please explain how that works in more detail? can it do cell referencing and if statements?
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]
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.
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.
Well, you could just directly embed an excel object in your app. This will get you pretty much the full excel experience, although it will create a dependency on excel (i.e. your app won't run an machines that don't have excel installed)
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?
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement