Make a textbox act like Excell Cell
-
Hi All i am converting an Excell spreadsheet into an application. So i am doing automatic calculations like Excell do , for some of the cells(textbox) should allow a user to enter the minus sign "-" , and this automatically minus value entered. So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ? Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
-
Hi All i am converting an Excell spreadsheet into an application. So i am doing automatic calculations like Excell do , for some of the cells(textbox) should allow a user to enter the minus sign "-" , and this automatically minus value entered. So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ? Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
Vuyiswa Maseko wrote:
So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ?
Without knowing how your application works, no. I don't know what code you've actually written, so how can I tell you what's wrong with it. I will say one thing though - if you can cope with positive numbers, you should be able to cope with negative ones. After all, taking away is merely adding a negative number.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
Vuyiswa Maseko wrote:
So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ?
Without knowing how your application works, no. I don't know what code you've actually written, so how can I tell you what's wrong with it. I will say one thing though - if you can cope with positive numbers, you should be able to cope with negative ones. After all, taking away is merely adding a negative number.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
hi Pete Thanks for your reply. i am just looking at ideas without any coding examples. What i need is a logic to bypass this. lets take a Cell in an Excel spreadsheet,you normally can enter numeric values and by default anything that has no sign "-" is a "+" so now when it comes to negative in Excel it will subtract the value in the cell from somewhere. So in .e.g asp.net or silverlight , if you want to mimic that Excel behavior how can do that , because immediately when that value is entered it changes the data in the textbox not to fall under "int" or "decima" because there is a special character. You know what ? i just Figured out. i will keep the value as is and when it is being calculated against another Field , i will sum what needs to be summed and subtract on any field that has that sign Sometimes when you explain the problem to someone you might find the solutiion Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
-
hi Pete Thanks for your reply. i am just looking at ideas without any coding examples. What i need is a logic to bypass this. lets take a Cell in an Excel spreadsheet,you normally can enter numeric values and by default anything that has no sign "-" is a "+" so now when it comes to negative in Excel it will subtract the value in the cell from somewhere. So in .e.g asp.net or silverlight , if you want to mimic that Excel behavior how can do that , because immediately when that value is entered it changes the data in the textbox not to fall under "int" or "decima" because there is a special character. You know what ? i just Figured out. i will keep the value as is and when it is being calculated against another Field , i will sum what needs to be summed and subtract on any field that has that sign Sometimes when you explain the problem to someone you might find the solutiion Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
Vuyiswa Maseko wrote:
Sometimes when you explain the problem to someone you might find the solutiion
Often the way my friend, and a 5 for such enlightenment.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
Vuyiswa Maseko wrote:
Sometimes when you explain the problem to someone you might find the solutiion
Often the way my friend, and a 5 for such enlightenment.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
:)
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
-
Hi All i am converting an Excell spreadsheet into an application. So i am doing automatic calculations like Excell do , for some of the cells(textbox) should allow a user to enter the minus sign "-" , and this automatically minus value entered. So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ? Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
Are you aware of this article A Calculation Engine for .NET[^]
-
Are you aware of this article A Calculation Engine for .NET[^]
Thanks nice
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com