Telerik Forums
UI for WPF Forum
1 answer
184 views
Hi,
I need to retrieve data in datagrid from database with all colors and images.

Can you please help me on this...

Thanks,
vij
Dimitrina
Telerik team
 answered on 27 Mar 2014
3 answers
135 views
I have a chart that loads with both PanAndZoom enabled. I am experimenting with zoom and in my constructor I am setting zoom as follows:

myRadCartesianChart.Zoom = new Size(10, 1);

When I do this, the pan and zoom bar is always on the far left side by default. Is there a way I can set the initial PanAndZoom so that it is set from the right? So if my X-axis is a continuous datetime, I want the panandzoom bar to initialize from the latest datetime to some earlier period of time.

See attached images. Currently it loads as zoombarload. I want zoombardesired.png. 

Also, in the event where there are a lot of dates along the the X-axis, there X-axis gets crowded. Is there a setting so that the interval of dates displayed are appropriately chosen and spaced to avoid crowding?

Thanks.
Petar Marchev
Telerik team
 answered on 27 Mar 2014
1 answer
93 views
Hi,
Please find the framework attached..
Can u help me build this UI.
The data grid must display all the colors for data at run time from database table.
Yana
Telerik team
 answered on 27 Mar 2014
3 answers
182 views
Our application contains HTML data that does not display properly in the RadRichTextBox when importing with the HtmlFormatProvider.

For example, our HTML looks like the following using Internet Explorer:

1. Item one
   1. Item one sub one
   2. Item one sub two
2. Item two
   1. Item two sub one
   2. Item two sub two

In the RadRichTextBox is looks like the following:

0. Item one
   0. Item one sub one
   1. Item one sub two
1. Item two
   0. Item two sub one
   1. Item two sub two

I constructed the same list in Telerik RadRichTextBox and exported with the HtmlFormatProvider.  I noticed that the <ul> added start="1" and the <li> added value="1".

It appears that the Telerik editor depends on "start" and "value" attributes set properly in order to maintain the correct numbering when reloading the data.

Is there are way to prevent the zero based ordering without modifying my existing HTML?

Below is the original HTML data:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI; COLOR: #000000; DIRECTION: ltr">
<p style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
<span style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI">Numbered</span>
</p>
<p style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
&nbsp;
</p>
<ol style="LIST-STYLE-TYPE: decimal; MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px" type="1">
<li>
<div style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
<span style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI">Item one</span>
</div>
</li>
<li>
<ol style="LIST-STYLE-TYPE: decimal" type="1">
<li>
<div style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
<span style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI">Item one sub one</span>
</div>
</li>
<li>
<div style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
<span style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI">Item one sub two</span>
</div>
</li>
</ol>
</li>
<li>
<div style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
<span style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI">Item two</span>
</div>
</li>
<li>
<ol style="LIST-STYLE-TYPE: decimal" type="1">
<li>
<div style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
<span style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI">Item two sub one</span>
</div>
</li>
<li>
<div style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
<span style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI">Item two sub two</span>
</div>
</li>
</ol>
</li>
</ol>
<p style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
&nbsp;
</p>
<p style="MARGIN-BOTTOM: 0px; DIRECTION: ltr; MARGIN-TOP: 0px">
<span style="FONT-SIZE: 16pt; FONT-FAMILY: Segoe UI">Last line.</span>
</p>
</body>
</html>
Ralph
Top achievements
Rank 1
 answered on 26 Mar 2014
1 answer
421 views
I can not find where you have hidden the download link for the Offline Documentation. Could you please provided it here?
Dimitrina
Telerik team
 answered on 26 Mar 2014
