Telerik Forums
UI for WPF Forum
1 answer
272 views
Hi,

I have a toolbox with custom shapes. I have a grid with snapping to grid enabled.
Once shapes are on the grid, they snap fine when I drag them.
But they don't snap the first time, when I drag shapes from the toolbox.

I would like to achieve this. Is there some setting I'm missing? Or would I have to implement a custom Snapping Service maybe?

Thanks for any input.
Zarko
Telerik team
 answered on 04 Feb 2015
6 answers
283 views
Hi There 

I have been loading shapefiles which are copied into the project whose Build Action is set to Resource.

Now I have a situation where we are creating shapefiles at runtime and are saved to different location i.e c:\\Shapefile\\

1. How can I load shapefile created at runtime using UI Virtualization asyn reader.

2. It is good practice to create virtualization layer for each shapefiles or load all shapefiles in one virtualization layer. Each shapefiles have different properties i.e. zoom level, fill etc, so i assume I should create virtualization layer for each shapefiles.

3. The property of shapefiles are saved in .dbf file.Can we read .dbf files to create a property window to get/set shapefile properties.Do you have any similar project on GitHub.

Thanks in Anticipation.
Pavel R. Pavlov
Telerik team
 answered on 04 Feb 2015
1 answer
129 views
Hello Group, I have see various topics on the Isdropdown but none of them seem to have the solution to this specific problem: I am trying to control the opening and closing behaviour of the behaviour by setting the Isropdown property but is does not seem to work.
Is there a solution for this one?

Thanks,

    Richard
Nasko
Telerik team
 answered on 04 Feb 2015
1 answer
185 views
Hello /< /> how to set direction right to left worksheet or workbook when export radgrid data to excel?
i use :
using Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx;
using Telerik.Windows.Documents.Spreadsheet.Model;
            var workbook = new Workbook();
            var worksheet = workbook.Worksheets.Add();
thanks
Anna
Telerik team
 answered on 04 Feb 2015
8 answers
353 views
I am trying to use a custom type in my filter where I want to show all distinct versions of my type in the list, and this works! 


But when I select a value and try to filter on that value I get an error

var filter = new FilterDescriptor(dataMember, FilterOperator.IsEqualTo, checkBoxCustomFilterType.Text);

filter has the value "{PTestType IsEqualTo ks k}" where "ks k" is one of my distint values but its like the PTestType is not converted using the typeconverter? Because then this is thrown 

An exception of type 'System.ArgumentException' occurred in mscorlib.dll but was not handled in user code

Additional information: The value "(PTestType IsEqualTo ks k)" is not of type "Telerik.Windows.Data.IFilterDescriptor" and cannot be used in this generic collection.



Custom type Class

namespace Systematic.KVK.InseminationPlan.UIL.Details.Windows.TestBucket.DOM
{
    [TypeConverter(typeof(TestTypeConverter))]
    public class PTestType : IEquatable<PTestType>
    {
        public long Id { get; set; }
        public string ShortTestName { get; set; }
        public string TestName { get; set; }
 
        public bool Equals(PTestType other)
        {
            return Id == other.Id;
        }
 
        public override string ToString()
        {
            return ShortTestName;
        }
 
        public override int GetHashCode()
        {
            return (int)Id;
        }
 
        public override bool Equals(object obj)
        {
            var type = obj as PTestType;
            if (type != null)
            {
                return Id == type.Id;
            }
 
            return false;
        }
 
        bool IEquatable<PTestType>.Equals(PTestType other)
        {
            if (other == null)
            {
                return false;
            }
 
            return StringComparer.Ordinal.Equals(Id, other.Id);
        }
    }
}


Type converter and valueconverter

namespace Systematic.KVK.InseminationPlan.UIL.Details.Windows.TestBucket.Tabs.TestBucketTab
{
    public class PTestTypeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var TestType = (PTestType)value;
 
            return TestType.ShortTestName;
        }
 
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
 
    public class TestTypeConverter : TypeConverter
    {
        public TestTypeConverter()
        {
             
        }
 
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
            return sourceType == typeof(string);
        }
 
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            var stringValue = value as string;
            if (stringValue != null)
            {
                return new PTestType {Id = 1, TestName = "sdfsdf",ShortTestName = "shortsd"};
            }
 
            return base.ConvertFrom(context, culture, value);
        }
 
        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
        {
            if (destinationType == typeof(string))
            {
                return true;
            }
 
            return base.CanConvertTo(context, destinationType);
        }
 
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            if (destinationType == typeof(string))
            {
                return ((PTestType)value).ShortTestName;
            }
 
            return base.ConvertTo(context, culture, value, destinationType);
        }
    }
}


My Custom filter codebehind

namespace Systematic.KVK.InseminationPlan.UIL.Details.Windows.TestBucket.CustomFilters
{
    public partial class TestTypeCheckBoxFilterControl : IFilteringControl
    {
        public ObservableCollection<CheckBoxCustomFilterType> CustomItems { get; set; }
        private GridViewBoundColumnBase column;
        private CompositeFilterDescriptor compositeFilter;
 
        public TestTypeCheckBoxFilterControl()
        {
            InitializeComponent();
            CustomItems = new ObservableCollection<CheckBoxCustomFilterType>();
             
            DataContext = this;
        }
 
