Hi,
My Grid is loading its data by a user request. So when the Grid is loaded at the startup it is empty.
When the grid is loaded with data by a command that user selects I need to select the first row and set the focus to the first cell of that row. I am using RowLoaded event in this code to accomplish this:
private void SearchGrid_RowLoaded(object sender, RowLoadedEventArgs e)
{
//Set the focus to first cell after the last row is loaded
if (SearchGrid.ChildrenOfType<
GridViewCell
>().Count() > 0)
{
if (e.DataElement == SummaryList[SummaryList.Count() - 1])
{
SearchGrid.SelectedItem = SummaryList[0];
SearchGrid.ChildrenOfType<
GridViewCell
>().First().Focus();
}
}
}
As a proof of concept I have tried to adjust the CircleRevealTransitionsEffect to support telerik doing as follows:
Changed the "CircleRevealTransitionEffect" to inherit from BaseTransitionEffect (I assume that this might be the problem)
public
class
CircleRevealTransitionEffect : Telerik.Windows.Controls.TransitionEffects.BaseTransitionEffect
And the added a new class "CircleRevealTransitionProvider"
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
Telerik.Windows.Controls.TransitionControl;
using
System.Windows.Media.Effects;
namespace
TransitionEffects.TelerikProviders
{
public
class
CircleRevealTransitionProvider : TransitionProvider
{
protected
override
ShaderEffect CreateTransitionEffect()
{
CircleRevealTransitionEffect effect =
new
CircleRevealTransitionEffect();
return
effect;
}
}
}
Everything compiles nicely but using the transition gives an runtime error: "transitioncontrol/transitioneffects/effects/circlerevealtransitioneffect.ps". Do you have a clue to what can be the problem.
I know that my question will force you to install WPF Shader Effect library yourself, but if this is a problem I will try minimize the size of the library and attach my own version here. But I guess it is more simple for you to download the complete source from CodePlex. Remeber to install the "Shader Effect Build Task and Effects" to be able to compile it all. It's works smoothly.
http://wpf.codeplex.com/releases/view/14962#DownloadId=40167
Looking forward to hear from you.
Hi,
I'm using RadGridView to display object's properties, like a PropertyGrid.
I need to change the template of the cell according to the type of the property.
I defined templates for text, color, and enum, also two template selectors, one for edit and one for normal mode.
For example, an enum should be edit by choosing an item out of a combobox and to be displayed in a TextBlock.
The problem, is when I set the enum template for both the edit selector and normal selector, the combobox is not displayed in edit mode, like this template is ignored.
In resources:
<DataTemplate x:Key="TextPropertyValueEditTemplate">
<TextBox Text="{Binding PropertyValue, Mode=TwoWay}" />
</DataTemplate>
<DataTemplate x:Key="ColorPropertyValueEditTemplate">
<telerik:RadColorPicker SelectedColor="{Binding PropertyValue, Mode=TwoWay}" ColorButtonStyle="{StaticResource ColorButtonStyle}" />
</DataTemplate>
<DataTemplate x:Key="EnumPropertyValueEditTemplate">
<ComboBox Text="{Binding PropertyValue, Mode=OneWay}"
SelectedValue="{Binding PropertyValue, Mode=TwoWay}"
ItemsSource="{Binding EnumNames}" />
</DataTemplate>
<DataTemplate x:Key="EnumPropertyValueNormalTemplate"><TextBox Text="{Binding PropertyValue}" />
<Controls:PropertyValueDataTemplateSelector x:Key="PropertyValueEditTemplateSelector"
TextTemplate="{StaticResource TextPropertyValueEditTemplate}"
ColorTemplate="{StaticResource ColorPropertyValueEditTemplate}"
EnumTemplate="{StaticResource EnumPropertyValueEditTemplate}"
/>
<Controls:PropertyValueDataTemplateSelector x:Key="PropertyValueTemplateSelector"
ColorTemplate="{StaticResource ColorPropertyValueEditTemplate}"
EnumTemplate="{StaticResource TextPropertyValueEditTemplate}"
/>
In the grid:
<telerik:RadGridView Name="dataGrid1"
AutoGenerateColumns="False"
ShowGroupPanel="False"
ShowColumnHeaders="False"
>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Name" Width="120"
DataMemberBinding="{Binding PropertyName}"/>
<telerik:GridViewDataColumn Header="Value" Width="100*"
DataMemberBinding="{Binding PropertyValue}"
CellTemplateSelector="{StaticResource PropertyValueTemplateSelector}"
CellEditTemplateSelector="{StaticResource PropertyValueEditTemplateSelector}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Now, I know one way to make this sample work, is just to remove the EnumTemplate
from propertyValueTemplateSelector (Normal), It will work, but I have other types I want to
display differently in edit and normal mode.
Appreciate for any help.
<
telerikNavigation:RadPanelBar
Grid.Row
=
"1"
Margin
=
"10"
telerik:StyleManager.Theme
=
"Windows7"
x:Name
=
"pbPanels"
ItemsSource
=
"{Binding NavigationsPanelItems}"
SelectedItem
=
"{Binding SelectedPanelItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath
=
"DisplayName"
>
</
telerikNavigation:RadPanelBar
>
<
HierarchicalDataTemplate
DataType
=
"{x:Type vm:TPNavigationGeneralInfoViewModel}"
ItemTemplate
=
"{StaticResource pbiGeneralInfoTemplate}"
ItemsSource
=
"{Binding PanelBarContent}"
>
<
TextBlock
Text
=
"{Binding DisplayName}"
Height
=
"20"
Margin
=
"5 2 5 2"
FontWeight
=
"Bold"
FontSize
=
"16"
/
</
HierarchicalDataTemplate
>
<telerikPresentation:RadButton BorderBrush="Blue" BorderThickness="1" ClickMode="Press" FontSize="20" Margin="162,0,0,9" Name="btnNew" Click="btnNew_Click" Height="40" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="90">
<telerikPresentation:RadButton.Effect>
<DropShadowEffect ShadowDepth="5" />
</telerikPresentation:RadButton.Effect>
<StackPanel Height="28" HorizontalAlignment="Left" Orientation="Horizontal" VerticalAlignment="Top" Width="81" >
<Image Height="28" Source="/icons/truck_blue.png" Width="30" />
<TextBlock FontSize="14" Foreground="Navy" Margin="9,0,0,0" Text="New" OverridesDefaultStyle="True" Height="27" Width="37" />
</StackPanel>
</telerikPresentation:RadButton>