Hi
Do you have an example on how to integrate the SyntaxEditor and the Roslyn toll:
Using C#
Want to:
- Compile and display errors
- Get list of functions and be able to navigate to functions
- etc.
/Brian
The default design time theme is `office black`, is there any approaches to change default theme?
Set `telerik:StyleManager.Theme="xxx"` for each control is very troublesome.
Hi All,
I am trying to explore RadAutoSuggestBox (R2 2022 SP1 version) in my WPF MVVM application however I didn't find any support, how to purely bind (TextChanged event and few others) it with my ViewModel. My requirement is: Whenever user type, I have to make API call and then bind response with control's itemsource.
Any help will be appreciated.
I have a RadGridView with one of its columns being a GridViewToggleRowDetailsColumn to allow the operator to expand or collapse the selected row details.
Next to the grid I have a checkbox that I want to use to expand/collapse all rows details in a single click if needed.
I’ve managed to partially do it by using the following code, but the collapse doesn’t work unless I disable row virtualization which I cannot.
Does anyone have a solution to this problem?
private void ToggleAllRowsDetails(object sender, RoutedEventArgs e)
{
if(DataContext is MyViewModel vm)
{
using (MyGrid.DeferRefresh())
{
if (MyRowDetails.IsChecked.Value)
{
MyGrid.RowDetailsVisibilityMode = GridViewRowDetailsVisibilityMode.Visible;
}
else
{
MyGrid.RowDetailsVisibilityMode = GridViewRowDetailsVisibilityMode.Collapsed;
}
}
}
}
Hi.
I have the following RadPropertyGrid:
XAML:
<Grid
behaviors:CalloutTagBehavior.CalloutTag="F6C90D8E-9F1C-4372-87D0-17B40EE1E462"
IsEnabled="{Binding StateDispatcher.EnvironmentState,
Converter={converters:ComparisonConverter},
ConverterParameter={x:Static runtime:EnvironmentState.Design}}">
<telerik:RadPropertyGrid
x:Name="RadPropertyGrid"
telerik:PropertySet.ShouldAddNullForNonMatchingValues="True"
AutoGeneratingPropertyDefinition="RadPropertyGrid_OnAutoGeneratingPropertyDefinition"
EditEnded="RadPropertyGrid_OnEditEnded"
EditMode="Single"
FieldIndicatorVisibility="Collapsed"
IsGrouped="False"
Item="{Binding SelectedObject}"
LabelColumnWidth="0.8*"
Loaded="RadPropertyGrid_OnLoaded"
PropertySetMode="None"
RenderMode="Flat">
<telerik:RadPropertyGrid.GroupStyle>
<Style TargetType="telerik:RadToggleButton">
<Setter Property="Margin" Value="0,0,15,0" />
</Style>
</telerik:RadPropertyGrid.GroupStyle>
</telerik:RadPropertyGrid>
</Grid>
CodeBehinde:
public partial class PropertyGridPaneUserControl : UserControl
{
public PropertyGridPaneUserControl(IEventAggregator eventAggregator)
{
if (eventAggregator == null) throw new ArgumentNullException(nameof(eventAggregator));
InitializeComponent();
eventAggregator.Register<RefreshPropertyGridMessage>(this, RefreshPropertyGridMessageHandler);
}
private void RefreshPropertyGridMessageHandler(RefreshPropertyGridMessage message)
{
RadPropertyGrid.ReloadData();
}
private void RadPropertyGrid_OnAutoGeneratingPropertyDefinition(object? sender, AutoGeneratingPropertyDefinitionEventArgs e)
{
((Binding)e.PropertyDefinition.Binding).ValidatesOnExceptions = true;
}
private void RadPropertyGrid_OnLoaded(object sender, RoutedEventArgs e)
{
var virtualizingStackPanel = RadPropertyGrid
.ChildrenOfType<VirtualizingStackPanel>().FirstOrDefault();
if (virtualizingStackPanel != null)
{
virtualizingStackPanel.ScrollOwner.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
}
}
private void RadPropertyGrid_OnEditEnded(object? sender, PropertyGridEditEndedEventArgs e)
{
if (e.EditAction != PropertyGridEditEndedAction.Commit ||
Equals(e.NewValue, e.OldValue) ||
DataContext is not PropertyGridViewModel {SelectedObjects: { }} propertyGridViewModel) return;
ItemPropertyInfo sourceProperty = e.EditedPropertyDefinition.SourceProperty;
foreach (var selectedObject in propertyGridViewModel.SelectedObjects)
{
if (selectedObject == e.EditedPropertyDefinition.Instance) continue;
PropertyInfo? property = selectedObject.GetType()
.GetProperty(sourceProperty.Name, sourceProperty.PropertyType);
if (property != null)
{
property.SetValue(selectedObject, e.NewValue);
}
}
}
}
And it worked fine up to a certain point. The problem occurs when processing an object with the ObservableCollection property of the following type:
public class A
{
public ObservableCollection<object> Collection { get; }
}
My task is to perform asynchronous addition of elements to a nested collection. If I didn't open the CollectionEditor in the UI, then the addition happens without problems. But if you open CollectionEditor in UI at least once, InvalidOperationnException is generated when adding asynchronously: The calling thread cannot access this object because a different thread owns it. Stack trace part:
at System.Windows.Threading.Dispatcher.VerifyAccess()
at System.Windows.DependencyObject.GetValue(DependencyProperty dp)
at System.Windows.Controls.Panel.get_IsItemsHost()
at System.Windows.Controls.ItemsControl.GetItemsOwnerInternal(DependencyObject element, ItemsControl& itemsControl)
at System.Windows.Controls.Panel.VerifyBoundState()
at System.Windows.Controls.Panel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
at System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index)
at System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at MS.Internal.Data.CollectionViewProxy._OnViewChanged(Object sender, NotifyCollectionChangedEventArgs args)
at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChangedWithAdjustedArgs(NotifyCollectionChangedEventArgs originalArguments, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChanged(NotifyCollectionChangedEventArgs args)
at Telerik.Windows.Data.QueryableCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
at Telerik.Windows.Data.QueryableCollectionView.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at Telerik.Windows.Data.QueryableCollectionView.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
At the same time, an exception occurs even if in Rad PropertyGrid.Item set another instance of the object or null. I would like to know how to correct this misunderstanding
How dynamically change with of column in RowDetails
Hello. I have a TreeListView with three columns. Also some rows have details. There is a GridView in Details. I would like that width of the first column in Details is equals width of the first column in TreeListView, and so on for each columns. And when I change size of TreeListView the columns in Details dynamically change itself width.
Telerik SDK Samples Browser has demo "Binding RowDetails Element Width". But it's not working when I change size of window. Details does not change it's width.
Thanks.
I'm converting my application to use the Windows 11 theme and I noticed an issue that sometimes pops up with the RadGridView control.
When closing a details section of a row (click on the minus button to close the row again) the lines suddenly jump down and show a bit white space.
I didn't have the issue before I switched to the new theme. (before we were using the Office 2016 theme)
Currently I have no clue why it's happening or where I should start looking. When I scroll or click on the plus button to open row details it goes back to normal.
Anybody experienced something similar before?