Telerik Forums
UI for WPF Forum
1 answer
84 views

My project need insert chart to spreadsheet,and print all content.

I know devexpress control can add chart to spreadsheet.

when the spreadsheet can support the chart

Dinko | Tech Support Engineer
Telerik team
 answered on 23 Feb 2017
2 answers
143 views

Hi to all,

I have a simple grid, that I'm using with MVVM pattern.

<Style x:Key="ListEditableFlatStyle" TargetType="telerik:RadGridView" BasedOn="{StaticResource RadGridViewStyle}">
    <Setter Property="CanUserDeleteRows" Value="True"/>
    <Setter Property="CanUserFreezeColumns" Value="True"/>
    <Setter Property="CanUserInsertRows" Value="True"/>
    <Setter Property="CanUserReorderColumns" Value="False"/>
    <Setter Property="CanUserResizeColumns" Value="True"/>
    <Setter Property="CanUserResizeRows" Value="False"/>
    <Setter Property="CanUserSelect" Value="True"/>
    <Setter Property="CanUserSortColumns" Value="False"/>
    <Setter Property="CanUserSortGroups" Value="False"/>
    <Setter Property="ShowGroupPanel" Value="False"/>
    <Setter Property="ShowSearchPanel" Value="False"/>
    <Setter Property="AutoGenerateColumns" Value="False"/>
    <Setter Property="IsReadOnly" Value="False"/>
    <Setter Property="SelectionMode" Value="Extended"/>
    <Setter Property="SelectionUnit" Value="FullRow"/>
    <Setter Property="IsLocalizationLanguageRespected" Value="False"/>
    <Setter Property="Margin" Value="2"/>
    <Setter Property="NewRowPosition" Value="Bottom"/>
    <Setter Property="GroupRenderMode" Value="Flat"/>
</Style>
 
<telerik:RadGridView ItemsSource="{Binding MisureModelli}" Style="{StaticResource ListEditableFlatStyle}"
                     GroupRenderMode="Flat"
                     Grid.Row="6" Grid.ColumnSpan="4">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding PesoLordo, StringFormat=\{0:N2\}}" Header="Peso Lordo (Kg)" HeaderTextAlignment="Right"
                        TextAlignment="Right"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding PesoNetto, StringFormat=\{0:N2\}}" Header="Peso Netto (Kg)" HeaderTextAlignment="Right"
                        TextAlignment="Right"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Volume, StringFormat=\{0:N3\}}" Header="Volume (m³)" HeaderTextAlignment="Right"
                        TextAlignment="Right" IsReadOnly="True"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

 

When I click "new row", it disappears exists row, I don't undestrand why.

Dario Concilio
Top achievements
Rank 2
 answered on 23 Feb 2017
1 answer
456 views

Dear Forum Members ,

 

I have a requirement to copy paste the Excel content to Radgrid view , Here few of the columns of the grid are Read only , i tried out the Below options , Any suggestions appreciated .

In Rad gridview is set the below properties

ClipboardCopyMode="Cells" ClipboardPasteMode="AllSelectedCells,Cells" SelectionMode="Extended" SelectionUnit="Cell"

 

and in the behaviour have the PastingCellClipboardContent event to check on the data and map it accordingly , issue here is that for read-only columns this is not fired , please do suggest

 

regards
Anand

 

Stefan Nenchev
Telerik team
 answered on 23 Feb 2017
1 answer
101 views

Hi, I inputted a table onto my document with 1 row and 2 columns.

I then inputted a Custom Merge Field in column 2. My Custom Merge field inputs a table. Code is below

