tags:

views:

137

answers:

1

Hi there!

I am currently using a Datagrid binding to a list of items in Silverlight 3. Each row has two checkboxes. Anyone please help me how to prevent the Datagrid from firing the Selection_Changed event each time I click on any checkbox? I have been stuck with this for some days, deadline is coming near.

                                    </DataTemplate>                                        
                                </data:DataGridTemplateColumn.CellTemplate>
                            </data:DataGridTemplateColumn>

                            <data:DataGridTemplateColumn Header="Track" SortMemberPath="IsTracked" CanUserResize="False" CanUserReorder="False">
                                <data:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                                            <CheckBox  
                                                  Tag="{Binding unitID, Mode=OneWay}" 
                                                  Click="ShowB_Clicked" IsChecked="{Binding IsTracked, Mode=TwoWay}"></CheckBox>

                                    </DataTemplate>
                                </data:DataGridTemplateColumn.CellTemplate>
                            </data:DataGridTemplateColumn>
                        </data:DataGrid.Columns>

When I click on either the checkbox, the dgList_SelectionChanged of the Datagrid is fired and the SelectedIndex/Item also changed to the row that contains the clicked checkbox. What I want is not change the SelectedItem, in other word not fire dgList_SelectionChanged, of the datagrid.

Please help.

Thanks alot in advance.

Middlevn

A: 

Having a similar issue, starting to contemplate putting a see-through image over the checkbox to prevent the click, then use the cell changed event to get the checkbox value, then on current cell change set the current cell to something else.

I can't wait for better support for html5 so I can dump this MS garbage

newbie007