Telerik Forums
UI for WPF Forum
1 answer
275 views

Hi Telerik,

Do you have any report view control or similar control in WPF.net core which can connect to SSRS (2012 version and above) and view RDLC or local report?

Thanks,

 

Best Regards,

Loon 

Katia
Telerik team
 answered on 19 Jun 2020
2 answers
1.0K+ views
i want to remove the border of each columns headers in the grid view>i tried with borderthickness="0" , but it didnt work.Please help me in removing the border from  telerik grid view.
Flemming
Top achievements
Rank 1
Veteran
 answered on 18 Jun 2020
1 answer
568 views

I'm am trying to create a search with  Watermark Text Box and have a clear button at the end. The problem is that I can't get the background of the button to be transparent.

This is the code that I am using:

<telerikControls:RadWatermarkTextBox Name="SearchBox"
                  Text="{Binding SearchControl.SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                  Width="250">
                    <telerikControls:RadWatermarkTextBox.WatermarkContent>
                        <StackPanel Orientation="Horizontal">
                            <telerikControls:RadGlyph Glyph="" Margin="0 3 0 0"/>
                            <TextBlock Margin="3,3,0,0" Text="Search" />
                        </StackPanel>
                    </telerikControls:RadWatermarkTextBox.WatermarkContent>
                    <telerikControls:RadWatermarkTextBox.AdditionalContent>
                        <telerikControls:RadButton Focusable="False"
                           IsBackgroundVisible="False"
                           Command="telerikControls:RadWatermarkTextBoxCommands.Clear"
                           CommandTarget="{Binding ElementName=SearchBox}"
                           ToolTip="Clear">
                            <telerikControls:RadGlyph Glyph=""/>
                        </telerikControls:RadButton>
                    </telerikControls:RadWatermarkTextBox.AdditionalContent>
                </telerikControls:RadWatermarkTextBox>

 

I have also tried to use Background="Transparent" but that still doesn't work.

I have also noticed that IsBackgroundVisible aslo doesn't work on buttons outside of the Watermark Text Box.

I have attached a photo of how the search box looks.

Sia
Telerik team
 answered on 18 Jun 2020
1 answer
112 views

When I run the Groups demo in the Gauge_WPF solution (no modifications), the linear / vertical gauge group doesn't look anything like what it's supposed to:

  • No indicators
  • Only 1.5 of the 4 ranges visible

(screenshot attached)

Can you pls. clarify how to fix this?

 

Vladimir Stoyanov
Telerik team
 answered on 17 Jun 2020
3 answers
183 views

Hello,

I cannot get a C# enumeration property based on dynamically created DefineEnum call to show up as popup on a PropertyGrid.  I've tried several things but nothing worked.  Also, I am dynamically creating the PropertyDefinition items instead of statically defining anything via XAML.

Here is the basic code to load the property definitions:

private void Window_Loaded(object sender, RoutedEventArgs e)
{
    PropertyDefinitionCollection properties = EditorPropertyGrid.PropertyDefinitions;
 
    List<KeyValueBase> testList = new List<KeyValueBase>();
 
    TestEnumKeyValue first = new TestEnumKeyValue() { Key = "Static Enum Prop", Value = TestEnum.test3 };
    testList.Add(first);
    properties.Add(new PropertyDefinition()
    {
        DisplayName = first.Key,
        Binding = new Binding("Value") { Source = first }
    });
 
    DynamicEnumBuilder _enums = new DynamicEnumBuilder();
    _enums.BuildDictionaries();
    Type dynamicEnum = _enums.getEnum("Employee", "Status");
     
    EnumKeyValue second = new EnumKeyValue() { Key = "Dynamic Enum Prop", Value = Enum.Parse(dynamicEnum, "PartTime")};
    testList.Add(second);
    properties.Add(new PropertyDefinition()
    {
        DisplayName = second.Key,
        Binding = new Binding("Value") { Source = second }
    });
 
    // ************************
 
    EditorPropertyGrid.Item = testList;
}

Here are the key value pair definitions:

enum TestEnum
{
    test1,
    test2,
    test3
}
 
class KeyValueBase
{
 
}
 
class TestEnumKeyValue : KeyValueBase
{
    public string Key { get; set; }
    public TestEnum Value { get; set; }
}
 
class EnumKeyValue : KeyValueBase
{
    public string Key { get; set; }
    public object Value { get; set; }
}

 

Here is the XAML:

<Grid x:Name="EditorGrid">
    <telerik:RadPropertyGrid x:Name="EditorPropertyGrid" Margin="10,10,10,10" DescriptionPanelVisibility="Collapsed" SearchBoxVisibility="Collapsed" AutoGeneratePropertyDefinitions="False" NestedPropertiesVisibility="Visible" AutoGenerateBindingPaths="False" SortAndGroupButtonsVisibility="Collapsed" />
