Telerik Forums
UI for WPF Forum
3 answers
128 views

Hi , I use mindmap example code, but why the connector doesn't align with element's bottom edge?

Please see the attachment pictures, thanks!

Jonathan
Top achievements
Rank 1
 answered on 19 Aug 2016
4 answers
274 views
Hello,

While comparing TreeView and TreeListView controls, I've found that the out-of-the-box visuals for DragDrop is much more complete for the TreeView than it is for the TreeListView. I've attached two images, the first showing the TreeView's preview, and the second is showing the TreeListView.

I could not find any examples of the TreeListView that would give a preview like "Drop before x..", can this be achieved for the TreeListView? 

Thanks, 
Ryan
Stefan
Telerik team
 answered on 18 Aug 2016
4 answers
713 views

Hello,

I'm now developing a table to edit a List. I have only one problem, i wan't to cancel edit when user change row without saving with a button on the left of the row.

I use RadGridView and i have try this: ActionOnLostFocus="CancelEdit" but it don't work...

<telerik:RadGridView x:Name="MyGrid" MaxHeight="500"
     CellEditEnded="GridConfig_OnCellEditEnded"
     BeginningEdit="EditGrid_BeginningEdit"
    RowLoaded="EditGrid_RowLoaded"
    CanUserFreezeColumns="True"
    EnableColumnVirtualization="False"                                    
    AutoGenerateColumns="False"
     RowEditEnded="GridConfig_OnRowEditEnded"
    ItemsSource= "{Binding ConfigurationList, Mode=OneWay,
     UpdateSourceTrigger=PropertyChanged}">

Stefan Nenchev
Telerik team
 answered on 18 Aug 2016
2 answers
368 views

Is it possible to implement readonly functionality for the RadSpreadsheet control? The protect/unprotect approach seems very slow, taking around 3/4 seconds to protect a Workbook with 2 Worksheets.

I tried to use the ReadOnlyUILayersBuilder approach from this old ticket http://www.telerik.com/forums/protect-cell-or-sheet-in-spreadsheet, but it's still possible to select a cell and drag the value unto other cells.

Fabrice
Top achievements
Rank 1
 answered on 18 Aug 2016
3 answers
448 views

Hi Telerik,

     I have using GridView with some text columns and button column as last one.

     Text's columns are resizable with minimum size declared. Button's column is non-resizable and must stay right-side pinned.

     Additionally, I need prevent horizontal scroll bar appearing.

     So strange behavior is when resize splitter between last text's and button's columns in left direction - text's column narrowing to it's minimum width and after that previous left column do the same.

      Please, suggest how to prevent that? 

 

With regards, Anatoliy

    

Dilyan Traykov
Telerik team
 answered on 18 Aug 2016
8 answers
874 views
Hi,

I am having some issues printing a grid view. The code I use to print is modified from the downloadable example. The issue is that the page orientation is always portrait, and the grid appears rotated 90 degrees on the page no top margin (see attached image, I printed to pdf). Instead, I would like the page in landscape mode, with proper margins. It also appears that if the grid view is wider than the page, new pages are not added, instead the values are cut off.

So, my questions are:
1. How can I change the page orientation when printing the grid view (programmatically)?
2. How can I add margins?
3. How can I print grid views that are wider than a page on multiple pages?

Here is my code:

In my context menu:
//print
MenuItem mprintGridItem = new MenuItem();
mprintGridItem.Header = "Print Grid";
mprintGridItem.Click += TelerikGridPrint;
MainGrid.ContextMenu.Items.Add(mprintGridItem);

