Greetings
Currently I'm not that experienced with styles in WPF and after some research I decided to give it a shot to ask.
I'm working with with the RadGridView and I'd like to change the Foreground of the header of a sorted column.
Within the styles of Telerik I found there are some visual states to determine the colour of the border or for the ascending/ descending arrow. Yet there is no description to change the colour of the Foreground.
Yet doing some research, I found some code to add to change the Foreground as well within the VisualState.
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(TextBlock.Foreground)"> <DiscreteObjectKeyFrame KeyTime="0" Value="White" /></ObjectAnimationUsingKeyFrames>Yet, this isn't working. This entirely breaks the VisualState of 'Ascending'/ 'Descending' and the following exception within Output can be found:
A first chance exception of type 'System.InvalidOperationException' occurred in PresentationFramework.dllSorry for asking perhaps a dumb question. I'm still in the learning process of Telerik styles and WPF styles in general.
Kind regards
Kenneth
<DataTemplate x:Name="editCellTemplate"> <Grid> <TextBox MaxLength="100" Margin="5,3" Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:GridViewCell}}}" Text="{Binding Label, Mode=TwoWay}" /> </Grid></DataTemplate><telerik:RadGridView Margin="10" MinHeight="300" RowHeight="30" HorizontalAlignment="Left" VerticalAlignment="Top" AutoGenerateColumns="False" IsFilteringAllowed="False" CanUserInsertRows="True" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserReorderColumns="False" ShowGroupPanel="False" ShowInsertRow="True" ItemsSource="{Binding SourceView, Mode=OneWay}"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn x:Name="Label" Header="Label" Width="300" DataMemberBinding="{Binding Label, Mode=TwoWay}" CellEditTemplate="editCellTemplate" /> <telerik:GridViewCheckBoxColumn x:Name="Inactive" Header="Inactive" DataMemberBinding="{Binding IsDeleted, Mode=TwoWay}" Width="Auto" /> </telerik:RadGridView.Columns></telerik:RadGridView><telerik:GridViewDataColumn.CellStyle> <Style> <Setter Property="TextBox.MaxLength" Value="100" /> <Setter Property="TextBox.Margin" Value="5" /> <Setter Property="TextBox.Width" Value="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:GridViewCell}}}" /> </Style></telerik:GridViewDataColumn.CellStyle>Hi,
I'm using Isolated Storage, and save a value to both the TreeListView and it's GridViewDataColumn...but when my page comes up the saved sorting value is not being used, so I have to use a third value and read it and manually sort:
XAML:
<telerik:Label x:Name="ProjectTreeViewOrdering" Content="ASC" Visibility="Collapsed" telerik:PersistenceManager.StorageId="THOR_ProjectsTreeSorting" />
CODE:
string[] projectsSortingIsolatedStorage = { "THOR_ProjectsTreeSorting" };
private void OnWindowLoaded(object sender, EventArgs e)
{
isoProvider.LoadFromStorage(projectsSortingIsolatedStorage);
IEnumerable<TreeProjectViewModel> projects = ProjectsTreeView.ItemsSource as IEnumerable<TreeProjectViewModel>;
if (ProjectTreeViewOrdering.Content.Equals("Ascending"))
{
ProjectsTreeView.ItemsSource = projects.OrderBy(p => p.Name);
}
else if (ProjectTreeViewOrdering.Content.Equals("Descending"))
{
ProjectsTreeView.ItemsSource = projects.OrderByDescending(p => p.Name);
}
...which gets my TreeListView sorted, but then all the Groups collapse, which I don't want.
Using "ExpandAllGroups" had no effect.
If anyone has a better and more proper way to sort, save, and load a RadTreeListView that has a GridViewDataColumn defined within it, I sure would love to know about it. To get the list sorting to persist, I currently have a value save in the TreeListView, the GridViewDataColumn, and a "desperate" label as seen above.3 values seems like overkill to get the job done. I found without the value int he GridViewDataColumn being saved, I'd get no arrows in the TreeListView control, which was bad. Without the label value being stored, I got no sorting capability....so it's all bad at the moment.
Barry
Hi, I have a RadGridView which is setup to have:
RowVirtualization=True
ColumnVirtualization=True
SelectionMode=Extended
ClipboardCopymode=Cells,Header
AutoGenerateColumns=False
There are 6 columns in this grid all bound to strings similar to
<telerik:GridViewDataColumn Header="FirstName" DataMemberBinding="{Binding Name}">
I have populated the grid with ~60,000 records
Pressing ctrl+A to select all takes about 3 seconds (which I am ok with I guess)
My problem is pressing Ctrl+C to copy all the rows just freezes the UI and it never finishes (I force closed the app after about 5 minutes if I walk away for about 20 it finishes eventually)
Why does copying all these rows take so long? Is there a way I can speed it up?
I made sure I populated the grid completely first so all this time taken is purely the copy method?
Hello,
I am using a RadGridView with a RadDataPager to display a collection of items.
I use a GridViewSelectColumn to enable to select some of these items and to perform actions only on those who are selected.
My issue is that when I check the GridViewSelectColumn of some items, if I change the page and that I go back to the previous one, the items are not selected anymore.
I searched the forum and tried a few things but nothing worked.
Thanks in advance.
Regards,
Adrien.
Hello,
when I bind the TaskSource of the RadGanttView (WPF) to a CompositeCollection I get the Exception "Object of Type System.Windows.Data.CollectionContainer cannot be converted to Type IGanttTask". With the RadTreeView it works. All Items in the Collections implements IGanttTask.
<CompositeCollection x:Key="ProjectChildCollection"><br> <CollectionContainer Collection="{Binding DataContext.SelectedProject.ProjectActions, Source={x:Reference control}}" /><br> <CollectionContainer Collection="{Binding DataContext.SelectedProject.Tasks, Source={x:Reference control}}" /><br> <CollectionContainer Collection="{Binding DataContext.SelectedProject.ResourceBookings, Source={x:Reference control}}" /><br> </CompositeCollection>
TasksSource="{Binding Source={StaticResource ProjectChildCollection}}"Hello,
I'm using RadTabControl with TabStripPlacement="Left"
In the past the RadTabItems were shown on the left side from top to bottom. Now they are placed from bottom to top. When changing the code to TabStripPlacement="Right" they are listed from top to bottom - like I want it happen on the left side.
I think I haven't changed anything. May it be a change in one of the two last versions?
Regards,
Raul
Hello!
I have started to use the RadLayoutControl and it works great. However I am wondering if it is possible to save the layout after the user has made some changes to it?
Hi all,
I am working on a WPF application using Telerik UI for Silverlight (http://demos.telerik.com/silverlight/#RichTextBox/TelerikEditor)
and coded in C# .NET.
I took the code of the previous link and set it
up to fit my needs.
I am now facing to an issue : How to directly load by
coding a .rtf document into a RadRichTextBox ?
I tried two ways :
RtfFormatProvider provider = new RtfFormatProvider();
RadDocument = null;
using (FileStream stream = new FileStream(FileName,
FileMode.Open))
{
document = provider.Import(stream);
}
DocumentFragment docFrag = new DocumentFragment(document);
radRichTextBox.InsertFragment(docFrag);
-> But that way causes an error because the “Import” method returns a
RadFlowDocument whereas I am expecting a RadDocument.
RtfFormatProvider provider = new RtfFormatProvider();
Telerik.Windows.Documents.Model.Section section = new Telerik.Windows.Documents.Model.Section();
Telerik.Windows.Documents.Model.Paragraph paragraph = new
Telerik.Windows.Documents.Model.Paragraph();
string line;
using (StreamReader stream = new StreamReader(FileName))
{
while ((line = stream.ReadLine()) != null)
{
Telerik.Windows.Documents.Model.Span span = new
Telerik.Windows.Documents.Model.Span(line);
try
{
paragraph.Inlines.Add(span);
}
catch(Exception e)
{
string x = e.StackTrace;
}
}
}
section.Blocks.Add(paragraph);
radRichTextBox.Document.Sections.Add(section);
-> There, even if there is no error, the problem is that nothing is shown
in the editor.
The most strange is that, when I run the program without trying to load any document at the opening, the window opens perfectly and all the buttons react with the right behavior (see attachment “RadRichTextBoxEditor.png”) but I am not allowed to load a .rtf document whereas it is allowed on the link provided at the top of this topic. (see attachment “notSupportedRTF.png”)
Any help or tip will be much appreciated :)