</Grid>

 

And here is how I generate the dynamic enum:

class DynamicEnumBuilder
    {
        public Dictionary<string, Dictionary<string, Type>> _enumDictionary = new Dictionary<string, Dictionary<string, Type>>();
 
        public void BuildDictionaries()
        {
            Dictionary<string, Dictionary<string, List<ValuePair>>> _rawDictionary = new Dictionary<string, Dictionary<string, List<ValuePair>>>();
            _rawDictionary["Employee"] = new Dictionary<string, List<ValuePair>>();
            _rawDictionary["Employee"]["Status"] = new List<ValuePair>();
            _rawDictionary["Employee"]["Status"].Add(new ValuePair() { Name = "FullTime", StoredValue = "1" });
            _rawDictionary["Employee"]["Status"].Add(new ValuePair() { Name = "PartTime", StoredValue = "2" });
            _rawDictionary["Employee"]["Status"].Add(new ValuePair() { Name = "Retired", StoredValue = "3" });
            BuildValueDictionary(_rawDictionary);
        }
 
        private void BuildValueDictionary(Dictionary<string, Dictionary<string, List<ValuePair>>> _rawDictionary)
        {
            // Get the current application domain for the current thread.
            AppDomain currentDomain = AppDomain.CurrentDomain;
 
            //// Create a dynamic assembly in the current application domain,
            //// and allow it to be executed ONLY, NOT to be saved on disk!
            AssemblyName aName = new AssemblyName("TempAssembly");
            AssemblyBuilder ab = currentDomain.DefineDynamicAssembly(
                aName, AssemblyBuilderAccess.Run);
 
            // Define a dynamic module in "TempAssembly" assembly. For a single-
            // module assembly, the module has the same name as the assembly.
            ModuleBuilder mb = ab.DefineDynamicModule(aName.Name);
 
            foreach(var fieldEntry in _rawDictionary)
            {
                Dictionary<string, Type> valueTableDic = null;
                if (!_enumDictionary.ContainsKey(fieldEntry.Key))
                {
                    valueTableDic = new Dictionary<string, Type>();
                    _enumDictionary.Add(fieldEntry.Key, valueTableDic);
                }
                else
                {
                    valueTableDic = _enumDictionary[fieldEntry.Key];
                }
 
                Dictionary<string, List<ValuePair>> rawEnumDict = fieldEntry.Value;
                foreach (var fieldEnum in rawEnumDict)
                {
                    // Define a public enumeration with the name "Elevation" and an
                    // underlying type of Integer.
                    EnumBuilder eb = mb.DefineEnum(fieldEnum.Key+"Enum", TypeAttributes.Public, typeof(int));
 
                    // build the enumerations
                    List<ValuePair> values = fieldEnum.Value;
                    foreach (var valuePair in values)
                    {
                        eb.DefineLiteral(valuePair.Name, int.Parse(valuePair.StoredValue));
                    }
                    // Create the type and save the assembly.
                    Type dynamicEnum = eb.CreateType();
 
                    // now put it in the value dictionary
                    valueTableDic[fieldEnum.Key] = dynamicEnum;
                }
            }
        }
 
        public Type getEnum(String tablename, String fieldname)
        {
            Type result = null;
            if (_enumDictionary.ContainsKey(tablename))
            {
                Dictionary<string, Type> fieldDict = _enumDictionary[tablename];
                if (fieldDict.ContainsKey(fieldname))
                {
                    result = fieldDict[fieldname];
                }
            }
            return result;
 
        }
    }

 

Basically, I want the dynamic Enum to have a popup like the static Enum, instead of PropertyGrid rendering it as a string.

Any help will be deeply appreciated!

Thanks in advance!

Martin Ivanov
Telerik team
 answered on 17 Jun 2020
1 answer
116 views

I've been testing the chart using bitmap rendering and am pleased with the performance so far. I have some questions regarding optimization. I am creating a simple line chart and am using a ScatterLineSeries, which seems to be the best match. The number of series may change, but the data itself will not change.

1. Is it possible to directly bind to or use arrays instead of arrays of objects? For example, I have 1 million data points that are stored in two arrays: one for X and one for Y. Is there any way to use the data as-is without creating intermediate classes?

2. The chart appears to create a ScatterDataPoint for each of my points. I directly added ScatterDataPoint objects to avoid creating an intermediate class, which worked. However, is there no way to specify an initial capacity? With one million points, isn't the collection going to be constantly resizing?

 

Martin Ivanov
Telerik team
 answered on 17 Jun 2020
3 answers
353 views

