Good morning,
I'm trying to create a contingency table ( you can see a simple example in the image) but I don't find an optimal solution. What I tried to do was to use a RadGrid. The "problem" is that I want to populate the table in code behind (I use c sharp). In particular I have 2 arrays: in this example one for sex (male or female) and one for handedness (right- or left-handed). All the other data (the numbers) must be initially empty. The second "problem" is that I'd like to calculate the sum in client side in order to avoid a postback each time I insert a variable. What I tried to do was to create a dataTable and insert it as datasource. For the column with the sum I used a calculatedGridColumn but I had problem if the value is empty because I was not able to convert it as 0 (I don't want to show the empty value as 0 initially). In order to calculate the total each time I insert a new value I wasn't able to sum the value of each row but I subtract the value when click the cell and then re add the new value inserted (it's a bad method). There's no way to re evaluate the total each time I insert a new value?. As I said remember that the table is created dynamically.
If someone has a good solution for this problem please help me.
Thanks