Telerik Forums
UI for WPF Forum
1 answer
103 views

Hi,

We are exporting the documents created in RadRichTextBox to PDF files. Then we add a Barcode on the upper right of pages as a new layer. We need to check if the Barcode borders intersects with any document element (text, table, image, etc.) in the document. 

First Approach: We ​try to set the caret position to first line, then set to line ending, get the location and check if it intersects with Barcode border.

Problem with this approach: When we get the location of caret position, it returns position offset to the RadRichTextBox control. But we need the offset coordinates ​to the page borders.

Code:

01.for (int i = 2; i <= pageCount; i++)
02.{
03.    RadEditor.Document.CaretPosition.MoveToPage(i);
04.    RadEditor.Document.CaretPosition.MoveToCurrentLineEnd();
05.    if ((RadEditor.Document.CaretPosition.Location.X) > 700 && (RadEditor.Document.CaretPosition.Location.Y) < 100)
06.    {
07.        // barcode border intersects with the text in the document
08.    }
09.}

Second Approach: We can use GetLayoutBoxByPosition method to check if there is an element at the coordinates we will add Barcode border.

Problem with this approach: We should give the position offset ​to the RadRichTextBox but we need to give the position offset to the page borders.

I've attached ​3 images to describe the problem more clearly.

Regards.

Todor
Telerik team
 answered on 26 Oct 2015
3 answers
116 views

Hello,

I've edited the RadTreeListView row template to add additional visuals that I need, but after the modifications an horizontal scrollbar appears and what seems to be an empty column header is added (image attached)

I've seen that the problem lies in the extra visuals I added to the row template, because when I remove the 2 colored borders the empty column header disappears.

Here you can find a sample project that reproduces the issue: 

How can I prevent this issue and make the empty column header disapper ?

Thank you for your support.

 

Maya
Telerik team
 answered on 26 Oct 2015
1 answer
126 views

Hi,

We have a RadGridView binded on DataTable.DefaultView object as ItemsSource.

Our DataTable is define as follow:

A DataRow object is overrided by our own Record object that contains Collection of Property object as ItemArray 

public class Record : DataRow, IEquatable<Record>, ICloneable
    {
        public Record(DataRowBuilder builder)
            : base(builder)
        {
        }
 
        public new Property this[string columnName]
        {
            get
            {
                return (Property)base[columnName];
            }
            set
            {
                SetRowVisibility(value);
                base[columnName] = value;
            }
        }
}

 All Property objects are updated in realtime by a ​thread that changes Property Value

We don't have any problem to see all data updated. 

 

But when we apply a filter on a column, the filter is not reapply automatically  when data value changed.

 

One solution was to remove completely the Row and add it with new values..It 's running for filter, but we have identify several problems with sorting, because Rows are delet​ed/added during sorting thread, that generate an IndexOutOfBoundsException

 

What's the solution ? 

 

regards, 

 

 

 

 

 

 

Martin
Telerik team
 answered on 23 Oct 2015
4 answers
479 views

I have created an Excel spreadsheet using Microsoft Excel 2013. The spreadsheet I created is empty but it has some formatting, e.g. I selected all cells and set text alignment to right. I also selected some of columns and set their type to Number, short date, or general. Is it possible to get these formattings and types from an empty spreadsheet? I already tried this, but it seems that RadHorizontalAlignment is always General, not Right as I would like it to be.

Anna
Telerik team
 answered on 23 Oct 2015
1 answer
110 views

Hi,

I use global custom template for Window control in application. So all dialogs have Ok, Cansel buttons and Close button. The problem is that the same style is applied to drag&drop window that appears when I'm reordering columns in RadGridView. So it looks like it also uses that Window template.

Is there a way how could I change style for drag and drop header in RadGridView without modifying my global template?

Nasko
Telerik team
 answered on 23 Oct 2015
1 answer
198 views

I have a RadTreeView that I am binding to some data.

I would like to have all the items in the tree expanded by default.

The issue I have when I do this is that the tree is autoscrolling to the right to bring into focus the most right hand expanded item.

To try and get round this I have disabled the horizontal scroll bar, call ExpandAll(), then after that reenable the horizontal scroll bar.

This is not working.

private void FrameworkElement_OnLoaded(object sender, RoutedEventArgs e)
        {
            RadTreeView rtv = sender as RadTreeView;
 
            if (rtv.ScrollViewer != null)
            {
 
                rtv.ScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
 
                rtv.ExpandAll();
 
                rtv.ScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            }
        }

