Resize Jagged 2D array

Hey, I have the following code that I am wondering if it is good:

for(int i=0; i < arrSize ;i++)
		{
			System.Array.Resize<Script_Square>(ref grid[i],arrSize);
		}

grid is a 2d array declared as int[ ][ ] grid; Will this code work well for resizing my 2d array?

Also, if I use this System.resize function, do I still have to do the code:

grid = new int[arrSize][arrSize];

Thanks

Ok this way does not seem to be working for what I want to do.

Can someone suggest a good way for achieving the following.

I need a 2d array for it to make sense with my square grid. When I clicking a button I want the 2d array to clear its contents and then re-fill the array based on a new size grid.

So I start with say a 4x4 grid, but then when I press a button I want to delete all objects from my previous array and have a 6x6 grid in its place, what is the best way to do that?

If you want your 2D array to be cleared, then Array.Resize doesn’t look like a good fit.

Depending on exactly what you’re doing there, something like this (or what you have to new-up the array) should work.

private int[,] map;
protected void ButtonClick()
{
var newSize = GetNewSize();
map = new int[newSize,newSize];
}