Telerik Forums
UI for WPF Forum
1 answer
144 views
Hello,

It seems there is an issue with ColumnWidth property being speficied as a Style property for the RadGridView.  Here is my code

<Window x:Class="GridTest.MainWindow"
        Title="MainWindow"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Window.Resources>
        <Style TargetType="{x:Type telerik:RadGridView}">
            <Setter Property="ShowGroupPanel"   Value="False"/>
            <Setter Property="ColumnWidth" Value="*"></Setter>
        </Style>
         
    </Window.Resources>
    <Grid Margin="40">
        <telerik:RadGridView  Name="gridViewCheckBox1" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Qtr1"  DataMemberBinding="{Binding FinancialQuarter}" />
                <telerik:GridViewDataColumn Header="Qtr2" DataMemberBinding="{Binding FinancialQuarter}" />
                <telerik:GridViewDataColumn Header="Qtr3"  DataMemberBinding="{Binding FinancialQuarter}" />
                <telerik:GridViewDataColumn Header="Qtr4"  DataMemberBinding="{Binding FinancialQuarter}" />
            </telerik:RadGridView.Columns>
 
        </telerik:RadGridView>
    </Grid>
</Window>

The ShowGroupPanel="false" applies to the grid but I don't see the columns occupying all of the Grid's Width. Is this an existing bug of RadGridView?  Any help is appreciated.
Attached is the image of my output.

Note: It works when I specify this property explicitly for each of the RadGridView but not as a part of Style (either as a local resource/Window Resource/ ResourceDictionary)
Vera
Telerik team
 answered on 08 Mar 2012
1 answer
153 views
Basically I created a dynamic object, it can be an ExpandoObject or any object that inherits from the DynamicObject class, and assign several properties and their associated values to the object.  I then set the editor's Item equal to that object.  The property Fields was able to list all the object's properties just fine, but as soon as I select one of the property, the editor immediately underlines the property name which indicates an error.  The error message appears in the tooltips stated "The [name of selected property] is not a member of type System.Dynamic.ExpandoObject" when I hover over the text.  I'm using Q2 2011 edition.

Thanks in advance for your reply. 
Vlad
Telerik team
 answered on 08 Mar 2012
3 answers
129 views
Hello

I did upgraded all DLLs in the install-folder und changed the version-entry in all *.csproj files that i use. Now, I have massive problems to use the RadDocking.
I can complie the programm and it starts, too. But when I try to move a Pane an NullReferenceException will thrown.
All components (RadSplitContainer, RadGroups, RadPane and RadDocumentPane) are created by code, just the RadDocking is defiend in XAML.

I tried to build a Exsample  and I get allmost the same error

important is Application_Startup I need to create the MainWindow at this position!
If StyleManager.ApplicationTheme is assined than an exception will thrown when a Pane add to RadDocking .


public partial class App : Application
{
    private void Application_Startup(object sender, StartupEventArgs e)
    {
 
        StyleManager.ApplicationTheme = new Office_BlueTheme();
 
        this.MainWindow = new MainWindow();
        this.MainWindow.Show();
    }
}


public partial class MainWindow : RadRibbonWindow
{
    public MainWindow()
    {
        this.WindowState = WindowState.Maximized;
        InitializeComponent();
    }
 
 
    private void AddNewToolDocPane()
    {
        var container = Docking.DocumentHost as RadSplitContainer;
        if (container == null)
        {
            container = new RadSplitContainer() { InitialPosition = DockState.DockedBottom };
            Docking.DocumentHost = container;
        }
        var paneGroup = container.Items.OfType<RadPaneGroup>().FirstOrDefault();
        if (paneGroup == null)
        {
            paneGroup = new RadPaneGroup();
            container.Items.Add((paneGroup));
        }
 
        var pane = new RadPane();
        paneGroup.AddItem(pane, DockPosition.Center);
    }
 
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        AddNewToolDocPane();
    }
}

<telerik:RadRibbonWindow x:Class="WpfApplication2.MainWindow"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <StackPanel>
            <Button Content="test" Click="Button_Click"/>
        </StackPanel>
        <telerik:RadDocking Grid.Row="2" x:Name="Docking" BorderThickness="0" Padding="0" >
        </telerik:RadDocking>
    </Grid>
</telerik:RadRibbonWindow>


Boyan
Telerik team
 answered on 08 Mar 2012
1 answer
304 views
I need to be able to add a Custom Label to a Radial Gauge that will contain text indicating the status of the value being presented.  I am using the WPF Q2 2011 gauges and because of a time crunch I will not be able to upgrade the gauges to a newer version.  I know that the next version of gauge has this ability.  Please if anyone knows how to add a text label as indicated I need to know this quickly.  Thank you for your time and consideration on this question.

James
Andrey
Telerik team
 answered on 08 Mar 2012
0 answers
92 views
Hi everyone,

I'm working with the gridview. I'm trying to add a new row directly in the grid.
I have predefined columns , with the following types

Column1                        Column2                        Column 3                                Column4
GridViewDataColumn    GridViewDataColumn     GridViewComboBoxColumn    GridViewDataColumn

what i want to do is  that on the RowEditEnded, i check if it is an insert....and insert the record in the database.
When i enter data in the 1st column and press tab, it moves to the next, i add data to column2 and press tab , it moves to the 3rd column. From the 3rd column when i select something from the combo box and press tab to move to column 4, it fires the RowEditEnded event !!!! I was expecting this event to be fired on presseing tab on 4th column.

Why does a column with combo box triggers the roweditended.????

Anyone has noticed this behaviour before ?

Your helps and suggestions are most welcome

Regards,
Shaimaa
Shaimaa
Top achievements
Rank 1
 asked on 08 Mar 2012
2 answers
100 views
hi,
I use richtextbox with Arabic language. when save the document as a word (docx), it remove font size & font name (type). you can see the attached screenshot that show open it with MS Word but it don't show correct font size & font type.
Iva Toteva
Telerik team
 answered on 07 Mar 2012
24 answers
1.7K+ views
OK yet another MVVM question. I am trying to use RadWindow as a modal dialog in an MVVM application. I can get the Window to open through the PresentationModel, but the view, that gets passed into my PresentationModel, DataContext is null thus when I set the window.DataContext = this.view.DataContext the Window is invisible. If I comment out that line I do get a RadWindow that ofcourse has no properties set. So basically I am left with half the puzzle complete. I can open the RadWindow as I want, but how can I set its DataContext to that of my view if the views DataContext is null?

Any help would be appreciated!

Here is my PresentationModelCode
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
using VistaAdmin.Infrastructure;  
using System.ComponentModel;  
using VistaAdmin.Configuration.Properties;  
using System.Windows.Media;  
using System.Windows.Media.Imaging;  
using Microsoft.Practices.EnterpriseLibrary.Logging;  
using VistaAdmin.Composite.Extensions;  
using System.Windows.Input;  
using System.IO;  
using System.Windows;  
using System.Reflection;  
using System.Collections.ObjectModel;  
using Telerik.Windows.Controls;  
using System.Windows.Data;  
using VistaAdmin.Help.Interface;  
 
namespace VistaAdmin.Configuration.Applications  
{  
    internal class ConfigurationPresentationModel : PresentationModel<IConfigView>, IHeaderInfoProvider  
    {  
        private static readonly PropertyInfo HeaderInfoProperty = TypeManager.GetProperty<ConfigurationPresentationModel>(x => x.HeaderInfo);  
 
        private readonly IMessageService messageService;  
        private IDynamicHelp dynamicHelp;  
        private readonly IApplicationContainer container;  
        private RadWindow window;  
        private readonly DelegateCommand openWindowCommand;  
        private readonly IConfigView view;  
 
        public ConfigurationPresentationModel(IApplicationContainer container, IConfigView view, IMessageService messageService)  
            : base(view)  
        {  
            this.container = container;  
            this.messageService = messageService;  
            this.view = view;  
            dynamicHelp = container.TryResolve<IDynamicHelp>();  
            openWindowCommand = new DelegateCommand(Open, CanOpenExecute);              
            this.window = this.CreateWindow();  
        }  
 
        public string HeaderInfo  
        {  
            get { return Resources.Title; }  
        }  
 
        public ImageSource HeaderIcon  
        {  
            get { return new BitmapImage(ResourceService.GetPackUri("Resources/Config.ico")); }  
        }  
 
        private static void Log(string message, System.Diagnostics.TraceEventType severity)  
        {  
            LogEntry entry = new LogEntry();  
            entry.Severity = severity;  
            entry.Message = message;  
            entry.Title = "VistaAdminConfiguration";  
            entry.Categories.Add("Configuration");  
            Logger.Write(entry);  
        }  
 
        public ICommand OpenWindowCommand { get { return openWindowCommand; } }  
 
        private bool CanOpenExecute()  
        {  
            return !this.window.IsOpen;  
        }  
          
        public void Open()  
        {  
            if (!this.window.IsOpen)  
            {  
                this.window.ShowDialog();  
            }  
        }  
 
        private RadWindow CreateWindow()  
        {  
            window = new RadWindow();  
            window.DataContext = this.view.DataContext;  
            window.Closed += new EventHandler<WindowClosedEventArgs>(window_Closed);  
            window.Opened += new RoutedEventHandler(window_Opened);  
            return window;  
        }  
 
        void window_Opened(object sender, RoutedEventArgs e)  
        {  
            //this.window.IsOpen = true;  
        }  
 
        void window_Closed(object sender, WindowClosedEventArgs e)  
        {  
            //this.IsOpen = false;  
        }  
 
    }  
}  
 
 
View Xaml
<telerikNavigation:RadWindow x:Class="VistaAdmin.Configuration.Presentation.ConfigurationView" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"          
    xmlns:v="clr-namespace:VistaAdmin.Configuration.Presentation" 
    xmlns:p="clr-namespace:VistaAdmin.Configuration.Properties" 
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:telerikRibbonBar="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.RibbonBar" 
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    xmlns:xamlHelpers="clr-namespace:VistaAdmin.Configuration.Domain" 
    Header="{Binding HeaderInfo}"   
    mc:Ignorable="d" Height="450" Width="450">  
    <StackPanel> 
        <ToolBar> 
            <Button x:Name="configSaveButton" ToolTip="{x:Static p:Resources.Save}" Command="{Binding SaveConfigCommand}">  
                <Image Source="../Resources/save.png" Width="16" Height="16"/>  
            </Button> 
            <Button x:Name="configValidateButton" ToolTip="{x:Static p:Resources.Validate}" Command="{Binding DBValidateCommand}">  
                <Image Source="../Resources/db.png" Width="16" Height="16"/>  
            </Button> 
        </ToolBar> 
        <Grid> 
              
        </Grid> 
    </StackPanel> 
</telerikNavigation:RadWindow> 
Harpreet
Top achievements
Rank 1
 answered on 07 Mar 2012
2 answers
152 views
Hello,

I am trying to print a screenshot of a WPF window that contains several instances of RadCharts. When we do this, the frames that the charts are in resize, but the charts to not alter the visual to fit the new dimensions. For an example of this, you can see this in the XPS document that I uploaded.

Is there a way to make the RadChart look correct during printing? The container the chart resides in is just a user control with a border and a grid inside of it. The contents of the control always seem to work fine when there are other elements, just every time the RadChart never resizes. Any help with this issue is appreciated.
Scott Brian
Top achievements
Rank 1
 answered on 07 Mar 2012
8 answers
337 views
I am attempting to create a linear gauge that reflects the same properties of an older gauge that I have used in the past.  I have both the new and old gauges displayed in the attached screenshot.  What I need to know is how can I add a "Value Label" to my gauge (WPF) so that it will consistently display above the Marker as the Marker changes in value.  Thanks for any help that can be offered.

I am using version 2011.2.712.35 of the WPF control set.

 James
James
Top achievements
Rank 1
 answered on 07 Mar 2012
31 answers
846 views

                I tried to save chart as image as shown in below code,got error "The parameter value must be greater than zero.Parameter name: pixelWidth". Here my requrement is , Generating chart programatically and saving the same to JPEG in specified folder path. Anyone help me in doing this?

SeriesMapping sm1 = new SeriesMapping();
sm1.SeriesDefinition =
new LineSeriesDefinition();
sm1.LegendLabel =
"Line Series 1";
sm1.CollectionIndex = 0;
ItemMapping im1 = new ItemMapping();
im1.DataPointMember =
DataPointMember.YValue;
sm1.ItemMappings.Add(im1);
SeriesMapping sm2 = new SeriesMapping();
sm2.SeriesDefinition =
new LineSeriesDefinition();
sm2.LegendLabel =
"Line Series 2";
sm2.CollectionIndex = 1;
ItemMapping im2 = new ItemMapping();
im2.DataPointMember =
DataPointMember.YValue;
sm2.ItemMappings.Add(im2);
var itemsSource = new List<double>[] { new List<double> { 22, 12, 66, 76 }, new List<double> { 76, 45, 53, 43 } };
this.RadChart1.SeriesMappings.Add(sm1);
this.RadChart1.SeriesMappings.Add(sm2);
this.RadChart1.ItemsSource = itemsSource;

 

RadChart1.ExportToImage(

 

@"d:\remove\abc.png");

 

grid.Children.Add(RadChart1);


I tried to change ExportToImage method as follows, but there is no class named 'PngBitmapEncoder' under "Telerik.Windows.Media.Imaging" namespace in WPF related DLLs provided by Telerik, but this is working fine in Silverlight related DLLs provided by Telerik. Can anyone help me here to save chat as image in JPEG format.

Stream fileStream = File.Create(@"d:\ss\ss.png") ;

RadChart1.ExportToImage(fileStream, new Telerik.Windows.Media.Imaging.PngBitmapEncoder());

fileStream.Close();

Nicholas
Top achievements
Rank 2
 answered on 07 Mar 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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?