I have Grid with 10 rows and 10 column, and I want in code behind get to every of this grid cell to change this background or add image to cell, How can I do it ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Grid, in WPF, doesn’t really have “cells”.
Instead, individual child controls of the grid are “decorated” with the Grid.Row and Grid.Column attached property.
If you want to change the color of a “cell”, there will need to be some UIElement that is marked with that row and column, and is a child of the Grid. You can search the grid’s Children for the specific control in that row and column (by using Grid.GetColumn(child), etc), then set the color of that UIelement.