1 answer
285 views
01.HyperlinkRangeStart hyperlinkStart = new HyperlinkRangeStart();
02. HyperlinkRangeEnd hyperlinkEnd = new HyperlinkRangeEnd();
03. hyperlinkEnd.PairWithStart(hyperlinkStart);
04. HyperlinkInfo hyperlinkInfo = new HyperlinkInfo() { NavigateUri = hrefURL, Target = HyperlinkTargets.Blank };
05. hyperlinkStart.HyperlinkInfo = hyperlinkInfo;
06. 
07. ImageInline image = new ImageInline();
08. image.UriSource = new Uri(linkFormatter.FormatAllImageHyperlink(link));
09. image.Size = new Size(16, 16);
10.  
11. Telerik.Windows.Documents.Model.Paragraph activeParagraph = Document.CaretPosition.GetCurrentParagraphBox().AssociatedParagraph;
12. DocumentElementCollection docElemColl = new DocumentElementCollection(activeParagraph);
13. docElemColl.Add(hyperlinkStart);
14. docElemColl.Add(image);
15. docElemColl.Add(hyperlinkEnd);
16. radRichTextBox.InsertHyperlink(hyperlinkStart.HyperlinkInfo, new Telerik.Windows.Documents.Model.InlineCollection(docElemColl));
17. 
18. //activeParagraph.Inlines.Add(hyperlinkStart);
19. //activeParagraph.Inlines.Add(image);
20. //activeParagraph.Inlines.Add(hyperlinkEnd);
21. 
22. //Telerik.Windows.Documents.Model.Inline inline = Document.CaretPosition.GetCurrentInline();
23. //inline.Children.Add(hyperlinkStart);
24. //inline.Children.Add(image);
25. //inline.Children.Add(hyperlinkEnd);
Everything that I've tried results in a crash, with the exception being: Unable to cast object of type 'Telerik.Windows.Documents.Model.HyperlinkRangeEnd' to type 'Telerik.Windows.Documents.Model.Span'.  The two commented out sections were previous attempts at adding the hyperlinked image to the document at the current caret position.

Missing User
 answered on 26 Mar 2014
1 answer
139 views
I want to print two pages per sheet .Because I have one GridView and only three columns are available in the GridView. So remaining part of the page are unuseful.
so that I set  PrintDialog.PrintTicket.PagesPerSheet = 2 and PrintDialog.PrintQueue.DefaultPrintTicket.PagesPerSheet = 2. But its not working. And I am using following code for the Printing.


public static void Print(this GridViewDataControl source, bool showDialog, bool p_IsLandscape = true)
        {
            try
            {
                PrintDialog _PrintDialog = new PrintDialog();
                _PrintDialog.PrintQueue = LocalPrintServer.GetDefaultPrintQueue();
                _PrintDialog.PrintTicket = _PrintDialog.PrintQueue.DefaultPrintTicket;


                // Updated By Bharat Mendapara | Date : 11/03/2014
                //Reason SDPLAN-58 (DPA022 - Diagram Objects printing).
                if (p_IsLandscape)
                    _PrintDialog.PrintTicket.PageOrientation = PageOrientation.Landscape;
                else
                {
                    _PrintDialog.PrintTicket.PageOrientation = PageOrientation.Portrait;
                    _PrintDialog.PrintTicket.PagesPerSheet = 2;
                    _PrintDialog.PrintQueue.DefaultPrintTicket.PagesPerSheet = 2;
                }

                bool? dialogResult = showDialog ? _PrintDialog.ShowDialog() : true;

                if (dialogResult == true)
                {
                    DocumentViewer viewer = new DocumentViewer();
                    viewer.Document = ToFixedDocument(ToPrintFriendlyGrid(source), _PrintDialog);
                    _PrintDialog.PrintDocument(viewer.Document.DocumentPaginator, null);
                }
            }
            catch
            {
            }
        }


