Telerik Forums
UI for WPF Forum
5 answers
660 views

Hi,

I'm using *Telerik UI for WPF with C#*

I need to be able to sort the top node list of my RadTreeView alphabetically - that's it !

So the user clicks on the header row "Project" and it sorts ASC, click again and it toggles to DESC.

All the examples I've come across are for other Telerik platforms (web or winforms etc.).

My TreeView:

            <telerik:RadTreeView x:Name="ProjectsTreeView" Grid.Row="1"   
telerik:PersistenceManager.StorageId="THOR_ProjectTree" 
ItemsSource="{Binding ProjectData}"
ItemTemplate="{StaticResource Project}"
BorderBrush="Gray" 
ItemsIndent="0"
SelectionMode="Single"
SelectedItem="{Binding SelectedTreeViewItem, Mode=TwoWay}"
ItemContainerStyle="{StaticResource ItemContainerStyle}"
ItemClick="ProjetsTreeView_ItemClick"
BorderThickness="1"/>

 

Please advise (C#),

Barry

Martin Ivanov
Telerik team
 answered on 06 Jun 2016
1 answer
63 views

Hi,

I am having 5 RadGroup inside  RadSplitContainer in my View and data binding is happening through using PRISM and MVVM.

When the RadGroup is getting pinned and unpinned, that particular RadGroup is moving to last in the sequence.

I don't want this behavior. I want the group show in the same sequence as it is declared in XAML.

 

Please suggest how I Can achieved this behavior.

--

Thanks & Regrads

Manoj

 

 

Manoj
Top achievements
Rank 1
 answered on 06 Jun 2016
1 answer
591 views

Hi Team,

Doing hard reboot of the machine (power off by holding the power button and then pwer on again) where our App is running.

Launching the app again after hard reboot is failing with following exception:

Initialization of 'Telerik.Windows.Controls.RadProgressBar' threw an exception.

Exception Source: PresentationFramework

Exception Message: Initialization of 'Telerik.Windows.Controls.RadProgressBar' threw an exception.

Exception StackTrace:  

at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)

at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)

at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)

 at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)

at DomainManagerGUI.DomainGUI..ctor()

at DomainManagerGUI.App.DoLogin(Boolean bIsRedundancyRelogin, Boolean bEvent)

Inner Exception:

----->>>>>

Exception Source: System.Configuration

Exception Message: Configuration system failed to initialize

Exception StackTrace:

at System.Configuration.ConfigurationManager.PrepareConfigSystem()

at System.Configuration.ConfigurationManager.get_AppSettings()

at Telerik.Windows.Controls.ThemeResourceKey.get_ApplicationTheme()

at Telerik.Windows.Controls.StyleManager.SetDefaultStyleKey(Control control, Type controlType)  

at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)

Inner Exception:

----->>>>>

Exception Source: System.Configuration

Exception Message: Root element is missing (C:\Users\Administrator\AppData\Local\Harmonic,_Inc.\Harmonic.GUI.DomainManage_StrongName_ixapsog5lcwreuscruvj3lgrgpth3ywq\1.0.0.0\user.config)

Exception StackTrace:  

at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)

at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)

at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)

Inner Exception:

----->>>>>

Exception Source: System.Xml  

Exception Message: Root element is missing.  

Exception StackTrace:

at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)

at System.Xml.XmlTextReaderImpl.ParseDocumentContent()  

at System.Configuration.XmlUtil..ctor(Stream stream, String name, Boolean readToFirstElement, ConfigurationSchemaErrors schemaErrors)  

at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()  

 

We replaced the config file and it worked.

But,

Could you please let us know, what could cause this issue, and how can we prevent this.

 

Thanks,

Piyush

Milena
Telerik team
 answered on 06 Jun 2016
16 answers
1.5K+ views
Hi,

I'm having some trouble using bindings in my column headers. After reading this post: http://www.telerik.com/community/forums/wpf/gridview/binding-the-header-property-of-a-gridviewcolumn.aspx it seems like you have to have the property you are binding to available when the column is initialised, otherwise it will not get updated. 

I am wanting to bind to a property of the data context of a parent of the control that hosts the RadGridView. The DataContext hasn't been set by the time the column is initialized. Is there a way around this? I had a few ideas:

- Is there some event I can handle which is called before the columns are initialized, but after we have access to the UserControl's parent and hence its DataContext.
- Is there a way to reset the columns and hence the bindings?

I'm trying an MVVM approach, but I can't seem to fit in the ModelView approach with the column headers as I can't bind. The only way is to have the DataContext set in the control constructor, but that's fairly limited and I would rather avoid it.

Any suggestions / tips would be much appreciated!
Maya
Telerik team
 answered on 06 Jun 2016
0 answers
151 views
We have big WPF application with multiple screen. Each screen have multiple textboxes.

We have used MVVM pattern so textboxes are bound to VM using like:
{Binding Name,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}

In Most of the textboxes BUT not all, we want to set Delay Property to some value say 500 like:

{Binding Name,Delay=500,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}

Rather than setting this on each textbox xaml line is there some shorter way to handle this?

something like Style.xaml etc?
These changes are applicable for most of the textboxes but not all....
dotnetavalanche
Top achievements
Rank 1
 asked on 04 Jun 2016
1 answer
89 views

Hello,

 

I have a program I am creating where the tileview represents a collection of computers, with one tile per computer.  The data that backs this is bound as follows;

