I have such DataGrid
In order to get order number automatically I added in DataGrid
method LoadingRow
such way
.xalm
...
<DataGrid ItemsSource="{Binding Path=GridItems}"
HorizontalGridLinesBrush="Gray"
RowHeaderWidth="20"
LoadingRow="Dg_main_configuration_LoadingRow"
CanUserReorderColumns="False"
CanUserDeleteRows="False"
CanUserResizeRows="False"
CanUserSortColumns="False"
VerticalGridLinesBrush="LightGray"
x:Name="Dg_main_configuration"
CanUserResizeColumns="False"
PreviewMouseLeftButtonUp="Dg_main_configuration_PreviewMouseLeftButtonUp"
AlternatingRowBackground="LightYellow"
CanUserAddRows="False"
MinHeight="350"
MaxHeight="350"
Grid.Column="0"
AutoGenerateColumns="False">
...
and in code
private void Dg_main_configuration_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = (e.Row.GetIndex() + 1).ToString();
}
All is fine, but anyway I would like to adjust this row column
Problems is :
- You can see in screenshot next to
Path to clip folder
(on the left) there is a cell with a rectangle at the right bottom, acctually it is kind of button(because I can click on it, but nothing changed), how to disable it, or set symbol like#
? - Numbers
1, 2, 3, 4
horizontally not in the center, how to fix it? - And last is - you can see that there are a horizontal lines
DarkGray
that separates rows, but I don't know why numbers doesn't include this separate lines? I mean line starts after number column. How to include separate line in order numbers also?