my click handler (note, the grid was created completely in code and in the XAML pages constructor, was added to a stack panel as a child.

private void TelerikGridPrint(object sender, object args)
{
  try
  {
    TelerikGridDocumentCreatorModel.Print(telerikResults.GridControl);
  }
  catch (Exception ex)
  {
    Logger.LogError("TelerikGridPrint: " + ex);
  }
}

And my code to print:
public static class TelerikGridDocumentCreatorModel // : DependencyObject, INotifyPropertyChanged
{
  private static Color HeaderBackground = Color.FromArgb(255, 127, 127, 127);
  private static Color RowBackground = Color.FromArgb(255, 251, 247, 255);
  private static Color GroupHeaderBackground = Color.FromArgb(255, 216, 216, 216);
 
  public static void Print(object parameter)
  {
    RadGridView grid = (RadGridView)parameter;
    RadRichTextBox rtb = new RadRichTextBox() { Height = 0 };
 
    rtb.Name = "RadRichTextBox1";
 
    Grid parent = grid.ParentOfType<Grid>();
    if (parent != null && parent.FindName(rtb.Name) == null)
    {
      parent.Children.Add(rtb);
      rtb.ApplyTemplate();
    }
 
    rtb.Dispatcher.BeginInvoke((Action)(() =>
    {
      rtb.Document = CreateDocument(grid);
    }));
 
    PrintSettings pSettings = new PrintSettings();
 
    pSettings.DocumentName = "MyDocument";
    pSettings.PrintMode = PrintMode.Native;
    pSettings.PrintScaling = PrintScaling.None;
 
    rtb.Print(pSettings);
  }
 
  private static RadDocument CreateDocument(RadGridView grid)
  {
    List<GridViewBoundColumnBase> columns = (from c in grid.Columns.OfType<GridViewBoundColumnBase>()
                                             orderby c.DisplayIndex
                                             select c).ToList();
 
    Telerik.Windows.Documents.Model.Table table = new Telerik.Windows.Documents.Model.Table();
 
    RadDocument document = new RadDocument();
    Telerik.Windows.Documents.Model.Section section = new Telerik.Windows.Documents.Model.Section();
    Telerik.Windows.Documents.Model.Paragraph paragraph1 = new Telerik.Windows.Documents.Model.Paragraph();
    Telerik.Windows.Documents.Model.Paragraph paragraph2 = new Telerik.Windows.Documents.Model.Paragraph();
    section.Blocks.Add(paragraph1);
    section.Blocks.Add(table);
    section.Blocks.Add(paragraph2);
    document.Sections.Add(section);
 
    if (grid.ShowColumnHeaders)
    {
      Telerik.Windows.Documents.Model.TableRow headerRow = new Telerik.Windows.Documents.Model.TableRow();
 
      if (grid.GroupDescriptors.Count > 0)
      {
        Telerik.Windows.Documents.Model.TableCell indentCell = new Telerik.Windows.Documents.Model.TableCell();
        indentCell.PreferredWidth = new TableWidthUnit(grid.GroupDescriptors.Count * 20);
        indentCell.Background = HeaderBackground;
        headerRow.Cells.Add(indentCell);
      }
 
      for (int i = 0; i < columns.Count; i++)
      {
        Telerik.Windows.Documents.Model.TableCell cell = new Telerik.Windows.Documents.Model.TableCell();
        cell.Background = HeaderBackground;
        AddCellValue(cell, columns[i].UniqueName);
        cell.PreferredWidth = new TableWidthUnit((float)columns[i].ActualWidth);
        headerRow.Cells.Add(cell);
      }
 
      table.Rows.Add(headerRow);
    }
 
    if (grid.Items.Groups != null)
    {
      for (int i = 0; i < grid.Items.Groups.Count; i++)
      {
        AddGroupRow(table, grid.Items.Groups[i] as QueryableCollectionViewGroup, columns, grid);
      }
    }
    else
    {
      AddDataRows(table, grid.Items, columns, grid);
    }
 
    return document;
  }
 
  private static void AddDataRows(Telerik.Windows.Documents.Model.Table table, IList items, IList<GridViewBoundColumnBase> columns, RadGridView grid)
  {
    for (int i = 0; i < items.Count; i++)
    {
      Telerik.Windows.Documents.Model.TableRow row = new Telerik.Windows.Documents.Model.TableRow();
 
      if (grid.GroupDescriptors.Count > 0)
      {
        Telerik.Windows.Documents.Model.TableCell indentCell = new Telerik.Windows.Documents.Model.TableCell();
        indentCell.PreferredWidth = new TableWidthUnit(grid.GroupDescriptors.Count * 20);
        indentCell.Background = RowBackground;
        row.Cells.Add(indentCell);
      }
 
      for (int j = 0; j < columns.Count; j++)
      {
        Telerik.Windows.Documents.Model.TableCell cell = new Telerik.Windows.Documents.Model.TableCell();
 
        object value = columns[j].GetValueForItem(items[i]);
 
        AddCellValue(cell, value != null ? value.ToString() : string.Empty);
 
        cell.PreferredWidth = new TableWidthUnit((float)columns[j].ActualWidth);
        cell.Background = RowBackground;
 
        row.Cells.Add(cell);
      }
 
      table.Rows.Add(row);
    }
  }
 
  private static void AddGroupRow(Telerik.Windows.Documents.Model.Table table, QueryableCollectionViewGroup group, IList<GridViewBoundColumnBase> columns, RadGridView grid)
  {
    Telerik.Windows.Documents.Model.TableRow row = new Telerik.Windows.Documents.Model.TableRow();
 
    int level = GetGroupLevel(group);
    if (level > 0)
    {
      Telerik.Windows.Documents.Model.TableCell cell = new Telerik.Windows.Documents.Model.TableCell();
      cell.PreferredWidth = new TableWidthUnit(level * 20);
      cell.Background = GroupHeaderBackground;
      row.Cells.Add(cell);
    }
 
    Telerik.Windows.Documents.Model.TableCell aggregatesCell = new Telerik.Windows.Documents.Model.TableCell();
    aggregatesCell.Background = GroupHeaderBackground;
    aggregatesCell.ColumnSpan = columns.Count + (grid.GroupDescriptors.Count > 0 ? 1 : 0) - (level > 0 ? 1 : 0);
 
    AddCellValue(aggregatesCell, group.Key != null ? group.Key.ToString() : string.Empty);
 
    foreach (AggregateResult result in group.AggregateResults)
    {
      AddCellValue(aggregatesCell, result.FormattedValue != null ? result.FormattedValue.ToString() : string.Empty);
    }
 
    row.Cells.Add(aggregatesCell);
 
    table.Rows.Add(row);
 
    if (group.HasSubgroups)
    {
      foreach (var g in group.Subgroups)
      {
        AddGroupRow(table, g as QueryableCollectionViewGroup, columns, grid);
      }
    }
    else
    {
      AddDataRows(table, group.Items, columns, grid);
    }
  }
 
  private static void AddCellValue(Telerik.Windows.Documents.Model.TableCell cell, string value)
  {
    Telerik.Windows.Documents.Model.Paragraph paragraph = new Telerik.Windows.Documents.Model.Paragraph();
    cell.Blocks.Add(paragraph);
 
    Telerik.Windows.Documents.Model.Span span = new Telerik.Windows.Documents.Model.Span();
    span.Text = value;
 
    paragraph.Inlines.Add(span);
  }
 
  private static int GetGroupLevel(IGroup group)
  {
    int level = 0;
 
    IGroup parent = group.ParentGroup;
 
    while (parent != null)
    {
      level++;
      parent = parent.ParentGroup;
    }
 
    return level;
  }

Tanya
Telerik team
 answered on 18 Aug 2016
8 answers
523 views

When I click a date on the calendar screen and then return to the calendar the date I just visited shows up on the calendar as having a orange box around it.  How do I turn this off?  I assume it is either the highlighted date or selected date property (http://docs.telerik.com/devtools/wpf/controls/radcalendar/structure) as both of those have the organge box i don't want to appear.

Thank you for your help,
Andrew

Masha
Telerik team
 answered on 18 Aug 2016
1 answer
515 views

Hey everyone,

I have the following problem and I hope I just oversee a simple step. (First of all: Sorry, there are lots of german words in it, but it should be understandable what the problem is.)

In picture1 (see attached files) is shown how my RadGridView looks like. Behind the RadGridView my View (using MVVM) is build like that:

<telerik:RadGridView Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center" ShowGroupPanel="False" ItemsSource="{Binding Path=RowPLIGFKU.Rabattstaffel, ValidatesOnDataErrors=True}" AutoGenerateColumns="False">
         <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="{Loc Key=PREISLISTE_LIST_RABATTSTAFFEL_ABMENGE}" DataMemberBinding="{Binding Path=[PGSTA]}"  MinWidth="80"/>
                <telerik:GridViewMaskedInputColumn Header="{Loc Key=PREISLISTE_LIST_RABATTSTAFFEL_RABATT}" DataMemberBinding="{Binding Path=[PGRAB]}"  MinWidth="80" DataFormatString="{}{0:n2} %"/>
                <telerik:GridViewMaskedInputColumn Header="{Loc Key=PREISLISTE_LIST_RABATTSTAFFEL_WERT}" DataMemberBinding="{Binding Path=[PGPRS]}" MinWidth="80" DataFormatString="{Binding RabattstaffelCurrency}" /> 
         </telerik:RadGridView.Columns>
</telerik:RadGridView>

In the second column I use the numeric DataFormatString, cause of some reason, when I use the actual percent DataFormatString ("{}{0:P}") I get 500% as result by input 5. - But why?!?! In my opinion that makes no sense. Really: Who needs this that way? 

However, my problem is in the third column, where I bind my DataFormatString to the proberty 'RabattstaffelCurrency'.

This is how I set the proberty in the ViewModel:

RabattstaffelCurrency = string.Format("{0} {1}", "{}{0:n2}", Session.Company.Value<Waehrung>(CompanyInfos.DefaultCurrency));

The result is shown in picture2. It is "{}{0:n2} EUR". And by seeing this picture it gets clear why I can't just write: {0:c2}. I need the abbreviation of the actual currency, not the symbol and that changes at the runtime by user interacitons

 

If I write it hardcoded like this "{}{0:n2} EUR" it works. I don't get a binding error or some other details, its just shows the data. And last but not least I need to say that this is a project at my work, so I have not the opportunity to implement some workarounds. 

Dilyan Traykov
Telerik team
 answered on 17 Aug 2016
8 answers
244 views

Hello,

 

I've got a RadCarteasianChart, and series are illustrates by PointSeries. I want to know if is it possible to insert a picture (without background) in each point.

 

I think it's possible with Template but I don't find it and I don't know how I can do that.

 

Thank you.

Valentin
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 17 Aug 2016
7 answers
245 views

Hi,

I work with cartesian charts using a large number of series with a large number of points.
In example, 25 series with 150.000 points each.
All work pretty good but not if Zoom and/or Trackball is enabled.
I understand that this require a lot of processor use.

The two theoretical problems that occurs is:

1) For TrackBall: Find, for each Series, the points closer to one x value.
2) For Zoom: Find, for each series, points between x-min and x-max.

Now, I work with ordered datasets, so I can provide myself the methods that solve 1 and 2 efficently.

So my question.

I can override some methods in CartesiaChart, ChartPanAndZoomBehavior, ChartTrackBallBehavior, Other Classes, that can allow me to use this features also in giant charts? Or I can provide a "DataSourceManager" that solve efficently this problemns?

Thanks,
marcello

Martin Ivanov
Telerik team
 answered on 17 Aug 2016
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?