I am trying to write a function which creates a Grid
which has no value in the starting and when some value is passed to it, it should show that value in that Grid
dynamically. But it is not changing it dynamically.
The two user defined functions are
createGrid[rows_, column_] := (list = {};
For[i = 1, i <= rows,i++, (individualColumns = {};
For[j = 1, j <= column,j++, (Subscript[e,i, j]="";individualColumns = Append[individualColumns,Subscript[e,i, j]];)];
list = Append[list, individualColumns];)]; layoutGrid[list])
This createGrid function generates null values which is then passed to user defined function layoutGrid.
layoutGrid[list_] :=
Panel[Grid[list, Background -> LightBlue, Spacings -> {0, 0}, ItemSize -> {0, 0}, Alignment -> {Center, Center}],ImageSize -> {780, 480}, Background -> LightBlue]
I am calling the createGrid function by passing 20 rows and 20 columns as arguments.
Dynamic[createGrid[20,20]]
It creates the Grid
having 20 rows and 20 columns having no value.
In createGrid function, variable Subscript[e,i,j], i defines the row number and j defines the column number
After building the empty Grid
,when I am assigning some value to Subscript[e,1,2] like
Subscript[e,1,2]=10;
It does not show in the Grid
dynamically. Why?