Telerik Forums
UI for WPF Forum
7 answers
580 views
since braking changed on for the Q1-2012 version your ColumnFilterDescriptor is not internal and was public..   :( 
I use to inherits this class for a special feature for filtering a "flagable enum"

Since it is cannot be inherits anymore, I try ro create my filter again

big lines:
1. standard "disctinct values"
2. an enum that have multiple state are included in filter even if the values is not "EQUALS" but contains...


My problem reside on the "yellow hilighted line."

Braking changes links : http://www.telerik.com/community/forums/wpf/gridview/known-issues-and-breaking-changes---radgridview.aspx
complete doc : Doc

My code: (not original, but cleaned for reading perpose..)

class MaxEnumFlagsDescriptor : FilterDescriptor

{

    private FilterDescriptor<MaintenanceBoxDataDataTableRow> Filter;

    private string dataMember;

    /// <summary>

    /// Initializes a new instance of the <see cref="MaxEnumFlagsDescriptor"/> class.

    /// </summary>

    /// <param name="control">The column.</param>

    /// <param name="dataMember">The data member.</param>

    /// <param name="enumType">Type of the enum.</param>

    public MaxEnumFlagsDescriptor(MaxFilteringControl control, string dataMember, Type enumType)

    {

        if (dataMember.StartsWith("["))

            dataMember = dataMember.RemoveFromStart(1).RemoveFromEnd(1);

        this.Control = control;

        this.Column = control.GridColumn as GridViewBoundColumnBase;

        this.dataMember = dataMember;

        this.EnumType = enumType;

        Filter = new FilterDescriptor<MaintenanceBoxDataDataTableRow>();

        Filter.FilteringExpression = (e) => (Check(e));

    }

     /// <summary>

    /// Creates the filter expression.

    /// </summary>

    /// <param name="instance">The instance.</param>

    /// <returns></returns>

    public override System.Linq.Expressions.Expression CreateFilterExpression(System.Linq.Expressions.Expression instance)

    {

        return Filter.CreateFilterExpression(instance);

    }

     private bool Check(DataRow row)

    {

        if (this.DistinctValue == null || !this.Control.IsActive)

            return true;

        var desc = this.DistinctValue;  // this was available in the ColumnFilterDescriptor. originaly
                                        // in the class (so how to get it..)
                                        // HOW TO GET THE CHECKED VALUES OF THE DISTINCT VALUE LIST

        if (!desc.Any())

            return true;

        Debug.Assert(row != null, "Should have found a Row");

        if (row != null)

        {

            var inf = row[this.dataMember];

            if (inf == DBNull.Value)

                inf = null;

            if (inf == null)

                return desc.Any(c => c == null);

            else

            {

                var enumType = this.EnumType;

                try

                {

                    var val = Enum.ToObject(enumType, inf).ToString();

                    return desc.Any(c => IsInclude(c, val, enumType));

                }

                catch (System.Exception ex)

                {

                    // In case of old value

                    Debug.Fail(ex.Message);

                    return false;

                }

            }

        }

        return true;

    }

    private static bool IsInclude(object value, string data, Type enumType)

    {

        var val = Enum.ToObject(enumType, value).ToString();

        return data.IndexOf(val) >= 0;

    }

}


Luc
Top achievements
Rank 1
 answered on 05 Jun 2012
1 answer
111 views
Hello Telerik Team,

i tried to use the RadRichTextBoxribbonUI with the RadRichTextBox as it is described here.

http://www.telerik.com/help/wpf/radrichtextbox-features-radrichtextboxribbonui.html#RadRichTextBoxRibbonUI_priorTo_2011.Q3
(Using RadRichTextBoxRibbonUI based on RadRibbonBar using 2011.2.xxx or older)

when i am draging the RadRichTextBoxribbonUI from the Toolbox into the designer area i get the this error.

Die Ressource "images/msoffice/16/linktopreviousheaderfooter.png" kann nicht gefunden werden.
   bei Microsoft.Windows.Design.DocumentModel.ModelProducer.<OnLoad>b__2(Damage damage)
   bei MS.Internal.Design.DocumentModel.DocumentTrees.VirtualModel.VirtualModelDocumentTreeManager.OnEditingScopeComplete(VirtualEditingScope scope)
   bei MS.Internal.Design.DocumentModel.DocumentTrees.VirtualModel.VirtualModelDocumentTreeManager.VirtualEditingScope.OnComplete()
   bei Microsoft.Windows.Design.Model.ModelEditingScope.Complete()
   bei Microsoft.Windows.Design.Interaction.Task.Complete()
   bei MS.Internal.Creation.DragDropCreationTask.OnCreateAt(Object sender, ExecutedToolEventArgs args)

for all who can not read german i will translate the error message.
German: Die Ressource "images/msoffice/16/linktopreviousheaderfooter.png" kann nicht gefunden werden.
=
English: the ressource "images/msoffice/16/linktopreviousheaderfooter.png" can not be found

I hope you can help me

best regards
Martin Ivanov
Telerik team
 answered on 05 Jun 2012
2 answers
113 views
Hi,

I am using telerik treeview control alongwith ,NET System.Windows.Interactivity to implement the drag and drop feature.

Recently i upgraded to version 2012.1.0326.40 and since then the drag and drop feature has stopped working.

Reverting to the older version of 2011.2.0920.40 with same code makes drag and drop works.

Appreciate your help on the same.
raju
Top achievements
Rank 1
 answered on 05 Jun 2012
20 answers
996 views
Hi,

I am in the process of evaluating Telerik Gridview.  Our data is organized in groups.  I created a RadGridView that uses 1 column as a GroupDescriptor.  I noticed that the scrolling through each grouped table is VERY slow as each group is expanded (AutoExpandGroups="True").  The performance is better if I remove GroupDescriptor altogether.  Here are what I set in my RadGridView:

<code>CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed"  AutoGenerateColumns="False" IsReadOnly="True" ScrollMode="Deferred"   telerik:StyleManager.Theme="Metro" FontSize="11" ShowGroupPanel="False" RowHeight="18" Grid.Row="1"  Width="1320" MaxWidth="1320" MinHeight="800" MaxHeight="1000"</code>


Is there anything I can do to increase the performance.  The table size is around 14000 cells.  

I saw this earlier post and it was stated that the issue was resolved. I can't download the code as I am not yet a licensed user.
http://www.telerik.com/support/pits.aspx#/public/winforms/4570 

Please advise.  Thanks.
Johnson
Top achievements
Rank 1
 answered on 05 Jun 2012
8 answers
134 views
I have created RadGridview to check the Validating Data on a Property Level. When i run the code and give invalid value, exception is thrown but it wouldn't been caught by the RadGridView. I am Using
WPF 4.0    Version 2010.2 924

Here is the Code

<Window x:Class="WpfApplication1.Window1"
        Title="Window1" Height="300" Width="565" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Loaded="Window_Loaded">
    <Grid>
        <telerik:RadGridView Name="radGridView1" AddingNewDataItem="radGridView1_AddingNewDataItem" ShowInsertRow="True">
        </telerik:RadGridView>
    </Grid>
</Window>

using System;
using System.Windows;
using System.Collections.ObjectModel;
 
namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
        }
 
        public ObservableCollection<Employee> GetEmployees()
        {
            ObservableCollection<Employee> employees = new ObservableCollection<Employee>();
            return employees;
        }
 
        private void radGridView1_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            e.NewObject = new Employee();
        }
 
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.radGridView1.ItemsSource = this.GetEmployees();
        }
 
    }
 
    public class Employee
    {
        string _FirstName;
 
        public string FirstName
        {
            get { return _FirstName; }
            set
            {
                if (value.Length > 5)
                {
                    throw new Exception("Firstname must be less than 6");
                }
                 _FirstName = value;
            }
        }
         
     }
}

