last day (14 days later) » 

6:32 AM
1
A: How to make formula between 2 datagridview in C#

KapoorSharing my idea to implement a solution where changing a value in a cell updates another value First, Make a class like CellRelation - its purpose is to establish a relation between 2 Grid cells. class CellRelation { DataGridCell SourceCell; DataGridCell DestinationCell; Func<...

 
Okay thanks for advice but I still wonnaa get a way to make the datagridview controls each other ,, I am sorry if my description is little complicated :)
 
do u need something like an excel ? so say you change a value in one cell and a formula gets executed and the result is seen in destination cell ?
 
Hello kapoor,, yes that nearly I need it but the datagridview are in the same dataset all I need that datagridview 1 do changes automatically in datagridview 2 you got me??... Waiting for reply :)
 
yes, i think i understand your point.. so you have 2 grids, the datasource is a common dataset for both the grid & now you need some sort of event mechanism that whenever you change one value, the other one gets updated. Correct so far ?
 
Yes exactly was I am talking about ,, do you have answer... Waiting for reply :)
 
6:32 AM
To be more precise, are looking for such a wiring in the code ? - Grid one makes a change to dataset -> a formula gets executed -> the result of the formula updates another value of the dataset -> Grid 2 (linked to this value of dataset) gets updated since its datasource has changed
 
Yeah ,, so if you could explaine the code that gonna be perfect I need to understand more then do ,, so could you help... Waiting for reply :)
I approve your answer and accept it for your help but I still waiting the reply ... :)
 
alright I'll give you a idea of what comes to my mind... please give me few minutes
hahah... u r very kind
 
Okay I am waiting ,, you could give me a keyword to research on google to get more information to hold with you ,, thank you kapoor
 
well what comes to my mind is not an out of box solution that you can look up at google but an approach & design to implement something like an excel -> where when a cell is changed, the destination cell gets updated as per a formula... I write it & incase my write up is not too clear, I'll implement a sample tomorrow evening. Would that be fine ?
 
Okay ,, like now at I don't know the time in India
So what should I type on google to get more information ^^
Please give the keyword kapoor
 
6:32 AM
Excel spread sheet in C#,,, This may give some cleaver ideas to solve the problem
 
That I've done but I need the formula waiting reply :)
 
Hey! I have added my approach at an high level... do let me know your if its appropriate for your need or if you need a sample implementation.
 
Okay I need for development of REAL stocking app
Sorry for the late reply
Are you online now please respond
 
Please tell me, I'm online now
 
Talk at 9 ,okay?
Hello kapoor,, are you online now?
Hello kapoor Hey! "I have added my approach at an high level... do let me know your if its appropriate for your need or if you need a sample implementation. " unclear u don't understand what you want say sorry
 
6:32 AM
Hello Ahmed, I have added a working sample to demonstrate my approach please have a look.
 
I will try and tell you results ,, thank you kapoor
Are you online now?
I got error while making the class ,, I have add class to project named cellrelation.cs errorsays " the type or namespace name "Datagridcell" couldn't be found (are you missing a using directive or an assembly reference ?) " ,, by the way I am using Microsoft visual C# 2010 express... Waiting for reply . thank you kapoor..:)
I got the above error with line 3 in second code block "Cell formula" :(
Okay never mind all above error is fixed unless those in the first code block "the class " note my code didn't get the first code block "class relation" because the error that I mentioned above , I got a issue that.... Values code that 10,0,10 it didn't calculate it only do 10,0,10 even I remove values code ,,all of this code do nothing they never. Change ,,my columns arranged in this order "total,sold,remaining" as you ,,
 
Its working at my end, so may be the event handlers are not wired correctly - So there are 2 event handlers in my code 1> Initialise_Click : I have wired it to a button & it must be executed 1st. 2> dataGridView1_CellValueChanged : I have wired it to the CellValueChanged event of datagrid view, every time you change a cell's value and move to another cell this event fires up. Can you please check if the event handlers are wired correctly
 
All is correct but the value always 10 , 0 , 10 ... The first class not working have error ,, and 10,0,10 only working in the first row only
I suggest to make the project from began to end tutorial on YouTube with the same my question title ,, well you do it ?... Waiting for reply :) ,, and I need this help because I could check steps from the video ,, thanks alot??
Hello kapoor are you in?
 
Hey! Please tell me
hey! you there ?
 

last day (14 days later) »