Hello guys,

I'd like to make a customizable editor with a button like modal style, but what I want is to reset the value when clicked.

For example, Property1 = "A".

In the editor, I change the Property1 value to "B" and when I click on the reset button, it resets to "A".

I can do it with a simple textbox and button, but it's not easy to implement it with a property grid.

Can you help me please?

Dinko | Tech Support Engineer
Telerik team
 answered on 17 Jun 2020
3 answers
697 views

I have modified the control template of TabbedWindow. But I cant find the actual tab ("handle"). How/where can I set Corenrradius="x"?

 

Robert
Top achievements
Rank 1
Veteran
 answered on 17 Jun 2020
4 answers
290 views
I turned on filtering and the default size it too large.  How can I change this size?
Tom
Top achievements
Rank 1
 answered on 16 Jun 2020
1 answer
167 views

Hello,

Using a WPF PropertyGrid. and having a problem with using Editor Attributes in combination with a nested property.  Basically, all property definitions with Editor Attributes defined at the root will work fine, however nested property definitions with Editor Attributes renders with nothing in it.  The attached file shows the problem.

Here is the code which generates the property definitions:

private void Window_Loaded(object sender, RoutedEventArgs e)
{
    PropertyDefinitionCollection properties = EditorPropertyGrid.PropertyDefinitions;
 
    ObservableCollection<object> testList = new ObservableCollection<object>();
 
    UserDefinedEnumKeyValue first = new UserDefinedEnumKeyValue() { Key = "Custom Enum Control Prop", Value = new UserDefinedEnum() { Item = "UD3", Items = { "UD1", "UD2", "UD3", "UD4" } } };
    testList.Add(first);
    properties.Add(new PropertyDefinition()
    {
        DisplayName = first.Key,
        Binding = new Binding("Value") { Source = first }
    });
 
    ParentKeyValue item = new ParentKeyValue() { ChildList = new List<KeyValueBase>() };
    testList.Add(item);
    PropertyDefinition parentPropertyDefinition = new PropertyDefinition()
    {
        DisplayName = item.Key,
        Binding = new Binding("Value") { Source = item }
    };
    properties.Add(parentPropertyDefinition);
    PropertyDefinitionCollection nestedProperties = parentPropertyDefinition.NestedProperties;
 
    UserDefinedEnumKeyValue second = new UserDefinedEnumKeyValue() { Key = "Custom Enum Control Prop nested", Value = new UserDefinedEnum() { Item = "UD3", Items = { "UD1", "UD2", "UD3", "UD4" } } };
    testList.Add(second);
    nestedProperties.Add(new PropertyDefinition()
    {
        DisplayName = second.Key,
        Binding = new Binding("Value") { Source = second }
    });
 
    EditorPropertyGrid.Item = testList;
}

 

Here are the model classes:

abstract class KeyValueBase
{
    public string Key { get; set; }
    public abstract void SetValue(string value);
 
}
 
class UserDefinedEnum : INotifyPropertyChanged
{
    private List<string> _items = new List<string>();
    public List<string> Items
    {
        get
        {
            return this._items;
        }
        //set NOTE not used for one way binding
        //{
        //    if (this._items != value)
        //    {
        //        this._items = value;
        //        this.OnPropertyChanged("Items");
        //    }
        //}
    }
 
    private string _item;
    public string Item
    {
        get
        {
            return this._item;
        }
        set
        {
            if (this._item != value)
            {
                this._item = value;
                this.OnPropertyChanged("Item");
            }
        }
    }
 
    public event PropertyChangedEventHandler PropertyChanged;
 
    private void OnPropertyChanged(string propertyName)
    {
        if (this.PropertyChanged != null)
            this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
}
 
class UserDefinedEnumKeyValue : KeyValueBase
{
    [Telerik.Windows.Controls.Data.PropertyGrid.Editor(typeof(EnumControl), Telerik.Windows.Controls.Data.PropertyGrid.EditorStyle.None)]
    public UserDefinedEnum Value { get; set; }
    public override void SetValue(string value)
    {
 
    }
}
 
class ParentKeyValue : KeyValueBase
{
    public string Value { get; set; }
    public List<KeyValueBase> ChildList { get; set; }
    public override void SetValue(string value)
    {
 
    }
}

 

And here is the XAML for the EnumControl:

<UserControl x:Class="TelerikWpfApp002.EnumControl"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid>
        <telerik:RadComboBox SelectedValue="{Binding Item, Mode=TwoWay}" ItemsSource="{Binding Items, Mode=OneWay}" />
    </Grid>
</UserControl>

 

Thank you in advance for any help offered...

Vladimir Stoyanov
Telerik team
 answered on 16 Jun 2020
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?