bug: single selectionmode headless

Apr 24, 2009 at 9:40 AM
Edited Apr 24, 2009 at 9:43 AM
when i call 
SelectionMode = Microsoft.Windows.Controls.DataGridSelectionMode.Single;
grid is displayed with header control nearly completely hidden behind table
move of this call to different line has no influence
no problem with Extended case

<

 

toolkit:DataGrid Name="lv" Grid.Row="0"
AutoGenerateColumns="False"

 

 

CanUserAddRows="False"

 

IsReadOnly="False"

 

>

 

<

 

toolkit:DataGrid.Columns>

 

 

 <

 

toolkit:DataGridTextColumn Header="First Name" Binding="{Binding V0}" />

 

<

 

toolkit:DataGridTextColumn Header="Middle Name" Binding="{Binding V1}" />

 

<

 

toolkit:DataGridTextColumn Header="Last Name" Binding="{Binding V2}"

 

 

 

/>

 

</

 

toolkit:DataGrid.Columns>

 

 

 

</toolkit:DataGrid>

 

 

 

 

 

InitializeComponent();

Microsoft.Windows.Controls.

DataGridCheckBoxColumn dc = new Microsoft.Windows.Controls.DataGridCheckBoxColumn();

 

 

 

dc.Header =

"Text2";

 

 

dc.CanUserSort =

false;

 

 

 

lv.SelectionMode = Microsoft.Windows.Controls.DataGridSelectionMode.Single;

 

 

 

// lv.SelectionMode = Microsoft.Windows.Controls.DataGridSelectionMode.Extended;

// lv.SelectionUnit = Microsoft.Windows.Controls.DataGridSelectionUnit.Cell;

// lv.SelectionUnit = Microsoft.Windows.Controls.DataGridSelectionUnit.FullRow;

System.Windows.Data.

Binding bd = new System.Windows.Data.Binding("V3");

 

 

dc.Binding = bd;

lv.Columns.Add(dc);

 

PersonNames names = new PersonNames();

 

 

 names.Add(

new PersonName());

 

 

 names.Add(

new PersonName());

 

 

 names.Add(

new PersonName());

 

 lv.ItemsSource = names;

 

call Single followed by Extended makes no problem

the same with xaml version
SelectionMode="Single"

Coordinator
Apr 24, 2009 at 9:51 PM
We've filed a bug in our internal database to be fixed in a future release.

Ben
Apr 26, 2009 at 2:40 PM
thanks
so i undestand it is reproducible also for you
and i do not need search my possible local mistake
Jun 13, 2009 at 1:41 PM

Any idea when this will be fixed - or where I need to look in the source to fix it ?

Jun 13, 2009 at 2:48 PM

I worked around this as follows:

 

 

 

<font size="2">

 

</font>

 

 

private void dataGrid1_SelectedCellsChanged(object sender, Microsoft.Windows.Controls.SelectedCellsChangedEventArgs e)

{

if (dataGrid1.SelectedItems.Count >= 2)  // Fix for SelectedMode bug - to allow SingleRowSelect only : http://wpf.codeplex.com/Thread/View.aspx?ThreadId=54343

dataGrid1.SelectedItems.Remove(dataGrid1.SelectedItems[0]);

}

Jun 26, 2009 at 10:30 AM

looks fixed in actual release