check the attachment for error screen shot.
Rajesh
Top achievements
Rank 1
 answered on 05 Jun 2012
3 answers
142 views
I there any code snippet (or already existing control) on how to make an option dialog like the one of Microsoft Word 2007.

I would like to use Telerik controls so that I can take advantage of the themes.

I'm using PRISM and my goal is to make a "options service" component in which different modules can push options view.

Regards,

Nicolas
Nicolas
Top achievements
Rank 1
 answered on 05 Jun 2012
7 answers
380 views
Hi,

I've implemented this helpful example code (http://demos.telerik.com/silverlight/#GridView/PrintAndExportWithRadDocument) and it is all working as expected, however the table that is created does not take up the whole width of the page. I notice it uses the column widths of the RadGridView, however they are not ideal in the A4 pdf. I would like the table that is created for the pdf to size itself based on content. Is this possible, and if so, how would I do it? I figure it's got something to do with this line:
cell.PreferredWidth = new TableWidthUnit((float)columns[i].ActualWidth);


Thanks
Iva Toteva
Telerik team
 answered on 05 Jun 2012
1 answer
150 views
I'm working on a project where I have a large amount of data stored in a database organized into a tree. I'm using the EntityFramework, so I'm using the QueryableEntityCollectionView to filter my data and a RadTreeView to display it.

However, I also need support for drag & drop to add/move/delete items. By default, the RadTreeView won't let me drop into this tree as it is. If it was an IList or an ObservableCollection, it will let me, but I need to be able to refresh/filter the visible nodes in the tree.

