Hello,
in a grid view with filter:
Hi! I know how to set a custom style for the field of a property grid but I cant figure out how I am supposed to make that style bound to anything that is relative to the specific PropertyDefinition of that field.
The PropertyGridField's PropertyDefinition is the default source the style's binding. The binding path of the PropertyDefinition might be "Communication.Timeout" but I want to bind the FontWeight property to "Communication.TimeoutProperty.Mode". How can this be done?
Do I have to create a subclass of PropertyDefinition with my own dependency properties on to be able to do this?
<
telerik:RadPropertyGrid
Name
=
"PropertyGrid"
IsGrouped
=
"True"
Item
=
"{Binding SelectedItem}"
EditMode
=
"Single"
RenderMode
=
"Flat"
FieldStyle
=
"{DynamicResource PropertyGridFieldStyle}"
AutoGeneratePropertyDefinitions
=
"False"
>
<
telerik:RadPropertyGrid.Resources
>
<
Style
x:Key
=
"PropertyGridFieldStyle"
TargetType
=
"{x:Type telerik:PropertyGridField}"
BasedOn
=
"{StaticResource PropertyGridFieldStyle}"
>
<
Setter
Property
=
"FontWeight"
Value
=
"{Binding Path=???}"
/>
</
Style
>
</
telerik:RadPropertyGrid.Resources
>
</
telerik:RadPropertyGrid
>
<
Page
x:Class
=
"GridTest.Page1"
mc:Ignorable
=
"d"
Title
=
"SomePage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:controls
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
xmlns:my
=
"clr-namespace:GridTest"
xmlns:gridview
=
"clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
>
<
Page.Resources
>
<
my:NorthwindOADataSet
x:Key
=
"northwindOADataSet"
/>
<
CollectionViewSource
x:Key
=
"employeesViewSource"
Source
=
"{Binding Path=Employees, Source={StaticResource northwindOADataSet}}"
/>
<
ControlTemplate
x:Key
=
"ImageCellTemplate"
TargetType
=
"{x:Type telerik:GridViewCell}"
>
<
Rectangle
RadiusX
=
"5"
RadiusY
=
"100"
Height
=
"100"
>
<
Rectangle.Fill
>
<
ImageBrush
x:Name
=
"brush"
ImageSource
=
"{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}"
></
ImageBrush
>
</
Rectangle.Fill
>
</
Rectangle
>
</
ControlTemplate
>
<
ControlTemplate
x:Key
=
"MyCustomRowTemplate"
TargetType
=
"{x:Type telerik:GridViewRow}"
>
<
Border
Background
=
"Transparent"
Name
=
"selectedRow"
Margin
=
"0"
Opacity
=
"1"
BorderThickness
=
"0,1,0,1"
VerticalAlignment
=
"Center"
>
<
Grid
Width
=
"400"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"30"
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"35"
/>
<
ColumnDefinition
Width
=
"120"
/>
<
ColumnDefinition
Width
=
"100"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
Border
Height
=
"Auto"
HorizontalAlignment
=
"Left"
Background
=
"#FF233052"
Margin
=
"2,1,0,0"
Width
=
"400"
BorderBrush
=
"#FFFFFFFF"
CornerRadius
=
"5,5,5,5"
BorderThickness
=
"1"
Grid.ColumnSpan
=
"4"
>
</
Border
>
<
Border
Height
=
"Auto"
Grid.Row
=
"1"
HorizontalAlignment
=
"Left"
Background
=
"#FF5E78BA"
Margin
=
"2,1,0,0"
Width
=
"400"
BorderBrush
=
"#FFFFFFFF"
CornerRadius
=
"5,5,5,5"
BorderThickness
=
"1"
Grid.ColumnSpan
=
"4"
Grid.RowSpan
=
"4"
>
</
Border
>
<
gridview:GridViewCell
Grid.Row
=
"0"
Grid.Column
=
"1"
Foreground
=
"#FFFFFFFF"
Width
=
"200"
Margin
=
"0,5,0,0"
HorizontalAlignment
=
"Left"
Name
=
"FirstName"
TextBlock.FontSize
=
"16"
VerticalAlignment
=
"Center"
/>
<
gridview:GridViewCell
Grid.Row
=
"0"
Grid.Column
=
"2"
Grid.ColumnSpan
=
"2"
Foreground
=
"#FFFFFFFF"
Width
=
"200"
Margin
=
"0,5,0,0"
HorizontalAlignment
=
"Left"
Name
=
"Title"
TextBlock.FontSize
=
"16"
VerticalAlignment
=
"Center"
/>
<
gridview:GridViewCell
Name
=
"LastName"
TextBlock.Foreground
=
"#FFC4D2EF"
Grid.Row
=
"1"
Grid.Column
=
"0"
Grid.RowSpan
=
"3"
Width
=
"100"
Margin
=
"10,0,0,12"
>
<
gridview:GridViewCell.LayoutTransform
>
<
TransformGroup
>
<
RotateTransform
Angle
=
"270"
/>
</
TransformGroup
>
</
gridview:GridViewCell.LayoutTransform
>
</
gridview:GridViewCell
>
<
gridview:GridViewCell
Name
=
"Photo"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
Template
=
"{StaticResource ImageCellTemplate}"
Margin
=
"10,50,10,20"
Grid.Column
=
"1"
Grid.Row
=
"0"
Grid.RowSpan
=
"4"
/>
<
Label
Grid.Column
=
"2"
Foreground
=
"FFC4D2EF"
Grid.Row
=
"1"
Content
=
"Street Address"
/>
<
Label
Grid.Column
=
"2"
Foreground
=
"FFC4D2EF"
Grid.Row
=
"2"
Content
=
"City:"
/>
<
Label
Grid.Column
=
"2"
Foreground
=
"FFC4D2EF"
Grid.Row
=
"3"
Content
=
"HomePhone:"
/>
<
gridview:GridViewCell
Grid.Column
=
"3"
TextBlock.Foreground
=
"#FFFFFFFF"
Grid.Row
=
"1"
Name
=
"Address"
>
<
gridview:GridViewCell.Template
>
<
ControlTemplate
>
<
TextBlock
TextWrapping
=
"Wrap"
Text
=
"{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Context}"
/>
</
ControlTemplate
>
</
gridview:GridViewCell.Template
>
</
gridview:GridViewCell
>
<
gridview:GridViewCell
TextBlock.Foreground
=
"#FFFFFFFF"
Grid.Column
=
"3"
Grid.Row
=
"2"
Name
=
"City"
/>
<
gridview:GridViewCell
TextBlock.Foreground
=
"#FFFFFFFF"
Grid.Column
=
"3"
Grid.Row
=
"3"
Name
=
"HomePhone"
/>
<
gridview:GridViewCell
Grid.Column
=
"1"
Grid.ColumnSpan
=
"3"
Grid.Row
=
"4"
TextBlock.Foreground
=
"#FFFFFFFF"
Name
=
"Notes"
>
<
gridview:GridViewCell.Template
>
<
ControlTemplate
>
<
TextBlock
TextWrapping
=
"Wrap"
Text
=
"{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Context}"
/>
</
ControlTemplate
>
</
gridview:GridViewCell.Template
>
</
gridview:GridViewCell
>
</
Grid
>
</
Border
>
</
ControlTemplate
>
<
Style
TargetType
=
"{x:Type gridview:GridViewRow}"
>
<
Setter
Property
=
"telerik:GridViewRow.Template"
Value
=
"{StaticResource MyCustomRowTemplate}"
/>
</
Style
>
</
Page.Resources
>
<
Grid
DataContext
=
"{StaticResource employeesViewSource}"
>
<
controls:RadGridView
HorizontalAlignment
=
"Left"
Name
=
"radGridView1"
VerticalAlignment
=
"Top"
ScrollMode
=
"RealTime"
IsReadOnly
=
"True"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding}"
>
<
controls:RadGridView.Columns
>
<
controls:GridViewDataColumn
DataType
=
"{x:Null}"
UniqueName
=
"EmployeeID"
/>
<
controls:GridViewDataColumn
DataType
=
"{x:Null}"
UniqueName
=
"LastName"
/>
<
controls:GridViewDataColumn
DataType
=
"{x:Null}"
UniqueName
=
"Photo"
IsSortable
=
"True"
/>
<
controls:GridViewDataColumn
DataType
=
"{x:Null}"
UniqueName
=
"Title"
/>
<
controls:GridViewDataColumn
DataType
=
"{x:Null}"
UniqueName
=
"City"
/>
<
controls:GridViewDataColumn
DataType
=
"{x:Null}"
UniqueName
=
"HomePhone"
/>
</
controls:RadGridView.Columns
>
</
controls:RadGridView
>
</
Grid
>
</
Page
>
Source Code is not much
public Page1()
{
InitializeComponent();
var dbdata = new NorthwindOADataSetTableAdapters.EmployeesTableAdapter();
radGridView1.DataContext = dbdata.GetData();
}
Hi,
in the ScheduleView control, I fill the control with appointments and SpecialSlots from 8AM to 4PM. Using the mousewheel cause that sometime, the SpecialSlots become not visible!!! When this occured, I need to force a refresh by scrolling a little bit then the SpecialSlots become visible...
Demo included (rename the JPG file to ZIP)...
Thank's
Alain
<
telerik:RadGridView
Grid.Row
=
"11"
Grid.Column
=
"1"
Grid.ColumnSpan
=
"4"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding WorkflowView}"
RowHeight
=
"25"
CanUserFreezeColumns
=
"False"
telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled
=
"True"
IsSynchronizedWithCurrentItem
=
"True"
IsEnabled="{Binding ModelController.WorkflowHelper.IsWorkflowEditing,
Converter={StaticResource InvertBoolConv}}">
<
telerik:RadGridView.Resources
>
<
Style
x:Key
=
"CellBGStyle"
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value="{Binding
Path
=
BackcolorHex
,
Converter={StaticResource HexToColorConv}}">
</
Setter
>
</
Style
>
</
telerik:RadGridView.Resources
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Farbe"
CellStyle
=
"{StaticResource CellBGStyle}"
DataMemberBinding="{Binding
Path
=
BackcolorHex
,
Converter={StaticResource HexToColorConv}}"
IsReadOnly
=
"True"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
public
object
Convert(
object
value, Type targetType,
object
parameter,
CultureInfo culture)
{
Brush retVal =
new
SolidColorBrush(Colors.White);
if
(value !=
null
&& value
is
ModelWorkflow)
{
myConverter conv =
new
myConverter();
retVal = conv.ToBrush(((ModelWorkflow)value).BackcolorHex);
}
return
retVal;
}
Hi,
I have a project using various Telerik controls. The wizard set up my project so that the binaries are in the project tree like this:
<MyProjectPath>\lib\RCWPF\2015.1.401.45\
I want to move this whole "2015.1.401.45" directory somewhere and point my references there. That would allow me to have multiple projects reference the binaries without the need to have 83 MB of extra binaries in each project.
If I move the files and re-point the references, I can no longer use the RadGridView. Visual Studio 2013 just can't find it.
Can I move the Telerik binaries and point references to the new location? Are there any tricks involved in the process?
Thanks.
Hi
This is probably a simple thing to achieve but I'm struggling to come up with the solution!
For tasks without children there is currently no expand/collapse image displayed in the tree cell as you would expect. However, for tasks without children at level 1 would it be possible to display an image - for example a simple bullet-point style image?
Many thanks
Adrian
I have the problem, that the filter in the Telerik RadGridView has a wrong formatting for date fields. In the grid it self they are drawn correctly. I use the format: dd.mm.yyyy
Please take a look at the attached screenshot.
I set the column culture like this:
GridViewBoundColumnBase column =
new
GridViewDataColumn();
column.Language = System.Windows.Markup.XmlLanguage.GetLanguage(
"de-DE"
);
this
.IsLocalizationLanguageRespected =
true
;
// this is the instance of the RadGridView
Thank you!