Please can you advise on the correct way to achieve this?

 Thanks.

Petar Mladenov
Telerik team
 answered on 23 Oct 2015
1 answer
711 views

Hello,

 I am using RadCartesianChart  LineSeries and I can not set line color.

my XAML

        <chart:RadCartesianChart x:Name="radChart"
                                 Grid.Row="3" 
                                 Grid.Column="0" 
                                 Palette="Windows8" 
                                 Margin="6,-5,0,0"                                  
                                 Height="240">
            <chart:RadCartesianChart.Resources>
                <DataTemplate x:Key="PointTemplate1">
                    <Ellipse Height="10" Width="10" Fill="#FF1B9DDE" />
                </DataTemplate>
            </chart:RadCartesianChart.Resources>
            <chart:RadCartesianChart.HorizontalAxis>
                <chartView:CategoricalAxis FontSize="14"/>
            </chart:RadCartesianChart.HorizontalAxis>
            <chart:RadCartesianChart.VerticalAxis>
                <chartView:LinearAxis FontFamily="Segoe UI" FontSize="14" Title="Calories"   TickThickness="1" Minimum="0"    Maximum="{Binding LinearAxisMaxValue}"           />               
            </chart:RadCartesianChart.VerticalAxis>
            <chart:RadCartesianChart.Grid>
                <chartView:CartesianChartGrid MajorLinesVisibility="XY" StripLinesVisibility="none"  />
            </chart:RadCartesianChart.Grid>
            <ctChart:ChartSeriesTypeSwitch.SeriesType >
                <Binding Path="SelectedChartType" />
            </ctChart:ChartSeriesTypeSwitch.SeriesType>

        </chart:RadCartesianChart>​

 

please help me

Martin Ivanov
Telerik team
 answered on 23 Oct 2015
1 answer
135 views

When copying multiple cells from an excel sheet to the GridView, empty cells are skipped and following non-empty cells are moved forward. See attached screenshots for an illustration.

This behavior is undesirable for obvious reasons. Is this a bug or a feature. If it's a feature, is there a workaround?

Maya
Telerik team
 answered on 22 Oct 2015
2 answers
154 views

We are implementing a drag&drop scenario, where the drop target can be another control from our application or the drop target can be the desktop or another folder from the file system. How can I set the dragged data inside the DragInitializeHandler to handle both scenarios simultaneously?

If the dragged data is a DataObject where the data is set via SetFileDropList I can drag the data to the desktop but not to another control. If I create a IPayload and sets the data via SetData("DragData", ...) and SetData("FileDrop", ...) I can drag the data to the other control but not to the desktop?

How can I create a payload, which is working for both scenarios? 

Felix

Felix
Top achievements
Rank 1
 answered on 22 Oct 2015
4 answers
225 views

We are currently using a GridViewComboBoxColumn control in a GridView, and like a few others, we would like the combobox editor (arrow) to always be visible. Most answers have involved using the said 'GridViewComboBoxColumn' or a 'GridViewDataColumn' in conjunction with a DataTemplate to target the ComboBox. 

 I have both approaches, both with the same result. I get a column of combo boxes, but no data.

This is our current markup:

 

<telerik:GridViewComboBoxColumn x:Name="ColP4" Width="150" IsReadOnly="False" IsComboBoxEditable="False" EditTriggers="CellClick" ItemsSource="{Binding PermissionCollection}" DataMemberBinding="{Binding Col4}" UniqueName="Permission" Header="{Binding Source={StaticResource TranslationAreas}, Path=[exportproject][TXT_COLUMN_5]}" DisplayMemberPath="Name" SelectedValueMemberPath="ID"/>

ItemsSource is an ObservableCollection of type 'Permission'. Permission has two properties, int: ID and str: Name.  

 This looks like what we want, only with no data:

 

<telerik:GridViewDataColumn x:Name="ColP4"
      DataMemberBinding="{Binding Col4}"
      Header="{Binding Source={StaticResource TranslationAreas}, Path=[exportproject]
          [TXT_COLUMN_5]}" >
      <telerik:GridViewColumn.CellTemplate>
          <DataTemplate>
              <ComboBox DisplayMemberPath="Name"
                        ItemsSource="{Binding PermissionCollection}"
                        SelectedValue="ID"
                        SelectedValuePath="ID"/>
           </DataTemplate>
       </telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>

 

 I'm sure the problem lies with the databinding. Any help is very much appreciated.

Stefan
Telerik team
 answered on 22 Oct 2015
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?