Is there a way to override the d&d support in RadTreeView to allow drops, and run custom code on drop complete?

I did see this post (http://www.telerik.com/community/forums/silverlight/treeview/use-drag-and-drop-to-rearrange-items-and-then-persist-order-back-to-database.aspx) but it's for silverlight and I don't think the WCF side is needed for a WPF + EF application.

Any advice?
Thanks!
Hristo
Telerik team
 answered on 05 Jun 2012
0 answers
129 views
When the list box lives inside a RadTileView, the OnDrop event will get fired twice with the same parameters.
<telerik:RadTileView>
    <telerik:RadTileViewItem>
 
        <Grid x:Name="LayoutRoot" Background="White">
            <Grid.Resources>
                <Style TargetType="ListViewItem">
                    <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True"></Setter>
                </Style>
                <DataTemplate x:Key="ApplicationTemplate">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="5" Text="{Binding Name}" VerticalAlignment="Center"></TextBlock>
                    </StackPanel>
                </DataTemplate>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <ListView x:Name="ApplicationList" ItemTemplate="{StaticResource ApplicationTemplate}" AllowDrop="True"/>
            <ListView x:Name="MyAppList" Background="Gray" Grid.Column="1" 
            ItemTemplate="{StaticResource ApplicationTemplate}" AllowDrop="True"/>
        </Grid>
    </telerik:RadTileViewItem>
</telerik:RadTileView>


public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        ObservableCollection<Item> items = new ObservableCollection<Item>();
        for (int i = 1; i <= 10; i++)
            items.Add(new Item() { Name = string.Format("item {0}", i) });
        ApplicationList.ItemsSource = items;
        MyAppList.ItemsSource = new ObservableCollection<Item>();
 
        DragDropManager.AddDragInitializeHandler(ApplicationList, OnDragInitialize);
        DragDropManager.AddDragInitializeHandler(MyAppList, OnDragInitialize);
        DragDropManager.AddGiveFeedbackHandler(ApplicationList, OnGiveFeedback);
        DragDropManager.AddGiveFeedbackHandler(MyAppList, OnGiveFeedback);
        DragDropManager.AddDragDropCompletedHandler(ApplicationList, OnDragCompleted);
        DragDropManager.AddDragDropCompletedHandler(MyAppList, OnDragCompleted);
        DragDropManager.AddDropHandler(ApplicationList, OnDrop);
        DragDropManager.AddDropHandler(MyAppList, OnDrop);
    }
 
    private void OnDragInitialize(object sender, DragInitializeEventArgs args)
    {
        args.AllowedEffects = DragDropEffects.Move;
        //args.AllowedEffects = DragDropEffects.All;
        args.Data = ((FrameworkElement)args.OriginalSource).DataContext;
        args.DragVisual = new ContentControl { Content = args.Data, ContentTemplate = LayoutRoot.Resources["ApplicationTemplate"] as DataTemplate };
    }
 
    private void OnGiveFeedback(object sender, Telerik.Windows.DragDrop.GiveFeedbackEventArgs args)
    {
        System.Diagnostics.Trace.WriteLine(string.Format("{0} - OnGiveFeedback sender={1}", DateTime.Now, sender));
        args.SetCursor(Cursors.Arrow);
        args.Handled = true;
    }
 
    private void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs args)
    {
        System.Diagnostics.Trace.WriteLine(string.Format("{0} - OnDrop sender={1}", DateTime.Now, sender));
        ((IList)(sender as ListBox).ItemsSource).Add(((DataObject)args.Data).GetData(typeof(Item)));
    }
 
    public void OnDragCompleted(object sender, Telerik.Windows.DragDrop.DragDropCompletedEventArgs args)
    {
        System.Diagnostics.Trace.WriteLine(string.Format("{0} - OnDragCompleted sender={1}", DateTime.Now, sender));
        ((IList)(sender as ListBox).ItemsSource).Remove(args.Data);
    }
}
 
public class Item
{
    public string Name { get; set; }
}

Wenrong
Top achievements
Rank 1
 asked on 05 Jun 2012
0 answers
83 views
I have implemented a basic drag-n-drop using Telerik's new DragDropManager, pretty much the same as instructed here http://www.telerik.com/help/wpf/dragdropmanager-getting-started.html except that I am using ListView instead of ListBox.

Although it works, but I need help on the following two things:
  1. How to I limit the drag-n-drop so that it can only happen between the two listviews? i.e. disallow dropping to the same listview as the drag source.
  2. How to change cursor based on the above criteria? I try to monitor OnGiveFeedback(), but the sender is always the drag source...
Wenrong
Top achievements
Rank 1
 asked on 05 Jun 2012
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
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
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?