Good morning. I'm Eugene Buzin from Russia.
In my WPF application I created a LINQ to SQL entities class. Then I created a partial class and there add code to my entity class. Below is the code of it:
Then I executed LINQ to SQL. Works perfectly well. Then I bound WPF Datagrid radiobutton column to is_selected property of the partial class. Below is XAML code:
And here I have the problem. When I'm changing the radiobutton status from Unchecked to Checked it doesn't change the value of is_selected property from false to true in the partial class. I don't know why. Please help me if you can.
Yours sincerely Eugene Buzin.
In my WPF application I created a LINQ to SQL entities class. Then I created a partial class and there add code to my entity class. Below is the code of it:
Code:
namespace Mynamespace { partial class rts_index { #region Fields /// <summary> /// Status: /// "Selected" - true, "Unselected" - false. /// </summary> private bool _is_selected; #endregion #region Properties /// <summary> /// Get or set the status: /// "Selected" - true, "Unselected" - false. /// </summary> public bool is_selected { get { return this._is_selected; } set { this._is_selected = value; } } #endregion } }
Code:
. . . <Window.Resources> <CollectionViewSource x:Key="rts_indexViewSource" d:DesignSource="{d:DesignInstance my:rts_index, CreateList=True}" /> </Window.Resources> . . . <DataGrid Name="dgStockMarketIndex" Grid.Column="1" Grid.Row="1" AutoGenerateColumns="False" Margin="10" SelectionMode="Extended" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" ItemsSource="{Binding Source={StaticResource rts_indexViewSource}}"> <DataGrid.Columns> <DataGridTemplateColumn Header="Selected"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <RadioButton GroupName="IndexSelection" IsChecked="{Binding Path=is_selected, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn . . .
Yours sincerely Eugene Buzin.
Comment