Hello,
I'm having the following issue with the Serialization process in the diagram:
When I save the first time, it works great. (I can reload the layout several times and it works perfectly: my items go back to their saved positions)
However, if I saveLayout, then LoadLayout, the next time I'm going to call SaveLayout will fail because node is null in the GetNodeUniqueId override.
Any idea what could cause this? Thanks!
public class NodeViewModel : NodeViewModelBase{}public class DiagramViewModel : SerializableGraphSourceBase<NodeViewModel, LinkViewModel>{public override string GetNodeUniqueId(NodeViewModel node) { if (node == null) return string.Empty; // Should not happen (but happens on a saveLayout after a LoadLayout) return node.ID; }public override NodeViewModel DeserializeNode(IShape shape, SerializationInfo info) { NodeViewModel nodeViewModel = InternalItems.FirstOrDefault(p => p.DialogInfo.Tag == info["NodeUniqueIdKey"].ToString()); if (nodeViewModel == null) return null; string position = info["Position"].ToString(); string[] arr = position.Split(';'); nodeViewModel.Position = new Point(float.Parse(arr[0], CultureInfo.InvariantCulture), float.Parse(arr[1], CultureInfo.InvariantCulture)); return nodeViewModel; }}
Hi,
I am using the richtextbox with theming having a dark background. I now would like to permanently set the textforecolor to a light color (like white, depending on the selected dark theme) so that
1.) regular text is displayed with a light forecolor
2.) pasted plain text is inserted and displayed with a light forecolor
3.) richtext forecolor is changed to a light forecolor
4.) when using the color picker the 'automatic' color is the light forecolor that has been set recently.
what I have so for:
<DockPanel LastChildFill="True"> <telerik:RadRichTextBoxStatusBar DockPanel.Dock="Bottom" AssociatedRichTextBox="{Binding ElementName=richTextBox}" /> <telerik:RadRichTextBox x:Name="richTextBox" DockPanel.Dock="Top" Background="{Binding ''}" DocumentInheritsDefaultStyleSettings="True" Foreground="White" FontSize="12" IsContextMenuEnabled="True" IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="False" AcceptsReturn="True" AcceptsTab="True" CommandExecuting="richTextBox_CommandExecuting" > <telerik:RadRichTextBox.Resources> <Style TargetType="{x:Type telerik:DocumentWebLayoutPresenter}"> <Setter Property="Background" Value="Transparent" /> </Style> <Style TargetType="{x:Type telerik:DocumentPrintLayoutPresenter}"> <Setter Property="Background" Value="Transparent" /> </Style> <!--<Style TargetType="telerik:RadRichTextBox"> <Setter Property="Background" Value="{DynamicResource ContainerBackgroundBrush}" /> </Style>--> </telerik:RadRichTextBox.Resources> </telerik:RadRichTextBox></DockPanel>
public bool PasteAsPlaneText { get; set; } = true;private void richTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e){ if (e.Command is PasteCommand) { if (PasteAsPlaneText) { e.Cancel = true; this.richTextBox.Insert(Clipboard.GetText()); } } }Until now I couldn't find a way to achieve this. How would I have to proceed to get this szenario implemented? Any example/solution?
Thanks in advance.
Hello,
Can anyone please explain to me how to resize the row height whenever the RadGridView height is changed at runtime?
Thanks in advance.
Hello,
Looks like this issue is with the theme. We are using two themes in our application. In ExpressionDark theme, the scroll bar is working fine in Gridview.
If we use Visual studio light theme, scroll bar is not moving when we click on the area below scroll bar. We are able to scroll the data by dragging the scroll bar or clicking on top and bottom icons.
Can anyone help with the issue.
TIA
I am using the below code to create an excel file:
Workbook workbook = new Workbook();
workbook.Worksheets.Add(); string fileName = "SampleFile.xlsx"; IWorkbookFormatProvider formatProvider = new XlsxFormatProvider(); using (FileStream output = new FileStream(fileName, FileMode.Create)) { formatProvider.Export(workbook, output); //System.OutOfMemoryException thrown here}
Hi,
I want to change the default header text. For example I have following properties
If user will group it by Id, then I want to show group header text like [Id]:[Title]. How can I do this?
Thanks,
Daler
Hi,
I'm new to WPF and Telerik controls.
I'm using trial version of Telerik controls.
I'm developing a WPF desktop application. For one of its UI, it requires some complex requirement to have a Hierarchical Grid View, with two dependent ComboBox columns, UpDownNumeric button in Text Column and AutoFilter/Sorting on Columns in child and parent grids.
I'm able to achieve the above by using telerik controls, but the styles of all the controls are not matching my current WPF UI Desktop application. The telerik controls shows up yellow and orange colors on mouse over and selection in all controls.
I would like to override this default behaviour with the coloring schemes as per my application.
Please let me know where to make the change so as to affect all the controls to override the default color styles.
Below is the code snippet of UI:
<DockPanel>
<DockPanel.Resources>
<DataTemplate x:Key="InnerTemplate" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<telerik:RadCollectionNavigator x:Name="collectionNavigator" CommandButtonsVisibility="All" Grid.Column="0" Grid.Row="0"
Visibility="Visible" Source="{Binding }" ScrollViewer.CanContentScroll="True"
SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"/>
<telerik:RadGridView x:Name="grid" ItemsSource="{Binding ElementName=collectionNavigator, Path=CollectionView}" Grid.Column="0" Grid.Row="1"
Height="600" AutoGenerateColumns="False" CanUserInsertRows="True"
IsReadOnly="False" SelectionMode="Single"
AlternationCount="2"
AlternateRowBackground="{x:Static SystemColors.ControlLightBrush}"
HorizontalGridLinesBrush="{x:Static SystemColors.ActiveBorderBrush}"
VerticalGridLinesBrush="{x:Static SystemColors.ActiveBorderBrush}"
BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
BorderThickness="0"
FontWeight="Normal"
VerticalContentAlignment="Stretch"
orizontalContentAlignment="Stretch"
Padding="0"
SnapsToDevicePixels="True"
ValidatesOnDataErrors="None">
<telerik:RadGridView.Columns>
<telerik:GridViewComboBoxColumn Header="Material"
DataMemberBinding="{Binding MaterialId, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Materials}"
SelectedValueMemberPath="MaterialId"
DisplayMemberPath="MaterialDescription"
EditTriggers="CellClick" Width="200" >
<telerik:GridViewComboBoxColumn.EditorStyle >
<Style TargetType="telerik:RadComboBox">
<Setter Property="OpenDropDownOnFocus" Value="True"/>
<Setter Property="Background" Value="{x:Static SystemColors.ControlLightBrush}"/>
</Style>
</telerik:GridViewComboBoxColumn.EditorStyle>
</telerik:GridViewComboBoxColumn>
<telerik:GridViewComboBoxColumn Header="Attribute Type" Width="200"
ItemsSourceBinding="{Binding DemoList,UpdateSourceTrigger=PropertyChanged}"
DataMemberBinding="{ Binding MaterialAttributeTypeId}"
DisplayMemberPath="Description"
SelectedValueMemberPath="MaterialAttributeTypeId"
EditTriggers="CellClick" >
<telerik:GridViewComboBoxColumn.EditorStyle>
<Style TargetType="telerik:RadComboBox">
<Setter Property="OpenDropDownOnFocus" Value="True"/>
<Setter Property="Background" Value="{x:Static SystemColors.ControlLightBrush}"/>
</Style>
</telerik:GridViewComboBoxColumn.EditorStyle>
</telerik:GridViewComboBoxColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ColumnWidth}" Width="200"
Header="Column Width" >
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadNumericUpDown Value="{Binding ColumnWidth}" UpdateValueEvent="PropertyChanged" />
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewCheckBoxColumn Header="Include ?" Width="200"
DataMemberBinding="{Binding IncludeInReport}"
EditTriggers="CellClick" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding ReportSequenceTag,Mode=TwoWay}" Width="100"
Header="Report Sequence" >
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadNumericUpDown Value="{Binding ReportSequenceTag}" UpdateValueEvent="PropertyChanged" />
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</DataTemplate>
</DockPanel.Resources>
<telerik:RadGridView EnableRowVirtualization="True" x:Name="HierarchicalGridView" DockPanel.Dock="Top"
AutoGenerateColumns="False" HierarchyChildTemplate="{StaticResource InnerTemplate }"
RowIndicatorVisibility="Collapsed" IsReadOnly="True" AlternationCount="2"
AlternateRowBackground="{x:Static SystemColors.ControlLightBrush}"
HorizontalGridLinesBrush="{x:Static SystemColors.ActiveBorderBrush}"
VerticalGridLinesBrush="{x:Static SystemColors.ActiveBorderBrush}"
BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
ShowGroupPanel="False"
ColumnWidth="*"
ValidatesOnDataErrors="None">
<telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition >
</telerik:GridViewTableDefinition>
</telerik:RadGridView.ChildTableDefinitions>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Report Name" DataMemberBinding="{Binding ReportName}">
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</DockPanel>
Hi there,
I'm trying to get the multiselection of the RadGridView working. I have a class Building with a Property IsSelected. With the Selection_Changed event i set/unset the property of the item. Is it possible to bind to the Building.IsSelected, so each row gets selected, if its object.IsSelected is true?
I know about the solution with behaviors, but I'd like one without it.
A little sample here:
<telerik:RadGridView x:Name="BuildingListGrid" ItemsSource="{Binding BuildingList}" EnableRowVirtualization="True"
SelectionUnit="FullRow" SelectionMode="Extended" SelectionChanged="MasterBuildingListGrid_OnSelectionChanged"> <telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Building.Name}" Header="Column2" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
public class Building : INotifyPropertyChanged
{
public Building(Building building){}
public bool IsSelected
{
get { return _isSelected; }
set
{
if (value == _isSelected) return;
_isSelected = value;
OnPropertyChanged();
}
}
public string Name { get; set; }
}
Telerik.Windows.Data.CompositeFilterDescriptor mainFilter = new Telerik.Windows.Data.CompositeFilterDescriptor();mainFilter.LogicalOperator = Telerik.Windows.Data.FilterCompositionLogicalOperator.Or;this.dgTaskManager.FilterDescriptors.SuspendNotifications();foreach (Telerik.Windows.Controls.GridViewColumn column in this.dgTaskManager.Columns){ //Add all active column filters to the main filter if (column.ColumnFilterDescriptor.IsActive) { mainFilter.FilterDescriptors.Add(column.ColumnFilterDescriptor); this.filteredColumnList.Add(column); }}this.dgTaskManager.FilterDescriptors.Clear();this.dgTaskManager.FilterDescriptors.Add(mainFilter);this.dgTaskManager.FilterDescriptors.ResumeNotifications();