Telerik Forums
UI for WPF Forum
2 answers
133 views

select one connection the line color is black,  but select more than one connection  the line color is  outside  blue and inside black

is there any mothed to set them as a same style

rui
Top achievements
Rank 1
 answered on 18 Jan 2016
0 answers
192 views

 I placed two RadSplitContainer inside RadDocking.

Is it possible to stretch frst RadSplitContainer and fix second RadSplitContainer width to auto.

You can check the below attachment for my requirement.

Code:

<telerik:RadDocking BorderThickness="0" Grid.Row="1" HasDocumentHost="False">
                        <telerik:RadSplitContainer x:Name="ContantContainer" HorizontalAlignment="Stretch">
                            <telerik:RadPaneGroup IsContentPreserved="True">
                                <telerik:RadPane x:Name="contentPane" CanUserClose="False" CanUserPin="False" CanFloat="False" PaneHeaderVisibility="Visible" Header="Pane1">
                                    <ContentPresenter Content="{TemplateBinding Content}" />
                                </telerik:RadPane>
                            </telerik:RadPaneGroup>
                        </telerik:RadSplitContainer>
                        <telerik:RadSplitContainer x:Name="editContainer" Width="Auto" HorizontalAlignment="Right">
                            <telerik:RadPaneGroup IsContentPreserved="True">
                                <telerik:RadPane x:Name="editPane" CanUserClose="False" CanUserPin="False" CanFloat="False" PaneHeaderVisibility="Visible" Header="Pane2">
                                    <ContentPresenter Content="{TemplateBinding Abstract}" />
                                </telerik:RadPane>
                            </telerik:RadPaneGroup>
                        </telerik:RadSplitContainer>
Palani
Top achievements
Rank 1
Iron
 asked on 16 Jan 2016
4 answers
1.2K+ views
How do I create a Switch Button control for displaying an ON/OFF button that can be toggled (like the Settings->Airplane Mode on the iphone).

Thanks,

Ed
Sahana
Top achievements
Rank 1
 answered on 15 Jan 2016
3 answers
175 views
I recently upgraded the telerik controls from 2011.2.11.831 to 2015.1.331.20 and I am having an issue with the group by feature of the radgridview. Is this a known issue, and if is then is there a way to fix this?

grid1.png: The screen is stretched, the vertical scroll bar is clearly visible on the right.

grid2.png: As I reduce the width of the screen, the vertical scrollbar comes in with it as expected.

grid4.png: At this point the horizontal scroll bar is visible but the vertical one is not. This is with the horizontal scrollbar all the way to the right. Some content is also cut off.


grid4.png: This is how it looks before the telerik controls were updated to 2015.1.331.20.
Martin
Top achievements
Rank 1
 answered on 15 Jan 2016
0 answers
141 views

I'm doing a project, i have one pivot and this pivot have two pivotitem. The first one is called Lista and the second one is called Carrinho. In the first one i have a listview to store products and i have a binding to my productview model. When i select a button one the product he shows flyout and what i want is when i click the button that is on that flyout all the data that i have on the product will be send to the second pivotitem and i don't know how to do that mainly because the first pivotitem have the binding to productviewmodel and the second need to have the binding to other view model because the second pivotitem will be the order for the product and i think that maybe i just need to send the id of product because they are related in the database between this two tables (product and order).

Here is the code that i have in xaml to better explain.

        <Pivot Grid.Column="1">

            <PivotItem Header="Lista">
                <ListView x:Name="List1" ItemsSource="{x:Bind ProdutoViewModel.Produtos}" Height="550" SelectionChanged="List1_SelectionChanged">
                    <ListView.ItemTemplate>
                        <DataTemplate x:DataType="list:Produto">
                            <ListView FlyoutBase.AttachedFlyout="{StaticResource FlyoutBase1}" RightTapped="StackPanel_RightTapped">
                                <Button x:Name="CarrButton">
                                    <Image Source="/Assets/cart.png" Height="20"/>
                                    <Button.Flyout>
                                        <Flyout>
                                            <StackPanel>
                                                <TextBlock Style="{StaticResource BaseTextBlockStyle}">
                                                    Adicionar este produto?
                                                </TextBlock>
                                                <Button Click="CarrConfirmation_Click">
                                                    Carrinho
                                                </Button>
                                            </StackPanel>
                                        </Flyout>
                                    </Button.Flyout>
                                </Button>
                                <StackPanel>
                                    <TextBlock Text="{x:Bind Nome}" Margin="100,10,10,10"/>
                                    <TextBlock Text="{x:Bind Preco}" Margin="100,10,10,10"/>
                                    <TextBlock Text="{x:Bind Disponivel}" Margin="100,10,10,10"/>
                                    <TextBlock Text="{x:Bind Fornecedor}" Margin="100,10,10,10"/>
                                    <TextBlock Text="{x:Bind Categoria}" Margin="100,10,10,10"/>
                                </StackPanel>
                            </ListView>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>

            </PivotItem>
            <PivotItem Header="Carrinho">
                <ListView x:Name="Cart" ItemsSource="{Binding EncomendaViewModel.Encomendas}" Height="550">
                    <ListView.ItemTemplate>
                        <DataTemplate x:DataType="list:Produto">

                            <StackPanel>
                                <TextBlock Text="dasfas"></TextBlock>
                               

                            </StackPanel>

                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </PivotItem>

        </Pivot>

 

