Hello. I have a special classes: tbTechObject and tbTech. tbTechObject contains tbTech. When I use "full test search" it doesn`t work for column with tbTechObject items (telerik:GridViewComboBoxColumn "ТСИ"). "full test search" work only for string columns. What have I do to "full test search" searches in column with my custom type elements? Thanks.
[global::System.ComponentModel.TypeConverter(typeof(tbTechObjectConverter))]
public class tbTechObject : IEquatable<tbTechObject>, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void FirePropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public int idTechObject { get; set; }
public ObservableCollection<tbTech> nameTech { get; set; }//Items source for combobox column in radgridview. This class describe bellow
private tbTech nTech;
public tbTech NTech
{
get { return nTech; }
set
{
if (this.nTech != value)
{
this.nTech = value;
FirePropertyChanged("NTech");
}
}
}
public string serialNum { get; set; }
public string inventNum { get; set; }
public void save()
{
//save to db
}
bool IEquatable<tbTechObject>.Equals(tbTechObject other)
{
if (other == null)
{
return false;
}
return StringComparer.Ordinal.Equals(this.NTech.name, other.NTech.name);
}
public override bool Equals(object obj)
{
return ((IEquatable<tbTechObject>)this).Equals(obj as tbTechObject);
}
public override int GetHashCode()
{
if (this.NTech == null)
this.NTech = this.nameTech[0];
return this.NTech.name.GetHashCode() ^ this.idTechObject.GetHashCode();
}
public override string ToString()
{
return this.NTech.name;
}
}
public class tbTechObjectConverter : System.ComponentModel.TypeConverter
{
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
{
return true;
}
return base.CanConvertFrom(context, sourceType);
}
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
var stringValue = value as string;
if (stringValue != null)
{
return new tbTechObject { idTechObject = -1 };
}
return base.ConvertFrom(context, culture, value);
}
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(string))
{
return true;
}
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
return ((tbTechObject)value).ToString();
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
/////////////////////////////////
[global::System.ComponentModel.TypeConverter(typeof(tbTechConverter))]
public class tbTech : IEquatable<tbTech>, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void FirePropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public int idNameTech { get; set; }
public string name { get; set; }
public bool save()
{
//save to db
}
bool IEquatable<tbTech>.Equals(tbTech other)
{
if (other == null)
{
return false;
}
return StringComparer.Ordinal.Equals(this.name, other.name);
}
public override bool Equals(object obj)
{
return ((IEquatable<tbTech>)this).Equals(obj as tbTech);
}
public override int GetHashCode()
{
return this.name.GetHashCode() ^ this.idNameTech.GetHashCode();
}
public override string ToString()
{
return this.name;
}
}
public class tbTechConverter : System.ComponentModel.TypeConverter
{
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
{
return true;
}
return base.CanConvertFrom(context, sourceType);
}
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
var stringValue = value as string;
if (stringValue != null)
{
return new tbTech { name = stringValue, idNameTech = -1 };
}
return base.ConvertFrom(context, culture, value);
}
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(string))
{
return true;
}
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
return ((tbTech)value).ToString();
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
//////////////////XAML
<telerik:RadGridView x:Name="mainDG" Margin="259,0,5,5" AutoGenerateColumns="False" CanUserDeleteRows="False" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" MouseDoubleClick="mDClikMainDG" MouseRightButtonDown="mouseRBtnDownMainDG" ScrollMode="Deferred" AutomationProperties.IsRowHeader="True">
<telerik:RadGridView.Columns>
<telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" EditTriggers="CellClick" AutoSelectOnEdit="True">
<telerik:GridViewCheckBoxColumn.Header>
<CheckBox HorizontalAlignment="Center" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
</CheckBox>
</telerik:GridViewCheckBoxColumn.Header>
</telerik:GridViewCheckBoxColumn>
<telerik:GridViewComboBoxColumn Header="ТСИ" Width="200" EditTriggers="CellClick" ItemsSourceBinding="{Binding nameTech}" DisplayMemberPath="name" DataMemberBinding="{Binding NTech, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValueMemberPath="{Binding NTech, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsComboBoxEditable="True" IsFilterable="True">
</telerik:GridViewComboBoxColumn>
<telerik:GridViewDataColumn Header="Serial number" DataMemberBinding="{Binding serialNum}"/>
<telerik:GridViewDataColumn Header="Inventor number" DataMemberBinding="{Binding inventNum}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Hi,
We are currently migrating our current Silverlight / Telerik app to WPF and we have noticed a difference in how often the database is queried when scrolling using the deferred scrolling approach.
In the Silverlight implementation the database seems to only be queried when we let go of the mouse button and it does its skip / take then thus only a single DB hit.
In the WPF version using the same approach yields multiple DB hits whilst dragging the mouse down the scrollbar.
s this intentional / is there an option we have missed to get back to the same way the Silverlight implementation was working as it is impacting the performance of our app and the scrolling at this point.
Many thanks in advance
Lee
<
telerik:RadNumericUpDown
Name
=
"numericVMDNQRS"
NullValue
=
""
Value
=
"{Binding Path=Tier.VMDNQRS,ValidatesOnDataErrors=True,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
IsEditable
=
"True"
AutoReverse
=
"False"
Minimum
=
"0"
SmallChange
=
"0.1"
LargeChange
=
"1"
V
alueFormat
=
"Percentage"
DataContext
=
"{Binding}"
/>
Hi,
On my fields list I setting a custom display name.
When I dragged field from field list and I dropped to reportfilter/column label/ row label or values it keep the right name.
But when I drag field between reportfilter, column label, row label and values the dragged item show the Property name instead of the Display Name (see the attachment)
How can I fix it?
Thank you
I want to cancel the delete event and not delete the current record. I just want to edit the current record and set the property "IsActive = false".
1.
private void MyDataForm_DeletingItem(object sender, System.ComponentModel.CancelEventArgs e)
2.
{
3.
Person currentPerson = this.MyDataForm.CurrentItem as Person;
4.
currentPerson.IsActive = true;
5.
e.Cancel = true;
6.
}
This code does not work. How can I implement the function?
When binding to a dynamic object in the grid, we all know that the Dynamic column will be treated as an object and the cell templates will not be what is expected for some columns. Is there a property on the Column (I haven't found one digging in the source yet) to set the columns data type or do I need to use a Template Selector to achieve this per column that I don't want to be treated as a string?
Thanks,
Maurice
RadDiagram:
Bing's branding guidelines states, "Bing Maps data provider attribution information can be accessed through the Get Imagery Metadata method in Bing Maps REST Services."
https://www.microsoft.com/en-us/maps/mobile-brand-guidelines
I see there's an imagery metadata classes in RadMaps, but I don't see how to access or use them. Can you provide an example?