static FixedDocument ToFixedDocument(FrameworkElement element, PrintDialog dialog)
        {
            PrintCapabilities capabilities = dialog.PrintQueue.GetPrintCapabilities(dialog.PrintTicket);
            FixedDocument fixedDocument = new FixedDocument();

            element.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));

            Size pageSize = new Size(element.DesiredSize.Width, dialog.PrintableAreaHeight);
            Size extentSize = new Size(element.DesiredSize.Width, capabilities.PageImageableArea.ExtentHeight);

            double totalHeight = element.DesiredSize.Height;
            double totalWidth = element.DesiredSize.Width;
            double yOffset = 0d;

            if (totalWidth < dialog.PrintableAreaWidth)
            {
                Size _Size = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight);
                element.Arrange(new Rect(new Point(0, 0), _Size));
            }
            else
            {
                element.Arrange(new Rect(new Point(0, 0), element.DesiredSize));
            }

            while (yOffset < totalHeight)
            {
                VisualBrush brush = new VisualBrush(element);
                brush.Stretch = Stretch.None;
                brush.AlignmentX = AlignmentX.Left;
                brush.AlignmentY = AlignmentY.Top;
                brush.ViewboxUnits = BrushMappingMode.Absolute;
                brush.TileMode = TileMode.None;
                if (totalWidth < dialog.PrintableAreaWidth)
                    brush.Viewbox = new Rect(0, yOffset, dialog.PrintableAreaWidth, extentSize.Height);
                else
                    brush.Viewbox = new Rect(0, yOffset, extentSize.Width, extentSize.Height);

                PageContent pageContent = new PageContent();
                FixedPage page = new FixedPage();
                ((IAddChild)pageContent).AddChild(page);

                fixedDocument.Pages.Add(pageContent);

                if (totalWidth < dialog.PrintableAreaWidth)
                    page.Width = dialog.PrintableAreaWidth;
                else
                    page.Width = totalWidth;

                page.Height = pageSize.Height;

                Canvas canvas = new Canvas();
                FixedPage.SetLeft(canvas, capabilities.PageImageableArea.OriginWidth);
                FixedPage.SetTop(canvas, capabilities.PageImageableArea.OriginHeight);

                if (totalWidth < dialog.PrintableAreaWidth)
                    canvas.Width = dialog.PrintableAreaWidth;
                else
                    canvas.Width = extentSize.Width;

                canvas.Height = extentSize.Height;
                canvas.Background = brush;

                page.Children.Add(canvas);

                yOffset += extentSize.Height;
            }
            return fixedDocument;
        }

Can you help

Thaks
Dimitrina
Telerik team
 answered on 26 Mar 2014
8 answers
382 views
Hello,

I am trying to put a RadHeatMap into my RadMap. Is it possible to put a RadHeatMap in an information layer? Is that the best way to do it, or is there a better way? How would I put a RadHeatMap inside of my RadMap so that it moves and zooms as if it were part of the map? I don't want labels or anything fancy on my RadHeatMap. I'm just looking to put a very simple, square, grid-like heat map on my RadMap.

I have MapPinPoints in an information layer already and I would like to be able to tell which "cell" of my RadHeatMap each PinPoint is from. Is there any way to do this?

Thanks in advance,
Liam
Andrey
Telerik team
 answered on 26 Mar 2014
2 answers
900 views
Hello,

I'm working on an app which needs to list many items (kind of 50 000 sometimes) with a custom items template.
Everything is working fine while controlling with the mouse, but it's buggy with a touch screen. In order to be able to click on a button or a checkbox inside any of the items, you need to swipe somewhere on the main list before.

Here is a part of my code : (scj: controls are derived from telerik: controls with only one or two more properties)

my XAML :
<scj:scjListBox Visibility="Visible" Grid.Column="2" x:Name="lstItemsSmall" ItemsSource="{Binding Path=Modeles}" Style="{DynamicResource ModelesStyleSmall}" Background="#FF525252">
                <scj:scjListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <scj:scjVirtualizingWrapPanel ItemWidth="300" ItemHeight="300"></scj:scjVirtualizingWrapPanel>
                    </ItemsPanelTemplate>
                </scj:scjListBox.ItemsPanel>
            </scj:scjListBox>

