locked
Columns are not properly arranging in Datagrid control RRS feed

  • Question

  • Hi,

    I am using datagrid in my project and displaying the data dynamically by using property ItemSource. Data are displaying correctly, but an issue is first column of any row in the datagrid result is shifting (one space is adding). If you scroll vertically, other row of the first column is shifting randomly (Last shifted column is displaying correctly). Please provide me a solution. XAML looks like

    <Grid>
    <dg:DataGrid
    x:Name="lsvResults"
    Margin="5,5,5,5"
    AutoGenerateColumns="True"
    SelectionMode="Extended"
    IsReadOnly="True"
    GridLinesVisibility="Vertical"
    CanUserReorderColumns="False"
    CanUserResizeColumns="False"
    HeadersVisibility="Column"
    VerticalGridLinesBrush="DarkGray"
    HorizontalGridLinesBrush="#FFADD8E6"
    SelectionUnit="FullRow" ItemsSource="{Binding}"/>
    <TextBlock x:Name="txtNoItems" Margin="5,45,5,5"
    Text="No items found in selected list." FontSize="12" Visibility="Collapsed" />
    </Grid>

    Thanks
    Mani
    • Edited by GavsMani Friday, June 12, 2009 3:36 PM
    Friday, June 12, 2009 3:34 PM

Answers