✅ WPF Datagrid Select
Hi, i'm trying to change the style of each row depends of the datatype. Currently my code seems to work, i'm able to select the style for each row by using the
selector
.
But here i have a problem in the style of my row :
if i remove the template
part, the row can be selected when i click on it but when i add the template
setter part it seems to remove the selectability of the row when i click on it.
Have you any idea how to resolve this problem ? i supposed that i override the default template but i dont know how to keep the selectable part4 Replies
Pretty sure your row is selected, but there's no visual indicator since you have overwritten the template. Have you checked the SelectedItem property?
Also I am not sure, why you are using this template. From what I get here, you should use a
<Grid>
and put your <DataGrid>
in there. Then add the image to the grid as wellhere is the datagrid i want to display :
i'm almost sure nothing happen when i click cause if i select the row manually with
SelectedIndex="3"
in the datagrid i can notice the visual change on my datagrid
i've put a breakpoint into my selected item and the setter is never reach execpt if i select the row manually with SelectedIndex
i've found this to resolve my problem :
but when i click on the row this happen :