resource file - style :
<Style TargetType="scj:scjListBox" x:Key="ModelesStyleSmall">
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="telerik:RadListBoxItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    <Setter Property="VerticalContentAlignment" Value="Stretch" />
                    <Setter Property="Background" Value="Transparent" />
                    <Setter Property="BorderBrush" Value="Transparent" />
                    <Setter Property="BorderThickness" Value="0" />
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="FontSize" Value="12" />
                    <Setter Property="Padding" Value="0" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="telerik:RadListBoxItem">
                                <Border CornerRadius="5" BorderBrush="#FF565656" BorderThickness="1" Margin="5" Padding="5" Background="#FF606060">
                                    <Grid>
                                        <ContentPresenter x:Name="HeaderElement" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0"
                                            ContentTemplate="{StaticResource ProduitsDataTemplateSmall}"/>
                                    </Grid>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>

resource file - data template :
<DataTemplate x:Key="ProduitsDataTemplateSmall">
        <scj:scjGrid Height="280" Width="280">
            <scj:scjGrid.RowDefinitions>
                <RowDefinition Height="200"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="50"></RowDefinition>
            </scj:scjGrid.RowDefinitions>
            <scj:scjGrid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </scj:scjGrid.ColumnDefinitions>
            <Image Grid.Row="0" Grid.ColumnSpan="3" Source="{Binding Path=ImagePhoto}"></Image>
            <scj:scjTextBlock Grid.Row="1" Grid.ColumnSpan="3" NoTranslate="True" Text="{Binding Path=DisplayCodeName}" TextWrapping="Wrap" HorizontalAlignment="Left"></scj:scjTextBlock>
            <scj:scjButton Grid.Row="2" Grid.Column="0" NoTranslate="True" Style="{StaticResource ButtonStyle}" Click="btnPanier_Click" Tag="{Binding Path=sIdModele, Mode=OneWay}">
                <Image Source="Images/panier_ajout.png" Width="32" Height="32"></Image>
            </scj:scjButton>
            <scj:scjButton Grid.Row="2" Grid.Column="1" NoTranslate="True" Style="{StaticResource ButtonStyle}" Click="btnLoupe_Click" Tag="{Binding Path=sIdModele, Mode=OneWay}">
                <Image Source="Images/loupe.png" Height="32" Width="32"></Image>
            </scj:scjButton>
            <scj:scjCheckBox Grid.Row="2" Grid.Column="2" x:Name="chkStatut" NoTranslate="True" BorderBrush="Black" BorderThickness="0.3" Checked="chkStatut_Checked" Unchecked="chkStatut_Checked" HorizontalAlignment="Center" VerticalAlignment="Center">
                <scj:scjCheckBox.LayoutTransform>
                    <ScaleTransform ScaleX="3" ScaleY="3"></ScaleTransform>
                </scj:scjCheckBox.LayoutTransform>
            </scj:scjCheckBox>
        </scj:scjGrid>
    </DataTemplate>

I have tried on a :
-Win7 with mouse, everything is OK (smooth scrolling, clicking on the buttons, on the checkbox...)
-Win7 with touch, impossible to click on any button nor checkbox of an item (button gets focused but no event raised, checkbox get focused but not checked, but smooth scolling the list works fine)
-Win8 with touch, I need to swipe before clicking, or checking a box on an item (but smooth scolling works fine)

I haven't modified any touch behavior  at all. I need virtualization because of the number of items to load (from 15 to 50 000), and I need the control to act like an android app with touch smooth scrolling.

The screencapture shows the final window. Each light gray item contains a picture, 2 buttons and a checkbox.

My question is, is there a way to make it work with a touch screen, and how ?

Thank you for reading :)
Nicolas
Top achievements
Rank 1
 answered on 26 Mar 2014
1 answer
139 views
Hello sir/madam
I have tow questions. First, is there any solution to change duration of time interval? Now default value is half hour and I want to change it to 15 minuts.
Second question is : where can I find the place of date style?
if i want to use another type of .Net calender date where can I change it?
thank you for your attention
best regards, Mirzargar
Kalin
Telerik team
 answered on 26 Mar 2014
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
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?