protected override DocumentFragment GetResultFragment()
{
    UniversalDTO universalDTO = this.Document.MailMergeDataSource.CurrentItem as UniversalDTO;
    if (universalDTO == null)
    {
        return null;
    }
 
    if (this.PropertyPath == "Collaterals")
    {
        Table table = new Table();
 
 
        foreach (var coillateral in universalDTO.Collaterals)
        {
            Span span = new Span(coillateral.Type.Value);
            span.FontSize = 11.5;
            Paragraph paragraph = new Paragraph();
            paragraph.Inlines.Add(span);
 
            Span span2 = new Span(coillateral.Description);
            span2.FontSize = 11.5;
            Paragraph paragraph2 = new Paragraph();
            paragraph2.Inlines.Add(span2);
 
            TableCell cell = new TableCell();
            cell.Blocks.Add(paragraph);
            cell.Borders = new TableCellBorders(new Border(1, BorderStyle.Single, Colors.Transparent));
 
            TableCell cell2 = new TableCell();
            cell2.Blocks.Add(paragraph2);
            cell2.Borders = new TableCellBorders(new Border(1, BorderStyle.Single, Colors.Transparent));
 
            TableRow row = new TableRow();
            row.Cells.Add(cell);
            row.Cells.Add(cell2);
            table.AddRow(row);
        }
 
        Section section = new Section();
        section.Blocks.Add(table);
 
        RadDocument document = new RadDocument();
        document.Sections.Add(section);
 
        document.MeasureAndArrangeInDefaultSize();
        return new DocumentFragment(document);
    }
 
    return null;
}

 

The issue I'm having is depicted by the image below, there's a space ontop of the nested table. If tried to delete in the document, it deletes the table. That empty line can be deleted in word though.

http://imgur.com/cf22ee44-9cdd-4840-b045-a9500c8d0569

 

Code View 

 

http://imgur.com/LQirves

band
Top achievements
Rank 1
 answered on 22 Feb 2017
4 answers
883 views

I have a few columns in my RadGridView, which I would like to filter - but not to allow Search as You Type.

Is there  any way to do this?

 

In addition: I have boolean values, which I show as "Yes" and "No" in the grid - but in the filters, they are shown as "True" and "False". It there any way to change this to let the filter sow "Yes" and "No", too?

Best regards

Inger Marie

Inger Marie
Top achievements
Rank 1
 answered on 22 Feb 2017
9 answers
934 views

Hi,
I have a specific behavior I want to achieve with respect to the AutoCompleteBox.

Requirements:

  1. When the box is empty the pop-up must suggest all options, much like a combo-box does
  2. When the box gets focus, the pop-up must open and show the corresponding suggestions
  3. Selection must be achieved through hitting enter key or clicking an item on the pop-up

Tried solution:

  • Implement a FilteringBehavior to return all items when search text is empty

public class MyFilteringBehavior : FilteringBehavior
{
    public override IEnumerable<object> FindMatchingItems(string searchText, IList items, IEnumerable<object> escapedItems, string textSearchPath,
        TextSearchMode textSearchMode)
    {
        if (string.IsNullOrEmpty(searchText))
            return items.Cast<object>();
        return base.FindMatchingItems(searchText, items, escapedItems, textSearchPath, textSearchMode);
    }
}

  •  Upon receiving a GotFocus event perform a Populate on the auto-complete box

private void Classes_GotFocus(object sender, RoutedEventArgs e)
{
    var box = (RadAutoCompleteBox) sender;
    box.Populate(box.SearchText);
    //box.IsDropDownOpen = true; // Not necessary
}

  • Setting up the RadAutoCompleteBox on Xaml

<telerik:RadAutoCompleteBox Grid.Row="4" Grid.Column="2"
         Name="Classes"
         ItemsSource="{Binding Classes}"
         AutoCompleteMode="SuggestAppend"
         SelectionMode="Multiple"
         TextSearchMode="Contains"
         IsHighlighted="True"
         FilteringBehavior="{StaticResource MyFilteringBehavior}"
         GotFocus="Classes_GotFocus"/>

Expected behavior:

  • Requirements 1 and 2 are achieved successfully
  • With a highlighted item in the popup, hitting enter commits the selection into the box and closes the popup

Unexpected/unwanted effects:

  • While cycling focus through a series of text boxes and auto complete boxes the first option gets selected when the tab key is hit
  • Users cannot select any item while mouse-left-clicking on items in the pop-up

Is there any way to avoid the unwanted behavior while on this setup?

Nasko
Telerik team
 answered on 22 Feb 2017
3 answers
275 views

Hello,

I'd like to use a DesktopAlert in a WPF MVVM app.

I copy the code from the Telerik WPF app - DesktopAlert Examples - First Look app (email example).

Code:

