Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to find the pixel coordinates of a selected cell in a WPF gridview
    primarykey
    data
    text
    <p>I have been trying for a few days to answer this question. I've found snippets of code which come close but have not given me what I need.</p> <p>I need to be able to identify the x and y coordinates of a specific cell in a WPF datagrid. the cell will be the selected cell. I also need to be able to determine the exact size of that cell.</p> <p>this is so that I can superimpose an editor control over that cell when the user edits it so I can accept user input.</p> <p>the reason it has to be done this way is I need different editors by row. there are several columns in the datagrid. one column in particular asks the user to provide a value. depending on the contents of another column the type of input the user needs to provide in the value column changes. a text input or a number input requires a text box. some rows are boolean and the user needs to select from a check box. some rows have predefined values and the user needs a combo box. there are also file path rows and I want a file open dialog to come up automatically and place the selected filename into the cell. so I can't just use the built in editors in the datagrid because it allows me to specify the format by column, but not also by row. of course I don't know the contents of the rows ahead of time so it needs to be done at runtime.</p> <p>I have been able to move the editor controls around and make them visible and invisible. I have been able to get the X coordinate of the left side of the selected cell. I've also been able to find the width of the selected cell.</p> <p>the Y coordinate of the cell and the height of the cell I have attempted in several different ways but none have worked.</p> <p>I already have the logic flow figured out for how to do this. I did a sample run in a window forms application. 100 lines of code and about 30 minutes and it was working perfectly. I've been trying to figure out how to do the same thing in WPF for days. any help would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload