Telerik Forums
UI for WPF Forum
9 answers
305 views
Hi ,
I am using RadRichtextBox for print of RadGridView Data.Print is working but All the column in RadGridView  is not cmming.Its get cuts from end.
 My reqirement is when there is more column then those column should appear automatically in the next page consecutively or next document.

Please find my attached document also.And please help me it is very urgent ..

Thanks in advanced...
Regards
Rahman
Petya
Telerik team
 answered on 20 Nov 2013
1 answer
93 views
public void test()
        {
            LineSeries line1 = new LineSeries() { };
            for (int i = 0; i < 10; i++)
            {
                line1.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint() { Value = i });
            }
 
            line1.MouseLeftButtonDown += (sender, args) => MouseLeftDown(sender, args, chart1);
 
            chart1.Series.Add(line1);
        }
 
        public void MouseLeftDown(object sender,MouseButtonEventArgs args,RadCartesianChart chart)
        {
         
        }

Can I use MouseEvent to get the  datapoint of line?


I set  MouseDown in LineSeries and I want to add datapoint where I trigger this event.

But I can't find any data about  the position of line. 
Yavor
Telerik team
 answered on 20 Nov 2013
1 answer
92 views
chart[i].HorizontalAxis= new LinearAxis() {  LabelInterval = 10  };
Use LabelInterval can control  regular pattern of label.

If I only want to show the last label? (attachment1)
if I wnat to show the  Irregular label? (attachment2)
Petar Marchev
Telerik team
 answered on 20 Nov 2013
8 answers
381 views
Hello,

I implemented a type converter for RadPropertyGrid but it's not working.
As can be seen in the attached 'winform property grid', if a line is selected then the 'linetype' cell displays the types for various lines.
I implemented the type converter for this as the below code, but it seems RadPropertyGrid doesn't recognize it.
Can this be fixed? And can you inform me any other fundamental limits of RadPropertyGrid compared to Winform property grid?


        [TypeConverter(typeof(LineTypeConverterNoExpand)), GlobalizedCategory("Misc"), GlobalizedDisplayName("LineType"), GlobalizedDescription("Get/Set the vdLinetype object that the vdFigure will be drawn with."), ScriptSerialize]
        public vdLineType LineType
        {
            get
            {
                return this.mLineType;
            }
            set
            {
                if ((this.mLineType != value) && base.RaiseOnBeforeModify("LineType", value))
                {
                    if ((!this.Deleted && (value != null)) && value.Deleted)
                    {
                        value.Deleted = false;
                    }
                    base.AddHistory("LineType", value);
                    this.mLineType = value;
                    base.RaiseOnAfterModify("LineType");
                }
            }
        }

namespace VectorDraw.Professional.vdPrimaries
{
    using System;
    using System.ComponentModel;
    using System.Globalization;
    using VectorDraw.Professional.Utilities;
    using VectorDraw.Professional.vdObjects;

    public class LineTypeConverterNoExpand : TypeConverter
    {
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
            if (context == null)
            {
                return false;
            }
            return ((sourceType == typeof(string)) || base.CanConvertFrom(context, sourceType));
        }

        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            if (value is string)
            {
                try
                {
                    string name = (string) value;
                    vdDocument document = TypeConverterUtilities.getDocument(context);
                    object solid = null;
                    if (document != null)
                    {
                        solid = document.LineTypes.FindName(name);
                    }
                    if (solid == null)
                    {
                        solid = document.LineTypes.Solid;
                    }
                    return solid;
                }
                catch
                {
                    throw new NotSupportedException("Can not convert '" + ((string) value) + "' to type LineType");
                }
            }
            return base.ConvertFrom(context, culture, value);
        }

        public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            vdDocument document = TypeConverterUtilities.getDocument(context);
            if (document == null)
            {
                return new TypeConverter.StandardValuesCollection(new string[0]);
            }
            return new TypeConverter.StandardValuesCollection(document.LineTypes.GetNotDeletedItemsAndVisibleOnForms());
        }

        public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
        {
            return true;
        }
    }
}

Ivan
Top achievements
Rank 1
 answered on 20 Nov 2013
1 answer
649 views

Hi,

I have only one column in grid view and I do not want to show any grid lines and row/column headers. When I set 
GridLinesVisibility="None" ShowColumnHeaders="False" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed". I can see vertical grid line (or it may be something else) only before first column. Do we have any direct way or some workaround to hide that?


I have attached a screenshot for this.

Thanks and regards,

Shiv

Yoan
Telerik team
 answered on 20 Nov 2013
1 answer
240 views
Hello,

i have any Problems with the MaskedInput Control.

Scenario 1:

Validation Error Messages not showed by Application Start.
My Custom ControlTemplate for Validation.ErrorTemplate is showed,
but the ErrorMessage is Empty. This is a little bit funny.

You can see the Validation Methods in my TestModel Code.

Scenario 2:
My TestModel-Object has ProjectDescription Property as string with MaximumLength 80 and MinimumLength of 5.
Enter 5 Characters in the MaskedInput Field, you can not deleting this Characters.
Only overwrite from first Position is allowed.

But... you can deleting the Characters, when the Count of Characters in the Field < Definition of MinimumLength is.
All other Characters at Position > MinimumLength is deletable.

MainWindow.xaml

<Window
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="Telerik_Forum.MainWindow"
        xmlns:numericinput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
        Title="MainWindow" Height="150" Width="525">
    <Window.Resources>
        <ControlTemplate x:Key="CustomErrorTemplate">
            <StackPanel Orientation="Horizontal">
                <Border Margin="-1"
                    VerticalAlignment="Center">
 
                    <AdornedElementPlaceholder x:Name="Holder" />
                </Border>
 
                <Border Margin="3 1 0 1" HorizontalAlignment="Left" VerticalAlignment="Center" >
                    <StackPanel >
 
                        <TextBlock Text="!!!" ToolTip="{Binding ElementName=Holder,  Path=AdornedElement.DisplayErrorMessage}" />
                    </StackPanel>
                </Border>
 
            </StackPanel>
 
        </ControlTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0" Grid.Row="0" Text="Project Number:"/>
        <telerik:RadMaskedNumericInput Grid.Column="1" Grid.Row="0" Width="100" Validation.ErrorTemplate="{StaticResource CustomErrorTemplate}" HorizontalAlignment="Left" VerticalAlignment="Top" Value="{Binding ProjectNumber, ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsClearButtonVisible="False" Mask="#4" AutoFillNumberGroupSeparators="False" Placeholder=" "/>
        <TextBlock Grid.Column="0" Grid.Row="1" Text="Cost Summary:"/>
        <telerik:RadMaskedNumericInput Grid.Column="1" Grid.Row="1" Width="100" Validation.ErrorTemplate="{StaticResource CustomErrorTemplate}" HorizontalAlignment="Left" VerticalAlignment="Top" Value="{Binding CostSummary, ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsClearButtonVisible="False" Mask="#9.2" AutoFillNumberGroupSeparators="False" Placeholder=" "/>
        <TextBlock Grid.Column="0" Grid.Row="2" Text="Project Description:"/>
        <telerik:RadMaskedTextInput Grid.Column="1" Grid.Row="2" Width="300" AllowInvalidValues="True" UpdateValueEvent="PropertyChanged" Validation.ErrorTemplate="{StaticResource CustomErrorTemplate}" HorizontalAlignment="Left" VerticalAlignment="Top" Value="{Binding ProjectDescription, ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Mask="" IsClearButtonVisible="False" numericinput:MaskedInputExtensions.MinTextLength="5" numericinput:MaskedInputExtensions.MaxTextLength="80" Placeholder=" "/>
    </Grid>
</Window>

MainWindow.cs

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
 
        TestModel m_Model = new TestModel(0, 0, "Test");
 
        this.DataContext = m_Model;
 
    }
}

TestModel.cs

public class TestModel : IDataErrorInfo
{
    public TestModel()
    { }
 
    public TestModel(int project_number, double cost_summary, string project_description)
    {
        this.ProjectNumber = project_number;
        this.CostSummary = cost_summary;
        this.ProjectDescription = project_description;
    }
 
    public int ProjectNumber { get; set; }
    public double CostSummary { get; set; }
 
    [StringLength(10,  MinimumLength = 5)]
    public string ProjectDescription { get; set; }
 
    public string Error
    {
        get { return this[string.Empty]; }
    }
 
    public string this[string propertyName]
    {
        get
        {
            string validationResult = null;
            switch (propertyName)
            {
                case "ProjectNumber":
                    validationResult = Validate_ProjectNumber();
                    break;
 
                case "CostSummary":
                    validationResult = Validate_CostSummary();
                    break;
 
                case "ProjectDescription":
                    validationResult = Validate_ProjectDescription();
                    break;
 
                default:
                    throw new ApplicationException("Unknown Property being validated on Product.");
            }
 
            return validationResult;
        }
    }
 
    private string Validate_ProjectNumber()
    {
        string Result = "";
 
        if (ProjectNumber == 0)
        {
            Result = "Please Enter a Project Number.";
        }
 
        if (ProjectNumber < 1 || ProjectNumber > 9999)
        {
            Result = "Only ProjectNumber Between 1 and 9999";
        }
 
        return Result;
    }
 
    private string Validate_CostSummary()
    {
        string Result = "";
 
        if (CostSummary == 0)
        {
            Result = "Please Enter Cost Summary Value.";
        }
        else if (CostSummary < 0.0)
        {
            Result = "Cost Summary allows only positive Values.";
        }
 
        return Result;
    }
 
    private string Validate_ProjectDescription()
    {
        string Result = "";
 
        if (ProjectDescription.Length == 0)
        {
            Result = "Please Enter a Project Description";
        }
        else if (ProjectDescription.Length < 5)
        {
            Result = "You must enter a Project Description with 5 Characters.";
        }
 
        return Result;
    }
}
Petar Mladenov
Telerik team
 answered on 20 Nov 2013
10 answers
414 views
We need our RadGridView to simply show text (e.g., True/False) instead of a checkbox for boolean values. The grid is read-only, we're binding it to a DataView, and we need to continue to let it auto-generate the columns at runtime.

I assume we just need to prevent the grid from using a GridViewCheckBoxColumn for boolean-typed columns when it auto-generates its columns. What's the best way to do that, with performance being really important? I've tried overriding templates and styles to no avail. Right now I have it working by using a style that overrides the CheckBox's control template and puts a TextBlock there, using a boolean-to-string converter we wrote, but that's not ideal. I really hope I missed something simple!

BTW, the main reason we want to NOT show checkboxes is performance -- we've found that a lot of checkboxes really slow down rendering of the grid. If that problem has been solved, we might leave the checkboxes in there, though I'd still like the option to just show text instead.

Thanks.
Dimitrina
Telerik team
 answered on 19 Nov 2013
2 answers
189 views
Hi,

I'm trying to draw a CustomLine on a add, I want it styled so it appears dashed.

I am creating the line in code here....
CustomLine line = new CustomLine();
line.Style = (Style)Application.Current.FindResource("DashedCustomLine");
line.Stroke = Brushes.Black;
line.StrokeThickness = 1;
line.YIntercept = 0;
line.Slope = 1;

The style is then....
<Style x:Key="DashedCustomLine" TargetType="telerikCharting:CustomLine">
    <Setter Property="StrokeDashArray" Value="5,2" />
</Style>

However it seems there isn't a StrokeDashArray property on CustomLine, what property should I be using, or how should I be achieving this.

I only wish to draw a simple line of identity on the chart, ie. x = y.

Thanks
Evgenia
Telerik team
 answered on 19 Nov 2013
7 answers
182 views
Hi everyone,

I am developing a WPF application in which I use RadControls including RadDocking.

Here is my Docking's layout :

<?xml version="1.0" encoding="utf-8"?>
    <RadDocking>
      <DocumentHost>
        <RadSplitContainer SerializationTag="m_splitContainer2" Orientation="Vertical">
          <Items>
            <RadPaneGroup SerializationTag="m_paneGroup2" SelectedIndex="-1">
              <Items />
            </RadPaneGroup>
            <RadPaneGroup SerializationTag="m_paneGroup3" SelectedIndex="-1">
              <Items />
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
      </DocumentHost>
      <SplitContainers>
        <RadSplitContainer SerializationTag="m_splitContainer1" Dock="DockedLeft" Width="240">
          <Items>
            <RadPaneGroup SerializationTag="m_paneGroup1" SelectedIndex="-1">
              <Items />
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
      </SplitContainers>
    </RadDocking>

A method is executed at run time to perform the following actions :
- Create a Pane and place content inside
- Set the Pane's floating size
- Dock the Pane into m_paneGroup1

After the execution of the method I have manually undocked the Pane to make it floating.
But the Pane's size was not the floating size set in the method.

Have I misunderstood the behavior of the floating size of a Pane ?

Thank in advance for your answer.
Vladi
Telerik team
 answered on 19 Nov 2013
3 answers
244 views
I have a RadDataForm bound to a single DataRowView of a DataTable.  If I allow the form to auto-generate the editor fields, the "Cancel" function works as advertised.  That is, I can edit any number of the fields, press Cancel, and their original values are returned prior the the form shifting back to ReadOnly mode.

However, if I supply a custom template for the same DataRowView, when I edit some data and press Cancel, the original values are not put back into the editor fields.  The form is placed back in ReadOnly mode (as expected), but the modified values are still there.

How can I get a custom template to play nicely with the Cancel function?  I see no mention of this anomaly in the docs or on the forums.

Jeff
Dimitrina
Telerik team
 answered on 19 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?