I made this example, hope it helps:
static void Main(string[] args)
{
int Height = 4;
int Width = 5;
Console.Write("Height: ");
Height = int.Parse(Console.ReadLine());
Console.Write("Width: ");
Width = int.Parse(Console.ReadLine());
int[,] grid = new int[Height, Width];
PrintGrid(grid, Height, Width);
Console.Write("Input Number of Start SLOT between 1 and " + (Height * Width) + ": ");
int startSlot = int.Parse(Console.ReadLine());
Console.Write("Input Number. How many SLOT to fill between 1 and " + ((Height * Width) -startSlot+1) + ": ");
int numberSlot = int.Parse(Console.ReadLine());
int[] numbers = new int[numberSlot];
Random randNum = new Random();
for (int i = 0; i < numberSlot; i++)
{
numbers[i] = randNum.Next(1, (Height * Width));
}
int pos = 0;
int numberIndex = 0;
for (int i = 0; i < Height; i++)
{
for (int j = 0; j < Width; j++)
{
pos++;
if (pos == startSlot || pos > startSlot) {
if (numberIndex < numberSlot) {
grid[i, j] = numbers[numberIndex];
numberIndex++;
}
}
}
}
PrintGrid(grid, Height, Width);
Console.ReadLine();
}
static void PrintGrid(int[,] grid, int h,int w) {
Console.Write("\nPrint Grid\n");
for (int i = 0; i< h; i++) {
for (int j = 0; j < w; j++) {
Console.Write( (grid[i, j]).ToString() + " ");
}
Console.Write("\n");
}
}