        private void OnFilter(object sender, RoutedEventArgs e)
        {
            column.DataControl.FilterDescriptors.Clear();
            compositeFilter = new CompositeFilterDescriptor {LogicalOperator = FilterCompositionLogicalOperator.Or};
            var dataMember = column.DataMemberBinding.Path.Path;
            foreach (var checkBoxCustomFilterType in CustomItems)
            {
                if (checkBoxCustomFilterType.Checked)
                {
                    var filter = new FilterDescriptor(dataMember, FilterOperator.IsEqualTo, checkBoxCustomFilterType.Text);
                    compositeFilter.FilterDescriptors.Add(filter);
                }
            }
 
            if (!column.DataControl.FilterDescriptors.Contains(compositeFilter))
            {
                column.DataControl.FilterDescriptors.Add(compositeFilter);
            }
 
            IsActive = true;
        }
 
        private void OnClear(object sender, RoutedEventArgs e)
        {
            column.DataControl.FilterDescriptors.Clear();
            compositeFilter.FilterDescriptors.Clear();
            CustomItems.ForEach(x => x.Checked = false);
        }
 
        public void Prepare(Telerik.Windows.Controls.GridViewColumn column)
        {
            CustomItems.Clear();
 
            this.column = column as GridViewBoundColumnBase;
 
 
 
            var distinctValues = ((RadGridView)column.Parent).GetDistinctValues(column, false);
 
            foreach (PTestType distinctValue in distinctValues)
            {
                CustomItems.Add(new CheckBoxCustomFilterType {Checked = false, Text = distinctValue.ToString()});
            }
        }
 
        public bool IsActive { get; set; }
 
        private void SelectAll(object sender, RoutedEventArgs e)
        {
            var checkbox = (sender as CheckBox);
            if (checkbox == null || checkbox.IsChecked == null)
            {
                return;
            }
 
            foreach (var checkBoxCustomFilterType in CustomItems)
            {
                checkBoxCustomFilterType.Checked = checkbox.IsChecked.Value;
            }
        }
    }
}


My usages of my custom filter

<telerik:GridViewDataColumn
    DataMemberBinding="{Binding Path=PTestType}"
    IsReadOnly="True"
    IsFilterable="True"
    Header="{x:Static localization:TestBucketTexts.TestType}">
    <telerik:GridViewDataColumn.FilteringControl>
        <customFilters:TestTypeCheckBoxFilterControl />
    </telerik:GridViewDataColumn.FilteringControl>
    <telerik:GridViewDataColumn.CellTemplate>
        <DataTemplate DataType="dom:PBucketModel">
            <TextBlock
                Text="{Binding Path=PTestType}" />
        </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
Boris
Telerik team
 answered on 04 Feb 2015
4 answers
256 views
Hello gurus! :-)

I am working on a project where one specific menu needs to have its sub menus open on the left rather than the right. I have tried the Placement property on the popups in the styles, but they don't seem to have any effect. Can you please help me?
Eric Moreau
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 04 Feb 2015
3 answers
190 views
Hi,

I've searched the forums as well as the documentation but I couldn't get what I wanted. What I'm after is having something similar to this http://www.telerik.com/help/wpf/radcombobox-grid-like-dropdown.html but using the Telerik Gridview control instead. I could get things going a bit as shown in the attachment. However, I did it by binding the gridview to the data because when I try to also bind the data to the combobox I get an error at runtime telling me "{"Items collection must be empty before using ItemsSource."}".

Is what I'm trying to achieve even possible currently? If so how?

TIA

David
Kalin
Telerik team
 answered on 04 Feb 2015
4 answers
172 views
How do I add a ContextMenu for the PDFViewer?

I've tried this;
<telerik:RadContextMenu.ContextMenu>
                    <telerik:RadContextMenu DataContext="{Binding ElementName=pdfViewer, Path=Commands}">
                        <telerik:RadMenuItem Header="Copy" Command="{Binding CopyCommand}"/>
                        <telerik:RadMenuItem Header="Select All" Command="{Binding SelectAllCommand}"/>
                        <telerik:RadMenuItem Header="Print..." Command="{Binding PrintPdfDocumentCommand}"/>
                    </telerik:RadContextMenu>

But the menu items don't do anything.

Thanks.
Kammen
Telerik team
 answered on 04 Feb 2015
6 answers
176 views
As I know, in case of no data, the chart shows the text "No data to plot" by default.
ChartView provides 2 properties to customize the no data content and style, they are EmptyContent and EmptyContentTemplate.

The strange thing is - The chart still show the default text if its EmptyContent is bound to a view model property, but if the customized text is set to EmptyContent directly in xaml then it works well.

I made the same settings to VerticalAxis - bind Title and set TitleTemplate and didn't has this problem.

Any suggestion? Thank you.
Petar Marchev
Telerik team
 answered on 04 Feb 2015
5 answers
183 views
Hi,

i am currently evaluating some of the Telerik-Controls. So i created a sample project.
Now i have one question related to the Spreadsheet Control:

There was functionality included in the roadmap:
Conditional Formatting
Applying different visual settings to cells based on the data they contain allows you to identify variances in a range of values with a quick glance. The feature is very useful for comparing values, selecting rows dynamically and spotting duplicates easily.

Is Conditional Formatting included in the current WPF-Spreadsheet? I also tried out the demos but i was not able to find the fomatting.

I also wrote an email to the Trial-Support, but i do not receive an response :(.

Thank you very much!
Andy



Tanya
Telerik team
 answered on 03 Feb 2015
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?