On the code behind i don't know what to do and only have this

private void CarrConfirmation_Click(object sender, RoutedEventArgs e)
        {
            
            Button button = sender as Button;
            Produto produto = button.DataContext as Produto;

       }

 

Thanks

 

Vitor
Top achievements
Rank 1
 asked on 15 Jan 2016
14 answers
663 views

Hello !

First of all, let me wish you a happy new year !

Let's get straight to the point, I can't print my ScheduleView (SV). On my screen, I can see about 50% (or less) of the entire SV. The goal for me is to print the entire SV on as many pages needed without quality loss.

I used this project to start : http://www.telerik.com/forums/print-bb34c69c1e37#1454069 but I can't adapt it to my needs. The result I obtain with that method is only the visible part of my SV (and it doesn't even fit the whole page).

I also tried the method below but the xps I get is blank. There's only the textblock "Toto".

 

LayoutRoot.Children.Remove(MainSV); // LayoutRoot is the main grid of our view
 
StackPanel sp = new StackPanel();
sp.Children.Add(new TextBlock { Text = "Toto" });
sp.Children.Add(MainSV);
 
FixedPage fp = new FixedPage();
fp.Children.Add(sp);
 
string path = @"C:\test\pla_" + Guid.NewGuid() + ".xps";
XPSPrinter.CreateXps(path, new List<FixedPage> { fp });

I can provide more snippet, just ask me what you need to see.

Thanks for your help.

 

Regards.

Ben


 
Nasko
Telerik team
 answered on 15 Jan 2016
8 answers
214 views

Hi,


I am using Mail Merge fields to write address on an envelope.  Here is an example:

John Smith

125 Main St

Toronto, ON M2R 3B7

Canada



Sometimes there could be 2 lines for the address, for example:

John Smith

5th Floor

125 Main St

Toronto, ON M2R 3B7

Canada



Below is how I have setup document in RichTextBox.

{MERGEFIELD FullName}

{MERGEFIELD Address1}

{MERGEFIELD Address2}

{MERGEFIELD City}, {MERGEFIELD Province} {MERGEFIELD PostalCode}

{MERGEFIELD Country}

But if Address2 is empty, I don't want to have an empty line. I need to setup Address2 mail merge field in such a way, so that if it is empty, it does not take up the line and City/Province/PostalCode displayed on the 3rd line.



Anyone can suggest how to achieve this either through the template or through the backend?




Petya
Telerik team
 answered on 15 Jan 2016
1 answer
387 views

Hi, I have another function that populates the selected items from my AutocompleteBox. I want to remove the typing capabilities of my AutoCompleteBox. But I would like to still remove any items selected. 

 

May I ask how would that be accomplished? 

Nasko
Telerik team
 answered on 15 Jan 2016
1 answer
269 views

I have the following extension method in my application. It captures previews of my usercontrols and allows the user to navigate them via a menu.

 

/// <summary>
/// Renders a framework element as a bitmap image.
/// </summary>
/// <param name="frameworkElement">The framework element to be rendered.</param>
/// <param name="background">The background to be applied to the element, in case the element has trasnparent background.</param>
/// <param name="scale">The scaling of the image, default should be 1.</param>
/// <returns>The image as a scaled bitmap.</returns>
public static BitmapImage RenderToBitmap(this FrameworkElement frameworkElement, Brush background, double scale = 1)
{
    Check.NotNull(frameworkElement, "frameworkElement");
 
 
    var renderWidth = (int)(frameworkElement.RenderSize.Width * scale);
    var renderHeight = (int)(frameworkElement.RenderSize.Height * scale);
 
    if (renderWidth > 0 && renderHeight > 0)
    {
        var renderTarget = new RenderTargetBitmap(renderWidth, renderHeight, 96, 96, PixelFormats.Default);
 
        var sourceBrush = new VisualBrush(frameworkElement);
 
        var drawingVisual = new DrawingVisual();
 
        var rect = new Rect(new Point(0, 0), new Point(frameworkElement.RenderSize.Width, frameworkElement.RenderSize.Height));
 
        using (var drawingContext = drawingVisual.RenderOpen())
        {
            drawingContext.PushTransform(new ScaleTransform(scale, scale));
            drawingContext.DrawRectangle(background, null, rect);
            drawingContext.DrawRectangle(sourceBrush, null, rect);
        }
 
        renderTarget.Render(drawingVisual);
 
        var image = new BitmapImage();
 
        using (MemoryStream memoryStream = new MemoryStream())
        {
            JpegBitmapEncoder encoder = new JpegBitmapEncoder();
 
            encoder.Frames.Add(BitmapFrame.Create(renderTarget));
 
            encoder.Save(memoryStream);
 
            image.BeginInit();
            image.StreamSource = new MemoryStream(memoryStream.ToArray());
            image.EndInit();
        }
 
        return image;
    }
 
    return null;
}

 

