
I have noticed that when using Intersection PropertySetMode that property change notifications from Objects in the List of items are not used by the property grid. Is this a known limitation or a bug?
I am using version 2015.2.728.
PropertyGrid.PropertySetMode = PropertySetOperation.Intersection;
PropertyGrid.Item = new List<Object> { myObject1, myObject2 };
// Property change notifications from myObject1 and myObject2 do cause the property grid values to update.
Hi
i am wpf programmer and use telerik grid view for showing database table.
i have a GridViewComboBoxColumn in my grid and the combobox items for each row is different.
how can i bind data for each row combo in run time?
I want to get row value after i click a cell. I try using SelectionChanged and follow so many Q&A in many forum and still can't do this. maybe if you guys can give me an example for this, maybe after click a cell it will give message about every value in that row?
here is my whole code, i hope telerik team can help me.
XAML
<Grid> <StackPanel x:Name="xPanel"> <telerik:RadGridView x:Name="dataGrid" AutoGenerateColumns="False" ColumnWidth="*" ShowGroupPanel ="False" CanUserReorderColumns ="False" ItemsSource="{Binding}" SelectionChanged="dataGrid_SelectionChanged"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="idx" DataMemberBinding="{Binding idx}" /> <telerik:GridViewDataColumn Header="tag" DataMemberBinding="{Binding tag}" /> <telerik:GridViewDataColumn Header="value" DataMemberBinding="{Binding value}" /> </telerik:RadGridView.Columns> </telerik:RadGridView> <telerik:RadButton Content="Update" Height="30" Click="RadButton_Click" /> </StackPanel> </Grid>CS
namespace Setting{ public partial class MainWindow : Window { ScimoreDataAdapter dataAdp; DataSet ds; public MainWindow() { InitializeComponent(); string dbInstanceName = "C:\\Users\\Abc\\Documents\\Visual Studio 2010\\Projects\\Setting\\Setting\\configdb"; ScimoreEmbedded em = new ScimoreEmbedded(); em.Open(dbInstanceName); try { using (ScimoreConnection cn = em.CreateConnection()) { cn.Open(); string query = "select idx,tag,value from config.info"; dataAdp = new ScimoreDataAdapter(query, cn); DataTable dataTable = new DataTable("info"); ds = new System.Data.DataSet(); dataAdp.Fill(ds, "info"); dataGrid.ItemsSource = ds.Tables[0]; dataAdp.Update(ds, "info"); } } catch (Exception) { } } private void RadButton_Click(object sender, RoutedEventArgs e) { } private void dataGrid_SelectionChanged(object sender, SelectionChangeEventArgs e) { //System.Data.DataRowView CurrentSelected = ((System.Data.DataRowView)dataGrid.SelectedItem); //MessageBox.Show(Convert.ToString(CurrentSelected.Row.ItemArray[1])); } }}
Hello,
I have downloaded and install a very beautiful telerik winform application. I found a very nice tab control (We say probably radpageview to it in winforms) with a little close image aligned at right side. I am really impressed and want to create it in wpf. Telerik TabControl doesnot fullfill this behavior by default. I actually need to implement it dynamically when a user click on button. For example when a user click on button a tab control should be created dynamically as you can see in attached image.
I want to achieve this by using mvvm/xaml pattern using as much as simple example code. If you please send a sample project with complete code implementation i will be really glad and thankful.
Hi,
I'm seeing this "you are using unsupported command line flag --disable web security" error message in Chrome (Version 46.0.2490.86 m)​, which appears to be coming from Telerick's Test Studio plugins, as I don't see them when those are disabled.
Is there a way to get rid of that error message?
Thanks,
Arcady
SaveFileDialog dialog = new SaveFileDialog(){ DefaultExt = "png", Filter = "png (*.png)|*.png"};if (dialog.ShowDialog() == true){ using (Stream stream = dialog.OpenFile()) { Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage( barCode, stream, new PngBitmapEncoder()); }}I'm experiencing some odd behavior when changing the PropertySetMode at runtime.
I have two object types: MyTestClass1 and MyTestClass2. MyTestClass1 has a writeable property IntProp and MyTestClass2 has a readonly property IntProp. If I start in Intersection mode with Item = List<Object> { myTestClass1Obj1, myTestClass1Obj2 } everything works properly. If I then change to PropertySetMode None with Item = myTestClass2Obj, the editor for IntProp will be writeable even though IntProp on myTestClass2Obj has no public setter.
See runnable test case below. I am running 2015.2.728
<Window x:Class="WpfApplication1.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525"> <Grid> <StackPanel Orientation="Vertical"> <Button Click="ButtonBase_OnClick">Change to mode none</Button> <telerik:RadPropertyGrid x:Name="rpg"/> </StackPanel> </Grid></Window>
using System;using System.Collections.Generic;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.ComponentModel;using System.Collections.ObjectModel;using System.Text.RegularExpressions;using System.ComponentModel.DataAnnotations;using Telerik.Windows.Controls.Data.PropertyGrid;namespace WpfApplication1{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private readonly MyTestClass test; private readonly MyTestClass test2; private readonly MyTestClass2 test3; public MainWindow() { InitializeComponent(); rpg.AutoGeneratingPropertyDefinition += new EventHandler<Telerik.Windows.Controls.Data.PropertyGrid.AutoGeneratingPropertyDefinitionEventArgs>(rpg_AutoGeneratingPropertyDefinition); // test data. IntProp is has a public setter test = new MyTestClass() { StringProp = "91das", RequiredField = "abc", IntProp = 10, DateTimeProp = new DateTime(1920, 2, 21) }; test2 = new MyTestClass() { StringProp = "91das", RequiredField = "abc", IntProp = 10, DateTimeProp = new DateTime(1920, 2, 21) }; // test data. IntProp is read only (no public setter) test3 = new MyTestClass2() { StringProp = "91das", RequiredField = "abc", DateTimeProp = new DateTime(1920, 2, 21) }; rpg.Item = new List<Object> {test, test2}; rpg.PropertySetMode = PropertySetOperation.Intersection; } void rpg_AutoGeneratingPropertyDefinition(object sender, Telerik.Windows.Controls.Data.PropertyGrid.AutoGeneratingPropertyDefinitionEventArgs e) { (e.PropertyDefinition.Binding as Binding).ValidatesOnDataErrors = true; (e.PropertyDefinition.Binding as Binding).NotifyOnValidationError = true; (e.PropertyDefinition.Binding as Binding).ValidatesOnExceptions = true; } private ObservableCollection<ValidationError> results; public ObservableCollection<ValidationError> Results { get { if (this.results == null) { this.results = new ObservableCollection<ValidationError>(); } return results; } } private void ButtonBase_OnClick(object sender, RoutedEventArgs e) { rpg.PropertySetMode = PropertySetOperation.None; rpg.Item = test3; // the property grid will now allow setting of test3.IntProp even though there is // no public setter } } public class MyTestClass : IDataErrorInfo, INotifyPropertyChanged { private int intVar; private string requiredField; public int IntProp { get { return intVar; } set { intVar = value; this.OnPropertyChanged("IntProp"); } } [Required(ErrorMessage = "This field is Required.")] public string RequiredField { get { return requiredField; } set { requiredField = value; ValidateProperty("RequiredField", value); this.OnPropertyChanged("RequiredField"); } } private string stringVar; public string StringProp { get { return stringVar; } set { stringVar = value; this.OnPropertyChanged("StringProp"); } } private DateTime dateTimeVar; public DateTime DateTimeProp { get { return dateTimeVar; } set { dateTimeVar = value; this.OnPropertyChanged("DateTimeProp"); } } [Browsable(false)] public string Error { get { return string.Empty; } } public string this[string columnName] { get { if (columnName == "IntProp") { return this.IntProp < 100 && this.IntProp > 0 ? string.Empty : "Value should be in the range of (0, 100)"; } if (columnName == "StringProp") { return this.StringProp != null && Regex.IsMatch(this.StringProp, @"^[0-9]+[\p{L}]*") ? string.Empty : @"Value should math the regex: ^[0-9]+[\p{L}]*"; } if (columnName == "DateTimeProp") { return this.DateTimeProp.Year > 1900 ? string.Empty : "Date should be after 1/1/1900"; } return string.Empty; } } protected void OnPropertyChanged(string name) { if (this.PropertyChanged != null) { this.PropertyChanged(this, new PropertyChangedEventArgs(name)); } } public event PropertyChangedEventHandler PropertyChanged; public void ValidateProperty(string propName, object value) { var result = new List<System.ComponentModel.DataAnnotations.ValidationResult>(); Validator.TryValidateProperty(value, new ValidationContext(this, null, null) { MemberName = propName }, result); if (result.Count > 0) { throw new ValidationException(result[0].ErrorMessage); } } } public class MyTestClass2 : IDataErrorInfo, INotifyPropertyChanged { private int intVar; private string requiredField; public int IntProp { get; } = 12; [Required(ErrorMessage = "This field is Required.")] public string RequiredField { get { return requiredField; } set { requiredField = value; ValidateProperty("RequiredField", value); this.OnPropertyChanged("RequiredField"); } } private string stringVar; public string StringProp { get { return stringVar; } set { stringVar = value; this.OnPropertyChanged("StringProp"); } } private DateTime dateTimeVar; public DateTime DateTimeProp { get { return dateTimeVar; } set { dateTimeVar = value; this.OnPropertyChanged("DateTimeProp"); } } [Browsable(false)] public string Error { get { return string.Empty; } } public string this[string columnName] { get { if (columnName == "IntProp") { return this.IntProp < 100 && this.IntProp > 0 ? string.Empty : "Value should be in the range of (0, 100)"; } if (columnName == "StringProp") { return this.StringProp != null && Regex.IsMatch(this.StringProp, @"^[0-9]+[\p{L}]*") ? string.Empty : @"Value should math the regex: ^[0-9]+[\p{L}]*"; } if (columnName == "DateTimeProp") { return this.DateTimeProp.Year > 1900 ? string.Empty : "Date should be after 1/1/1900"; } return string.Empty; } } protected void OnPropertyChanged(string name) { if (this.PropertyChanged != null) { this.PropertyChanged(this, new PropertyChangedEventArgs(name)); } } public event PropertyChangedEventHandler PropertyChanged; public void ValidateProperty(string propName, object value) { var result = new List<System.ComponentModel.DataAnnotations.ValidationResult>(); Validator.TryValidateProperty(value, new ValidationContext(this, null, null) { MemberName = propName }, result); if (result.Count > 0) { throw new ValidationException(result[0].ErrorMessage); } } }}
dafadsf