Telerik Forums
UI for WPF Forum
1 answer
111 views

 Hello,

I have an issue with reading PDF files. If I change BuildAction property via VisualStudio from none to resource it works but if I keep none it doesn't work. The PDF files are dynamically added to the folder by the user. Is there a way to solve this problem, I mean a way to read the PDF files without changing the BuildAction property  ?

 

Thanks in advance.

<telerik:RadPdfViewer Grid.Row="1" x:Name="pdfViewer" DataContext="{Binding ElementName=pdfViewer, Path=CommandDescriptors}">

this.pdfViewer.DocumentSource = new PdfDocumentSource(new Uri("MyProject;component/Contenu/PDF/Facture.pdf", UriKind.Relative));

Tanya
Telerik team
 answered on 22 May 2015
1 answer
1.3K+ views

Hi Team

1)Is possible to add column dynamically when i click in add button in mvvm pattern.

2)Is possible to get all the row values of single column based on the column name provided.

3)Is Possible to binding column with different collection(Ex. column1 is filled NameRegister, column2 to is bind with some telephone collection.

Thanks

Sankar A

 

Stefan
Telerik team
 answered on 22 May 2015
3 answers
254 views

Hello,

 I am having a performance problem with the combobox column of the RadGridView control. When bound to small data, the combobox works great, but when the data is large (18000+ items), the combobox seems very slow, frozes for 2 seconds when i enter edit mode, don't change the item and leave the edit mode, and frozes for 5 seconds when i change the selected item and leave the edit mode. I cannot accept this user experience. Is there a way to improve this performance?

 I made a sample to show you the problem:

P.S.: I have to generate the columns in the code behind, because they are dynamic.

XAML:

<Window x:Class="TelerikWpfApp1.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
        <Grid>
            <telerik:RadGridView Name="gridView" Grid.Row="0" ColumnWidth="*" AutoGenerateColumns="False"
                                 SelectionMode="Extended" ScrollMode="Deferred" GroupRenderMode="Flat"/>
        </Grid>
</Window>

 

Code Behind (C#):

using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using Telerik.Windows.Controls;

namespace TelerikWpfApp1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            InitializeGrid();
        }

        private void InitializeGrid()
        {
            this.gridView.BeginInit();
            this.gridView.Columns.Add(new GridViewSelectColumn());
            this.gridView.Columns.Add(new GridViewDataColumn()
            {
                Header = "Order Id",
                DataMemberBinding = new Binding("Id")
            });

            var comboColumn = new GridViewComboBoxColumn();
            comboColumn.Header = "Client";
            comboColumn.IsComboBoxEditable = true;
            comboColumn.SelectedValueMemberPath = "Id";
            comboColumn.DisplayMemberPath = "Name";
            comboColumn.ItemsSource = getClients();
            comboColumn.DataMemberBinding = new Binding("ClientId")
            {
                Mode = BindingMode.TwoWay
            };

            var style = new Style(typeof(RadComboBox));
            style.Setters.Add(new Setter(RadComboBox.TextSearchModeProperty,
                                                     TextSearchMode.Contains));
            comboColumn.EditorStyle = style;

            this.gridView.Columns.Add(comboColumn);

            comboColumn = new GridViewComboBoxColumn();
            comboColumn.Header = "Product";
            comboColumn.IsComboBoxEditable = true;
            comboColumn.SelectedValueMemberPath = "Id";
            comboColumn.DisplayMemberPath = "Name";
            comboColumn.ItemsSource = getProducts();
            comboColumn.DataMemberBinding = new Binding("ProductId")
            {
                Mode = BindingMode.TwoWay
            };

            style = new Style(typeof(RadComboBox));
            style.Setters.Add(new Setter(RadComboBox.TextSearchModeProperty,
                                                     TextSearchMode.Contains));
            comboColumn.EditorStyle = style;

            this.gridView.Columns.Add(comboColumn);

            this.gridView.ItemsSource = getOrders();
            this.gridView.EndInit();
        }

        private DataView getOrders()
        {
            var dt = new DataTable();

            dt.Columns.Add(new DataColumn()
            {
                ColumnName = "Id",
                DataType = typeof(string),
                MaxLength = 10
            });

            dt.Columns.Add(new DataColumn()
            {
                ColumnName = "ClientId",
                DataType = typeof(string),
                MaxLength = 10
            });

            dt.Columns.Add(new DataColumn()
            {
                ColumnName = "ProductId",
                DataType = typeof(string),
                MaxLength = 10
            });

            dt.Rows.Add(1, 1, 17000);
            dt.Rows.Add(2, 2, 1892);

            return dt.DefaultView;
        }

        private DataView getClients()
        {
            var dt = new Model();

            dt.Rows.Add(1, "Walmart");
            dt.Rows.Add(2, "Coca-Cola Company");

            return dt.DefaultView;
        }

        private DataView getProducts()
        {
            var dt = new Model();

            for (int i = 0; i < 18000; i++)
                dt.Rows.Add(i, "Name " + i);

            return dt.DefaultView;
        }
    }
}

 

Model Class:

using System;
using System.Data;

namespace TelerikWpfApp1
{
    public class Model : DataTable
    {
        public Model() : base()
        {
            this.Columns.Add(new DataColumn()
            {
                ColumnName = "Id",
                DataType = typeof(string),
                MaxLength = 10
            });

            this.Columns.Add(new DataColumn()
            {
                ColumnName = "Name",
                DataType = typeof(string),
                MaxLength = 100
            });
        }
    }
}

Dimitrina
Telerik team
 answered on 22 May 2015
1 answer
124 views

Hello experts,

I have one requirement in grid view where, I wanted to show parents as selected whose child is selected. For e.g. I have one hierarchical structure where

Parent 1 has one child and this child has one more child (Grandchild) likewise....

Now when I select Grandchild or child, its respective parents should also get selected/highlighted.  

 So, I have following questions-

1) Is there any property/method available which I can use it in Xaml to achieve this?

2) If not, then what will be the recommended approach to do this (sample example, with code will be appreciated)?

 

Thanks in Advance,

Vinayak

Dimitrina
Telerik team
 answered on 22 May 2015
1 answer
117 views

I am using Interaction trigger on RowEditEnded. If the user enter invalid value, I want to remove that row from the Grid. How can I do this ?

ItemsSource="{Binding ItemSource,Mode=TwoWay }"

 <i:Interaction.Triggers>
                    <i:EventTrigger EventName="RowEditEnded">
                        <cmd:EventToCommand Command="{Binding EditingCommand}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>

 

 if (this.ItemSource.Count > 0)
            {
                var newItem = this.ItemSource.FirstOrDefault(d => d.ItemOrder == null);

                if (newItem != null)
                {
                    if (newItem.Id > 0)
                    {
                       newItem .ItemOrder = this.ItemSource.Count;
                    }
                    else
                    {
                        this.ItemSource.Remove(newItem );
                    }   
                }
            }

Maya
Telerik team
 answered on 22 May 2015
1 answer
129 views

Hello,

why does SelectionChanging Event in the GridView only get fired, if i click on a row, but not when switching between rows with the arrow keys. The selection mode is SelectionMode.Multiple.

 

Thank you!

Stefan
Telerik team
 answered on 22 May 2015
1 answer
261 views

I'm importing an excel spreadsheet into RadSpreadsheet, and everything is working great except for one thing.

Certain labels on my spreadsheet use subscript and superscript and the formatting is not showing up properly in RadSpreadsheet. The text just shows up as regular text.  Here's the code I'm using to import the spreadsheet:

WorkbookFormatProvidersManager.RegisterFormatProvider(new XlsxFormatProvider());
FileStream input = new FileStream("Default.xlsx", FileMode.Open);
workbook = WorkbookFormatProvidersManager.Import("xlsx", input);
rssCalibration.Workbook = workbook;

 

 Is there something else I need to be doing to get the subscript and superscript to display properly?

 

 

Anna
Telerik team
 answered on 22 May 2015
1 answer
314 views

I'm trying to implement Excel-like behavior on an editable RadGridView. I need to be able to use the arrow up and down keys to move up and down the rows, staying in the same field/textbox.

 I've looked all over the internet and forums to see how to do this and I can't find any good information on it. I tried setting up the CustomKeyboardCommandProvider class but that didn't work. It appears that by default the Tab and Enter keys have commands attached to them but not the arrow keys.

 Can someone point me in the right direction?

Dimitrina
Telerik team
 answered on 22 May 2015
3 answers
213 views

Hello,

 

i have a problem with the WPF RadTimeLine-Control from Q1 2015. If 

<UserControl x:Class="......Workflow.WorkflowTimeLine"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid>
        <telerik:RadTimeline
                    VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                    PeriodStart="{Binding StartDate, Mode=TwoWay}"
                    PeriodEnd="{Binding EndDate, Mode=TwoWay}"
                    StartPath="Date"
                    DurationPath="Duration"
                    ToolTipPath="Annotation"
            SelectionMode="Single"
                ScrollMode="None"
            GroupExpandMode="None"
            GroupPath="WorkflowName"
                    ItemsSource="{Binding Data}">
            <telerik:RadTimeline.Intervals>
                <telerik:MonthInterval />
                <telerik:WeekInterval />
                <telerik:DayInterval />
                <telerik:HourInterval />
                <telerik:MinuteInterval />
            </telerik:RadTimeline.Intervals>
        </telerik:RadTimeline>
    </Grid>
</UserControl>

The problem appears after updating to the newest assemblies. The error message is: XamlParseException. TargetType 'RadSlider' does not match the type of elements 'TimelineScrollBar'.

I have no idea what's wrong with our code.

Martin Ivanov
Telerik team
 answered on 22 May 2015
2 answers
130 views

Hi,

I select an item in codebehind, but I want to get item in ViewPort. I try to scroll diagram according to item position. It does not work. I just want user to see item, which I select in code, in screen . How can I do that?

Thanks in advance.

Mahmut.

Mahmut
Top achievements
Rank 1
 answered on 22 May 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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?