Columns are not properly arranging in Datagrid control

Jun 12, 2009 at 4:56 PM

Hi,

I am using datagrid and displaying the data dynamically by using the 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

Coordinator
Jun 12, 2009 at 10:00 PM

Hi Mani,

I think this is the same issue which was encountered in this thread: http://wpf.codeplex.com/Thread/View.aspx?ThreadId=47047.  We do have a bug tracking this internally and will fix it in a future release. 

Thanks,
Samantha