Hi,
Scenario : I am having RadGridView, where I have to implement a table. This Table helps me in setting the UI setting of the application for the RadDocking. Here RadPanes can be pinned, unpinned, Hide and Open.
so, First column is having the Property names (pin, unpin, Hide) and other columns are having the panes names. One pane can have one property out of (pin,unpin and Hide). So, I defined the template for radiobutton column which is been grouped to select one radio button in the respective group.
For more information underneath I am attaching the xaml and .cs code for the same and the image for your reference -
XAML
Code Behind -
Requirement : I need to replace Property names to Panes names and implement the same logic. Means, first column woukd be of panes and other column would be having the properties (pin,unpin, hide). For your reference I am attaching the image (UI-Setting2.png).
Problem: To implement the same, I need to group radiobuttons is column, can I do the same as I am not able to group the radiobuttons in row. Is there any way to implement the same.
Scenario : I am having RadGridView, where I have to implement a table. This Table helps me in setting the UI setting of the application for the RadDocking. Here RadPanes can be pinned, unpinned, Hide and Open.
so, First column is having the Property names (pin, unpin, Hide) and other columns are having the panes names. One pane can have one property out of (pin,unpin and Hide). So, I defined the template for radiobutton column which is been grouped to select one radio button in the respective group.
For more information underneath I am attaching the xaml and .cs code for the same and the image for your reference -
XAML
UserControl.Resources>
<
DataTemplate
x:Key
=
"RadioColumnTemplate1"
>
<
RadioButton
x:Name
=
"editBtn1"
Height
=
"20"
Width
=
"20"
Checked
=
"editBtn_Checked"
GroupName
=
"GroupNavigate"
Tag
=
"{Binding UPPane}"
/>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"RadioColumnTemplate2"
>
<
RadioButton
x:Name
=
"editBtn2"
Height
=
"20"
Width
=
"20"
Checked
=
"editBtn_Checked"
GroupName
=
"GroupAssignment"
Tag
=
"{Binding UPPane}"
/>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"RadioColumnTemplate3"
>
<
RadioButton
x:Name
=
"editBtn3"
Height
=
"20"
Width
=
"20"
Checked
=
"editBtn_Checked"
GroupName
=
"GroupMessageNotification"
Tag
=
"{Binding UPPane}"
/>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"RadioColumnTemplate4"
>
<
RadioButton
x:Name
=
"editBtn4"
Height
=
"20"
Width
=
"20"
Checked
=
"editBtn_Checked"
GroupName
=
"GroupStatusMessage"
Tag
=
"{Binding UPPane}"
/>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"RadioColumnTemplate5"
>
<
RadioButton
x:Name
=
"editbtn5"
Height
=
"20"
Width
=
"20"
GroupName
=
"GroupAll"
Tag
=
"{Binding UPPane}"
/>
</
DataTemplate
>
<!--<
DataTemplate
x:Key
=
"RadRadioColumnTemplate"
>
<
telerik:RadRadioButton
x:Name
=
"editBtn"
Content
=
"Radio Item"
GroupName
=
"one"
IsChecked
=
"True"
/>
</
DataTemplate
>-->
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
telerik:RadGridView
x:Name
=
"MyGrid"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding UPPaneNameCollection, Mode=TwoWay}"
RowIndicatorVisibility
=
"Collapsed"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Pane Property"
HeaderTextAlignment
=
"Center"
DataMemberBinding
=
"{Binding UPPane}"
IsFilterable
=
"False"
Width
=
"*"
/>
<
telerik:GridViewColumn
Header
=
"Navigate"
HeaderTextAlignment
=
"Center"
CellTemplate
=
"{StaticResource RadioColumnTemplate1}"
Width
=
"*"
/>
<
telerik:GridViewColumn
Header
=
"Assignment"
HeaderTextAlignment
=
"Center"
CellTemplate
=
"{StaticResource RadioColumnTemplate2}"
Width
=
"*"
/>
<
telerik:GridViewColumn
Header
=
"Message Notification"
HeaderTextAlignment
=
"Center"
CellTemplate
=
"{StaticResource RadioColumnTemplate3}"
Width
=
"*"
/>
<
telerik:GridViewColumn
Header
=
"Satus Message"
HeaderTextAlignment
=
"Center"
CellTemplate
=
"{StaticResource RadioColumnTemplate4}"
Width
=
"*"
/>
<!--<telerik:GridViewColumn Header="All" HeaderTextAlignment="Center" CellTemplate="{StaticResource RadioColumnTemplate5}" Width="*" />-->
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
Code Behind -
public partial class UPPaneSettingView : UserControl
{
public UPPaneSettingView()
{
UPPaneSettingViewModel model = new UPPaneSettingViewModel();
this.DataContext = model;
InitializeComponent();
// data binding
RegionContext.GetObservableContext(this).PropertyChanged += (s, e) =>
model.tempProperty = RegionContext.GetObservableContext(this).Value as string;
}
private void editBtn_Checked(object sender, RoutedEventArgs e)
{
string _GroupName = ((System.Windows.Controls.RadioButton)sender).GroupName.ToString();
string _PaneProperty = ((System.Windows.Controls.RadioButton)sender).Tag.ToString();
IRegionManager regionManager = ServiceLocator.Current.GetInstance<
IRegionManager
>();
// MainPageview is having the RadDocking and I am passing the RadPane names here
EverestMainApplication.MainPageView mainPageView = (EverestMainApplication.MainPageView)EverestFunctions.GetView(ViewNames.MainPageView, regionManager.Regions[Regions.LoginScreenRegion]);
switch (_GroupName)
{
case "GroupNavigate":
switch (_PaneProperty)
{
case "UnPin":
mainPageView.PaneNavigationCommonModulRegion.IsPinned = false;
break;
case "Pin":
mainPageView.PaneNavigationCommonModulRegion.IsPinned = true;
break;
}
break;
case "GroupAssignment":
switch (_PaneProperty)
{
case "UnPin":
mainPageView.PaneAssignmentRegion.IsPinned = false;
break;
case "Pin":
if (mainPageView.PaneAssignmentRegion.IsHidden == true)
{
mainPageView.PaneAssignmentRegion.IsHidden = false;
}
mainPageView.PaneAssignmentRegion.IsPinned = true;
break;
case "Hide":
mainPageView.PaneAssignmentRegion.IsHidden = true;
break;
}
break;
case "GroupMessageNotification":
switch (_PaneProperty)
{
case "UnPin":
mainPageView.PaneMessageNotificationRegion.IsPinned = false;
break;
case "Pin":
if (mainPageView.PaneAssignmentRegion.IsHidden == true)
{
mainPageView.PaneAssignmentRegion.IsHidden = false;
}
mainPageView.PaneMessageNotificationRegion.IsPinned = true;
break;
case "Hide":
mainPageView.PaneMessageNotificationRegion.IsHidden = true;
break;
}
break;
case "GroupStatusMessage":
switch (_PaneProperty)
{
case "UnPin":
mainPageView.PaneStatusMessageRegion.IsPinned = false;
break;
case "Pin":
if (mainPageView.PaneAssignmentRegion.IsHidden == true)
{
mainPageView.PaneAssignmentRegion.IsHidden = false;
}
mainPageView.PaneStatusMessageRegion.IsPinned = true;
break;
case "Hide":
mainPageView.PaneStatusMessageRegion.IsHidden = true;
break;
}
break;
};
}
}
Requirement : I need to replace Property names to Panes names and implement the same logic. Means, first column woukd be of panes and other column would be having the properties (pin,unpin, hide). For your reference I am attaching the image (UI-Setting2.png).
Problem: To implement the same, I need to group radiobuttons is column, can I do the same as I am not able to group the radiobuttons in row. Is there any way to implement the same.