0

I have a matrix kind datagrid in my WPF application and I would like to create a two dimensional Array to access the row and column of the datagrid. how to access the datagridcells using 2-dimensional arrays of type bool, since my result will be of type Boolean.

for each [i][j] of this 10 x 10 rows, column array, I have to query

for example

[0][0] = result of one query

[0][1] = result of another query

EDIT

What I have tried

bool[,] cell = new bool[10, 10];

        for (int i = 0; i < 10; i++)
        {
            for(int j= 0; j<10 ;j++)
            {
            cell[i,j] = (); // what to write here 
            }
        }
6
  • Your headers are of type bool ? Commented May 29, 2013 at 9:54
  • yes. i will edit the question now Commented May 29, 2013 at 9:55
  • I didn't get a whole lot clearer. Commented May 29, 2013 at 10:00
  • To rescue this question: add details, don't remove them. Commented May 29, 2013 at 10:14
  • 2
    what to write here : cell[i,j] = true; or cell[i,j] = false; or maybe cell[i,j] = MyBooleanFunction(i,j);. We really can't make much more of the question. Commented May 29, 2013 at 10:16

2 Answers 2

1

You can define 2D arrays in C#:

var array2D = new int[13, 100];
array2D[7, 11] = 48;
Sign up to request clarification or add additional context in comments.

Comments

1
bool[,] array = new bool[1, 3];

http://msdn.microsoft.com/en-us/library/2yd9wwz4.aspx

1 Comment

the array is for bool type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.