Exception on click

Oct 17, 2008 at 5:25 PM
Hi

I get an exception in the application that is included.
The application is more or less a matrix of checkboxes.
It consists of a xaml and a vb class.

You get I while playing around with the checkboxes, unselect some and then try to click on the vertical line between two checkboxes

Is this known?

regards
Klaus

XAML:

<UserControl x:Class="Packages"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WpfToolkit"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="500" Height="500">
    <Grid>
                  <toolkit:DataGrid x:Name="dgData"
                   AlternationCount="2"
                   CanUserAddRows="False"
                   CanUserSortColumns="False"
                   AlternatingRowBackground="LightBlue"
                   AutoGenerateColumns="True"
                   IsSynchronizedWithCurrentItem="False"
                   Background="Transparent"
                   RowHeaderWidth="25"
                   RowBackground="White"
                   BorderThickness="0"
                   BorderBrush="White"
                   SelectionUnit="CellOrRowHeader"
                   ItemsSource="{Binding}"/>

    </Grid>
</UserControl>

CLASS:

Imports System.Data

Partial Public Class Packages

   Public Sub New()

      InitializeComponent()
      DataContext = GetData()

   End Sub

   Public Function GetData() As DataTable

      Dim dt As New DataTable("UserGrpModules")

      dt.Columns.Add("my_name", Type.GetType("System.String"))
      For i = 1 To 9
         dt.Columns.Add(CStr(String.Format("col{0}", i)), Type.GetType("System.Boolean"))
      Next

      Dim pk As DataColumn() = New DataColumn(0) {}
      pk(0) = dt.Columns("my_name")
      dt.PrimaryKey = pk
      dt.Columns("my_name").ReadOnly = True

      For j = 1 To 10
         Dim dr As DataRow
         dr = dt.NewRow()
         dr("my_name") = String.Format("line {0}", j)
         For i = 1 To 9
            dr(UCase(String.Format("col{0}", i))) = True
         Next
         dt.Rows.Add(dr)
      Next

      Return dt

   End Function

End Class




Oct 21, 2008 at 10:14 PM
Hi

can you reproduce the exception thrown by the datagrid?
Is this a known bug?

Regards
Klaus