public class AlertViewModel : BaseViewModel
{
private RadDesktopAlertManager desktopAlertManager;

public AlertViewModel()
{
this.desktopAlertManager = new RadDesktopAlertManager(AlertScreenPosition.BottomRight, 5d);
}

public Action ActivateMainWindowAction { get; set; }
private void OnAlertCommandExecuted(object param)
{            
if (this.ActivateMainWindowAction != null)
{
this.ActivateMainWindowAction.Invoke();
}            
}

public void TestAlert()
{
BitmapImage b = new BitmapImage();
b.BeginInit();
b.UriSource = new Uri("C:\\...\\error.png");
b.EndInit();

this.desktopAlertManager.ShowAlert(new DesktopAlertParameters
{
Header = "Header",
Content = "Content",
Icon = new Image { Source = b, Width = 48, Height = 48 },
IconColumnWidth = 48,
IconMargin = new Thickness(10, 0, 20, 0),
Command = new DelegateCommand(this.OnAlertCommandExecuted),
CommandParameter = "ABC"
});
}
}

public partial class Alert : UserControl
{
public Alert()
{
InitializeComponent();
AlertViewModel vm = ServiceLocator.Current.GetInstance<AlertViewModel>();
vm.ActivateMainWindowAction = new Action(this.ActivateMainWindow);
DataContext = vm;
}

private void ActivateMainWindow()
{
var mainWindow = Application.Current.MainWindow;

if (mainWindow != null)
{
if (mainWindow.WindowState == WindowState.Minimized)
{
mainWindow.WindowState = WindowState.Normal;
}

if (!mainWindow.IsActive)
{
mainWindow.Activate();
}
}
}
}

 

The DesktopAlertParameters command never execute and the alert never show.

Is there something i miss? If i try desktop alert on a new classic WPF app (no mvvm) works withuot problems.

 

Thanks.

 

Nasko
Telerik team
 answered on 22 Feb 2017
4 answers
159 views
Hi,

Is the number of slices in a radial menu configurable?

Sebastien
Dhaval
Top achievements
Rank 1
 answered on 22 Feb 2017
1 answer
141 views

Hi,

Any update on removing the white space from the menu if we are using less then 8 items?
Because it is looking very bad on the UI section.

Our clients want to remove the white space. So any option to do it?

Waiting for your quick reply.

Kalin
Telerik team
 answered on 22 Feb 2017
3 answers
340 views
I've put a RadMaskedNumericInput control onto window. To that I wanted to add validation. Here's the custom class I came up with:

public class ByteValidation : ValidationRule
{
    private byte min = 0;
    private byte max = byte.MaxValue;
 
    //The Minimum and Maximum values are there to restrict how low and how high the
    //stored value can be.
    public byte Minimum
    {
        get { return min; }
        set { min = value; }
    }
 
    public byte Maximum
    {
        get { return max; }
        set { max = value; }
    }
 
    public string ErrorMessage
    { get; set; }
 
    public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
    {
        if (value == null)
        {
            return new ValidationResult(true, null);
        }
 
        byte tmp;
 
        try
        {
            double dTmp = (double)value;
            tmp = (byte)dTmp;
        }
        catch (Exception)
        {
            return new ValidationResult(false, "Invalid value");
        }
 
        if (tmp < min || tmp > max)
        {
            return new ValidationResult(false, ErrorMessage);
        }
 
        return new ValidationResult(true, null);
    }
}

and here's the XAML:

<telerik:RadMaskedNumericInput Mask="##" Margin="550,0,0,0" Grid.Row="1" FontSize="16" VerticalAlignment="Bottom" FontFamily="Century Gothic">
    <telerik:RadMaskedNumericInput.Value>
        <Binding Path="DaysPaidLast30">
            <Binding.ValidationRules>
                <local:ByteValidation Minimum="0" Maximum="30" ErrorMessage="Value must be between 0 and 30." />
            </Binding.ValidationRules>
        </Binding>
    </telerik:RadMaskedNumericInput.Value>
</telerik:RadMaskedNumericInput>

This all works fine.

In testing I discovered that if I put in some invalid numeric data, then I'll get a gold border and a popup message. Is that color standard with the RadMaskedNumericInput? Can that be styled?

xxx
Evgenia
Telerik team
 answered on 21 Feb 2017
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?