I am a WPF-noob and have two DataGrid problems: Problem 1: What I got: A DataGird that gets its data from a array:
I am using the "LoadingRow" event to update the row header:
What I want: It sould show the index of the line in the row header. Whats the problem?: If I add items or load items it works great, but if I sort the DataGird the index of the lines don't change. The left one is unsorted and the right one is sorted (by Name). In this example the index of line "F" should be 6 instead of 1 (right image). (Not related to the problem: Why are all RowHeaders selected?) Problem 2: What I got:see Problem 1 What I want: After I added a row it should jump to the next empty row. Whats the problem?: If I sort the datagrid it jumps to the next line, even if it is not empty. First I sorted the list by name and then I added "A: First", "B: Second", "C: Third" and then "A: Fourth" and because of the sorting "A: Fourth" automatically gets the second line and then it jumps to the third line instead to the last, empty line. Edit: Sorry, i forgot to say: It should 1. reset the sorting and 2. jump to the last, empty line. The order should be "A: First", "B: S", "C: T" and "A: Fourth". I really hope there are easy solutions. Thanks :) |
↧
DataGrid: Show row index and reset sorting
↧