<telerik:RadTileView
    x:Name="radTileView"
    MaximizeMode="ZeroOrOne"
    ColumnWidth="250"
    ItemsSource="{Binding Data, Source={StaticResource context}}"
    ItemTemplate="{StaticResource ItemTemplate}"
    ContentTemplate="{StaticResource ContentTemplate}"
    IsVirtualizing="True"
    RowHeight="250"
    Grid.Column="2"
    Grid.Row="0"
    Margin="8,1,10,10"
    />

In my ViewModel, Data is an observable collection, like this;

private ObservableCollection<ImagingData> _imagingData = new ObservableCollection<ImagingData>();
public ObservableCollection<ImagingData> Data
{
    get
    {
        return _imagingData;
    }
    set
    {
        _imagingData = value;
        OnPropertyChanged(() => this.Data);
    }
}

Data is updated by a timer event that polls a database backend.  If i simply update Data by replacing it, everything works fine, except it makes for a poor UI experience since the pane resets constantly. To make for a better experience, where tiles stay maximized, and stay where you put them, i implemented a sort of delta sync.  When the timer event pops, I call UpdateData() with the UI dispatcher.  UpdateData copies Data to an array, then adds new records, deletes records that are not in scope anymore, and updates fields on records that already exist.  it is a crude proof of concept, but here it is;

private void UpdateData(ImagingData[] newItems, ImagingData[] existing)
{
    //var dataArray = _imagingData.ToArray();
    foreach (var item in existing)
    {
        var matchedItem = newItems.Where(c => c.ComputerName == item.ComputerName).FirstOrDefault();
 
        if (matchedItem == null)
            Data.Remove(item);
    }
 
    foreach (var item in newItems)
    {
        var matchedItem = existing.Where(c => c.ComputerName == item.ComputerName).FirstOrDefault();
 
        if(matchedItem == null)
        {
           Data.Add(item);
            return;
        }
 
        matchedItem.ImagingPasses = item.ImagingPasses;
        matchedItem.LastKnownActivity = item.LastKnownActivity;
        matchedItem.ImagingState = item.ImagingState;
    }
 
    OnPropertyChanged("Data");
}

The problem I am having that when i use this method, only 1 record is added to the Data collection each time the update timer fires, even though I have confirmed that the update loop does iterate over all the members.  Visually, you see one tile appear, then the next, then the next, etc, separated by one timer iteration.  I have tried all manner of different ways to remedy this but nothing seems to work.

Matt
Top achievements
Rank 1
 answered on 03 Jun 2016
5 answers
379 views
In RadTimePicker, click the toggle button, the drop down screen shows up.
Since we layout the RadTimePicker in right side main screen, the drop down screen seems to wider, it crosses the main window boundary. See the attachment.
Is there a way we can change the drop down screen width, so it will not cross the main window boundary?
thx!
Jane
M L
Top achievements
Rank 1
 answered on 03 Jun 2016
1 answer
87 views

I get an XmlParseException when I place a RadDiagram control at the same level as a RadDocking control and attempt to run.

<Window x:Class="TelerikWpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<telerik:RadDiagram>
</telerik:RadDiagram>
<telerik:RadDocking Grid.Column="2">
</telerik:RadDocking>

</Grid>
</Window>

 

System.Windows.Markup.XamlParseException occurred
  HResult=-2146233087
  LineNumber=14
  LinePosition=11
  Message=Could not load file or assembly 'Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  Source=PresentationFramework
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at TelerikWpfApp1.MainWindow.InitializeComponent() in D:\visual studio 2015 Projects\TelerikWpfSolution\TelerikWpfApp1\MainWindow.xaml:line 1
  InnerException:
       FileName=Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
       FusionLog==== Pre-bind state information ===
LOG: DisplayName = Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
 (Fully-specified)
LOG: Appbase = file:///D:/visual studio 2015 Projects/TelerikWpfSolution/TelerikWpfApp1/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Telerik.Windows.Controls.Docking, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\visual studio 2015 Projects\TelerikWpfSolution\TelerikWpfApp1\bin\Debug\TelerikWpfApp1.vshost.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
LOG: Attempting download of new URL file:///D:/visual studio 2015 Projects/TelerikWpfSolution/TelerikWpfApp1/bin/Debug/Telerik.Windows.Controls.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
       HResult=-2146234304
       Message=Could not load file or assembly 'Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
       Source=mscorlib
       StackTrace:
            at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
            at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
            at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
            at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType bamlType)
            at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
            at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
            at System.Windows.Baml2006.Baml2006Reader.Process_ElementStart()
            at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
            at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords()
            at System.Windows.Baml2006.Baml2006Reader.Read()
            at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
            at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       InnerException:

Dinko | Tech Support Engineer
Telerik team
 answered on 03 Jun 2016
1 answer
179 views

Hello team,

I'm trying to acces IsReadOnly property from header style to change its foreground color. For now, I didn't find a solution. I'm trying the following:

<Style x:Key="GridViewHeaderCellStyle" TargetType="{x:Type telerik:GridViewHeaderCell}">

...

<Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewDataColumn}}, Path=Column.IsReadOnly}" Value="false">
                <Setter Property="Foreground" Value="{DynamicResource primaryBrush}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

Martin
Telerik team
 answered on 03 Jun 2016
1 answer
219 views
Trying to figure out the best way via code to paste from a word document (using interop) a fragment of formatted text to a RichTextEditor as Html that is filtered. I can easily just paste, but then it seems I get a whole bunch of Word specific format. I want to paste filtered text. How would I go about this?
Tanya
Telerik team
 answered on 03 Jun 2016
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?