Lately we've started a new development with the radmap control and we started to have some issues. The app hanged whenever we entered the view containing the map. I profiled the app and the results tell me that there's an issue with the radmap control.

 

I've started trying stuff and I realized that the problem starts when I try to generate the visual before the image creation. If I instead do renderTarget.Render(frameworkElement) it seems to work, but then I can't apply the background transformation to the visual. The problem starts when I use the map to create a VisualBrush. Could this be a bug? 

 

Thanks for your time.

 

 

Petar Mladenov
Telerik team
 answered on 15 Jan 2016
3 answers
200 views

Hello

 The following HTML code looks very different when loaded in the RichTextBox compared to the Broswer version.

Check the attached images.

 

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Listagem Módulos Montados</title>
  </head>
  <body>
    <table align="center" border="0">
      <thead id="HEADER">
        <tr>
          <td align="middle">
            <table width="630" border="0">
              <tbody>
                <tr>
                  <td style="FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #808080; PADDING-TOP: 20px; FONT-FAMILY: Arial" width="400">Data: 
12/01/2016<span style="MARGIN: 0px; WIDTH: 10px"></span> Hora: 
11:29:02</td>
                  <td style="FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #808080; PADDING-TOP: 20px; FONT-FAMILY: Arial" align="right">Listagem 
</td>
                </tr>
              </tbody>
            </table>
          </td>
        </tr>
      </thead>
      <tbody>
        <tr id="CUSTOMERDATA">
          <td valign="top">
            <table style="BORDER-RIGHT: #818181 1px solid; BORDER-TOP: #818181 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #818181 1px solid; BORDER-BOTTOM: #818181 1px solid; FONT-FAMILY: Tahoma; BORDER-COLLAPSE: collapse" cellspacing="0" cellpadding="0" width="100%" border="0">
              <tbody>
                <tr>
                  <td style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-SIZE: 16px; PADDING-BOTTOM: 5px; COLOR: #808080; PADDING-TOP: 5px; BORDER-BOTTOM: #818181 1px solid" bgcolor="#eeeeee"><b>Dados do cliente:
</b></td>
                </tr>
                <tr>
                  <td style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; LINE-HEIGHT: 20px; PADDING-TOP: 5px" width="592" height="22">
                    <table cellspacing="5" cellpadding="2" width="100%" border="0">
                      <tbody>
                        <tr>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">Nome:
</span></b></td>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">CPF:
</span></b></td>
                        </tr>
                        <tr>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">Endereço:
</span></b></td>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">CEP:
</span></b></td>
                        </tr>
                        <tr>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">Bairro:
</span></b></td>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">UF:
</span></b></td>
                        </tr>
                        <tr>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">End. Entrega:
</span></b></td>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">Cidade:
</span></b></td>
                        </tr>
                        <tr>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">Telefone:
</span></b></td>
                          <td style="FONT-SIZE: 10px"><b><span style="COLOR: #535353">Celular:
</span></b></td>
                        </tr>
                        <tr>
                          <td style="FONT-SIZE: 10px" colspan="2"><b><span style="COLOR: #535353">E-mail:
</span></b></td>
                        </tr>
                      </tbody>
                    </table>
                  </td>
                </tr>
              </tbody>
            </table>
          </td>
        </tr>
        <tr id="BODY" templatetext="Módulos montados por categoria">
          <td valign="top"></td>
        </tr>
        <tr id="OBSERVATIONS">
          <td valign="center">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td style="color:#818181;line-height:20px;padding:5px;font-size:10px;font-family:Arial;" valign="top" class="textoorc"><b><span style="color:#808080">Observações:</span></b><br></td>
              </tr>
            </table>
          </td>
        </tr>
      </tbody>
      <tfoot id="FOOTER">
        <tr>
          <td align="middle"><br><br><b><span style="COLOR: #535353">Razão social:
</span></b><span style="MARGIN: 0px; WIDTH: 5px"></span><span style="MARGIN: 0px; WIDTH: 10px"></span>| 
<span style="MARGIN: 0px; WIDTH: 10px"></span><b><span style="COLOR: #535353">Endereço:
</span></b><span style="MARGIN: 0px; WIDTH: 5px"></span><span style="MARGIN: 0px; WIDTH: 10px"></span> | 
<span style="MARGIN: 0px; WIDTH: 10px"></span><b><span style="COLOR: #535353">Telefone:
</span></b><span style="MARGIN: 0px; WIDTH: 5px"></span></td>
        </tr>
        <tr>
          <td align="middle"> Todos os direitos reservados
</td>
        </tr>
      </tfoot>
    </table>
  </body>
</html>

Maurício
Top achievements
Rank 1
 answered on 15 Jan 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
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?