Click here to Skip to main content
15,885,853 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF- Databinding set path Pin
Ian Shlasko23-Oct-09 8:57
Ian Shlasko23-Oct-09 8:57 
GeneralRe: WPF- Databinding set path Pin
DeepakMega23-Oct-09 16:24
DeepakMega23-Oct-09 16:24 
QuestionRefresh and Browser Close In Silverlight Pin
Member 470467523-Oct-09 3:21
Member 470467523-Oct-09 3:21 
QuestionWPF: WPF Toolkit Datagrid. Capturing Key board events Pin
sameercodes22-Oct-09 23:12
sameercodes22-Oct-09 23:12 
QuestionRe: WPF: WPF Toolkit Datagrid. Capturing Key board events Pin
hhrafn23-Oct-09 5:04
hhrafn23-Oct-09 5:04 
AnswerRe: WPF: WPF Toolkit Datagrid. Capturing Key board events Pin
ausadmin23-Oct-09 14:17
ausadmin23-Oct-09 14:17 
QuestionDelete a control from Cider( WPF editor) through code [modified] Pin
Vinod C S21-Oct-09 23:12
Vinod C S21-Oct-09 23:12 
QuestionWPF DataGrid with DataGridTemplateColumn and RadioButton Pin
ausadmin21-Oct-09 20:51
ausadmin21-Oct-09 20:51 
I have posted the following question on codeplex, but not had any reply. I am hoping someone here may be able to help.

I have a WPF DataGrid which represents a small number of options (ie one option per row), one of which is chosen as the default. In the first column of the DataGrid I want to have a RadioButton in each row - to set the default. I have almost got this to work with the code below - the Binding is working. The problem is, it is possible to get into a scenario where the setting from the RadioButton is lost.

Our underlying object being bound to implements IEditableObject and we use this in various way to check edits and also take action when the default is changed. I have found that clicking the RadioButton completely bypasses the BeginEdit / EndEdit process of the DataGrid.

The xaml is as follows:

<toolkit:DataGrid Name="dgTesters" AutoGenerateColumns="False" AlternationCount="2" ItemsSource="{Binding LocalTesters}"
                          CanUserAddRows="false" CanUserDeleteRows="False"
                          SelectionMode="Single"
                          RowEditEnding="dgTesters_RowEditEnding">
    <toolkit:DataGrid.Columns>
        <toolkit:DataGridTemplateColumn>
            <toolkit:DataGridTemplateColumn.CellEditingTemplate>
                <DataTemplate >
                    <RadioButton IsChecked="{Binding Path=IsDefault, Mode=TwoWay}" GroupName="a" />
                </DataTemplate>
            </toolkit:DataGridTemplateColumn.CellEditingTemplate>
            <toolkit:DataGridTemplateColumn.CellTemplate>
                <DataTemplate >
                    <RadioButton IsChecked="{Binding Path=IsDefault, Mode=TwoWay}" GroupName="a" />
                </DataTemplate>
            </toolkit:DataGridTemplateColumn.CellTemplate>
        </toolkit:DataGridTemplateColumn>
        <toolkit:DataGridTextColumn Binding="{Binding TesterName}" Header="Tester Name" Width="*" MinWidth="80" />
        <!-- Further columns deleted -->
    </toolkit:DataGrid.Columns>
</toolkit:DataGrid>


I think what is happening is that the CellTemplate is handling the RadioButton click, so the CellEditingTemplate never gets to fire BeginEdit... Does that make sense?

If I remove the DataGridTemplateColumn.CellTemplate, I can see the BeginEdit / EndEdit being fired.

This is also being used in a MVVM pattern, so I wanted to avoid handling mouseclicks.

It seems using a RadioButton in this way would be a fairly common requirement - I must be missing something. Can anyone point me in the right direction?

Thanks, Tim
AnswerRe: WPF DataGrid with DataGridTemplateColumn and RadioButton Pin
Suthagar.p25-Nov-09 21:56
Suthagar.p25-Nov-09 21:56 
QuestionHas anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 8:07
fred_21-Oct-09 8:07 
QuestionRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 8:52
Mark Salsbery21-Oct-09 8:52 
AnswerRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 8:54
fred_21-Oct-09 8:54 
QuestionRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 8:59
Mark Salsbery21-Oct-09 8:59 
AnswerRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:00
fred_21-Oct-09 9:00 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 9:19
Mark Salsbery21-Oct-09 9:19 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:22
fred_21-Oct-09 9:22 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
fred_21-Oct-09 9:45
fred_21-Oct-09 9:45 
GeneralRe: Has anyone been able to make a Silverlight socket policy server work with port forwarding? Pin
Mark Salsbery21-Oct-09 10:05
Mark Salsbery21-Oct-09 10:05 
QuestionRadioButton DataBinding, without code-behind Pin
hhrafn21-Oct-09 6:38
hhrafn21-Oct-09 6:38 
QuestionRe: RadioButton DataBinding, without code-behind Pin
Mark Salsbery21-Oct-09 6:51
Mark Salsbery21-Oct-09 6:51 
AnswerRe: RadioButton DataBinding, without code-behind Pin
hhrafn22-Oct-09 0:50
hhrafn22-Oct-09 0:50 
GeneralRe: RadioButton DataBinding, without code-behind Pin
Gideon Engelberth22-Oct-09 5:31
Gideon Engelberth22-Oct-09 5:31 
GeneralRe: RadioButton DataBinding, without code-behind Pin
Mark Salsbery22-Oct-09 6:13
Mark Salsbery22-Oct-09 6:13 
GeneralRe: RadioButton DataBinding, without code-behind Pin
ausadmin22-Oct-09 9:36
ausadmin22-Oct-09 9:36 
GeneralRe: RadioButton DataBinding, without code-behind Pin
hhrafn23-Oct-09 5:15
hhrafn23-Oct-09 5:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.