Telerik Forums
UI for WPF Forum
1 answer
152 views
This is probably a basic WPF question, and not specifically Telerik related, but I figured I'd ask here. I am trying to create a reusable control, right now named SectionLayout, which allows the user of the control to define "sections", with Visuals in each section. I want to render this using RadTabControl.

Basically, the consumer of the SectionLayout would be using it like this:

<local:SectionLayout>
  <local:Section Name="Foo">
    <Button Text="{Binding Foo}" />
  </local:Section>
</local:SectionLayout>

I've already got most of it working. SectionLayout has a "Sections" property, of type SectionCollection, that holds items of type Section. Section has Name and Content properties. Name is a string, Content is an object.

The ControlTemplate for SectionLayout currently looks like this:

<ControlTemplate>
<telerik:RadTabControl
    Align="Right"
    TabOrientation="Vertical"
    TabStripPlacement="Left"
    ItemsSource="{TemplateBinding Sections}">
    <telerik:RadTabControl.ItemContainerStyle>
        <Style
            TargetType="{x:Type telerik:RadTabItem}">
            <Setter
                Property="MinHeight"
                Value="150" />
            <Setter
                Property="MinWidth"
                Value="30" />
        </Style>
    </telerik:RadTabControl.ItemContainerStyle>
    <telerik:RadTabControl.ItemTemplate>
        <DataTemplate>
            <TextBlock
                Text="{Binding Name}" />
        </DataTemplate>
    </telerik:RadTabControl.ItemTemplate>
    <telerik:RadTabControl.ContentTemplate>
        <DataTemplate
                DataType="{x:Type local:Section}">
            <ContentPresenter
                Margin="4,4,4,4"
                DataContext="{TemplateBinding DataContext}"
                Content="{Binding Content}" />
        </DataTemplate>
    </telerik:RadTabControl.ContentTemplate>
</telerik:RadTabControl>
</ControlTemplate>

So, basically I'm just making an easier interface to use a RadTabControl. So I can reuse it in other places. Though it might change from being a RadTabControl to something else in the future.

The problem I'm having is getting the original DataContext of Section.Content property to flow into the RadTabControl.ContentTemplate. The ContentTemplate is of course given the business object (Section) as it's datacontext. So, I can easily present Section.Content. However, when I do so, Section.Content begins inheriting the DataContext given to it by the ContentPresenter, which happens to be Section.Content.

How can I do this properly? I want the user to be able to use my control as he would any normal layout control: Grid, Canvas, StackPanel, whatever. But, I need to use a TabControl internally to do the layout.
Pavel R. Pavlov
Telerik team
 answered on 31 Jan 2013
8 answers
374 views
Just so you know, there are multiple errors here: http://www.telerik.com/help/wpf/radchartview-axes-datetimeaxes.html (XAML and VB).
Denis
Top achievements
Rank 1
 answered on 31 Jan 2013
3 answers
250 views
Hi,

I'm using RadPivotGrid with Column Group:

            <pivot:LocalDataSourceProvider.ColumnGroupDescriptions>
                <pivot:PropertyGroupDescription PropertyName="Periodo" CustomName="PerĂ­odo" SortOrder="Descending" />
            </pivot:LocalDataSourceProvider.ColumnGroupDescriptions>

As the attachement image shows, I've put the total before column groups. It's a native control feature.

Now I want:

1 - That totals  cells have lines like group cells;
2 - Alternating backgroung color for group cells. Example: group A cells background diferent from group B cells background.

How can I achieve this?
Rosen Vladimirov
Telerik team
 answered on 31 Jan 2013
1 answer
151 views
Trying to bind to a collection of objects that encapsulate parameters:
public Parameter
{
    string Name;
    object Value;
}
these are read dynamically at runtime, and each parameter could be of a different type. The collection (array) is then contained in another class.
If i bind to an instance of the 'parent' class the parameter collection shows up via the colleciton editor ui, however, the values are not updated on edit.
Since we are not really interested in the parent object, I have tried binding to the collection directly, but then the only properties I get are the ones from the collection object itself, like Count.
What am I missing here, what do I need to define/override for the grid to work with these?
Pointers to example code would be excellent! :)

Ivan Ivanov
Telerik team
 answered on 31 Jan 2013
1 answer
245 views
I have done grouping in the Telerik Gridview,My task is to Alter the header of the Group item at the run time , So i have implemented the below Code while clicking on the Expander i could able to get the content Nothing is displayed. 
Please help me on this 


 <telerik:RadGridView x:Name="telerikGrid" ItemsSource="{Binding Path=Collection}"  GridLinesVisibility="Horizontal" KeyboardNavigation.TabNavigation="Cycle" ShowGroupPanel="False"
 AutoGenerateColumns="False"  CanUserInsertRows="False" AutoExpandGroups="True" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" CanUserResizeColumns="False" CanUserSortColumns="True" CanUserReorderColumns="False" 
 MinHeight="360" MaxHeight="360" MaxWidth="880" MinWidth="880"  ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Visible">
      <telerik:RadGridView.GroupRowStyle>

<Style TargetType="telerik:GridViewGroupRow">
                    <Setter Property="Background" Value="Red"/>
                    <Setter Property="BorderBrush" Value="Yellow"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type telerik:GridViewGroupRow}">
                                <telerik:RadExpander IsExpanded="True" Background="#2A5581" BorderThickness="1,1,1,1">
                                    <telerik:RadExpander.Header>
                                        <DockPanel>
                                            <Grid>
                                                <Rectangle Fill="White" Width="Auto" Margin="0,1,0,1" Stroke="Black"/>
                                                <TextBlock Text="{Binding Path=TextName}" Margin="4,0,4,0" Grid.Column="0" Grid.Row="0" Foreground="Black"/>
                                            </Grid>
                                            <Grid>
                                                <Rectangle Fill="Black" Width="Auto" Margin="0,1,0,1"/>
                                                <TextBlock Text="{Binding Path=TextName}" Margin="4,0,4,0" Foreground="White" />
                                            </Grid>
                                        </DockPanel>
                                  
                                    </telerik:RadExpander.Header>
                                    <telerik:RadExpander.Content>
                                        <ItemsPresenter/>
                                    </telerik:RadExpander.Content>
                                </telerik:RadExpander>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>

                </Style>
            </telerik:RadGridView.GroupRowStyle>
<telerik:RadGridView.Columns>
 <telerik:GridViewColumn  MaxWidth="40" MinWidth="40">

          </telerik:GridViewcolumn>
</telerik:RadGridView.Columns>
         <telerik:RadGridView.Columns>
 <telerik:GridViewColumn  MaxWidth="40" MinWidth="40">

          </telerik:GridViewcolumn>
</telerik:RadGridView.Columns>
         <telerik:RadGridView.Columns>
 <telerik:GridViewColumn  MaxWidth="40" MinWidth="40">

          </telerik:GridViewcolumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>



Vanya Pavlova
Telerik team
 answered on 31 Jan 2013
1 answer
130 views
Howdy. I know this component is fairly new... but is there anyway to set the Add and Delete commands? Basically, they need to do things in my view model. As far as I can tell, they seem currently hard coded to actually add or remove items from the underlying collection.
Dimitrina
Telerik team
 answered on 31 Jan 2013
3 answers
101 views
I have a custom style for my connections. I set the target cap type as follows:
<Setter Property="TargetCapType" Value="Arrow1Filled" />

The result is an arrow pointing in the wrong direction, which is kind of ugly. See attached image!

How can I fix this?
Tina Stancheva
Telerik team
 answered on 31 Jan 2013
4 answers
274 views
Hello,

My list of data containing an image in byte [].
How I can include that image in a mail merge.
I tried using the INCLUDEPICTURE but does not work.

Is there any way?

Thanks and sorry for my English,

Jose
Petya
Telerik team
 answered on 31 Jan 2013
5 answers
182 views
With the help of a sample application I found a memory leak in Richtextbox.
It just displays a Dialog with a RichTextBox and then closes the window. After closing a call to GC.Collect() is made.
If you repeat that (e.g. 15 times) than the consumed memory is growing.

Please, can you confirm it is a bug or tell me the solution?

sample project: Here
Boby
Telerik team
 answered on 31 Jan 2013
10 answers
390 views
Hi everyone,

I use a RadRichText box and I need to insert a Telerik.Windows.Documents.Model.Table object(It is generated in Runtime)
into a Document, and in each cell I add a placeholder using InlineUIContainer,
so the question is how can I disable editing of my cell that contains a placeholder,
because currently all my functionality works perfect but cells are editable.

Method below initializes a TableCell instance where a placeholder is injected.
private double InitDataCell(TableCell dataCell, DynamicColumnViewModel columnVm, bool isWidth100, double percent)
{
            double cellHeight = 0;
 
            dataCell.Tag = columnVm.DynamicCellData.TableID.ToString();
 
            if (isWidth100)
            {
                dataCell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, percent);
            }
            else
            {               
                dataCell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Fixed, columnVm.Width);
            }           
 
            dataCell.TextAlignment = columnVm.Alignment;
            dataCell.VerticalAlignment = RadVerticalAlignment.Center;
            var paragraph = new Paragraph();
            paragraph.TextAlignment = columnVm.Alignment;
            dataCell.Blocks.Add(paragraph);
 
            dataCell.Background = columnVm.DynamicCellData.Background;         
 
            var tb = new TextBlock
            {
                Text = columnVm.Expression,
                Tag = string.Format("{0}{1}", DynamicTableCommon.DynamicTable.TABLE_TAG_ID_PREFIX, columnVm.DynamicCellData.TableID.ToString()),
                FontSize = columnVm.DynamicCellData.FontSize,
                Background = new SolidColorBrush(columnVm.DynamicCellData.Background),
                Foreground = new SolidColorBrush(columnVm.DynamicCellData.Foreground),
                FontFamily = columnVm.DynamicCellData.FontFamily,
                FontWeight = columnVm.DynamicCellData.FontWeight,
                FontStyle = columnVm.DynamicCellData.FontStyle,
                TextDecorations = columnVm.DynamicCellData.TextDecoration
            };
 
            tb.VerticalAlignment = VerticalAlignment.Bottom;
 
            tb.HorizontalAlignment = PlaceHolderReplaceManager.ConvertRadTextAlignmentToHorAlignment(columnVm.Alignment);
 
            System.Windows.Controls.Border border = new System.Windows.Controls.Border();
            border.BorderThickness = new Thickness(0);
            border.BorderBrush = Brushes.Transparent;
            border.Background = new SolidColorBrush(columnVm.DynamicCellData.Background);           
            border.VerticalAlignment = VerticalAlignment.Center;
            border.HorizontalAlignment = HorizontalAlignment.Center;
            border.Child = tb;
 
            border.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));        
 
            Size s = new Size(border.DesiredSize.Width + 1, tb.DesiredSize.Height - 1);
            var uic = new DynamicCellInlineUIContainer(border, s);                         
 
            paragraph.Tag = columnVm.DynamicCellData.TableID.ToString();
            paragraph.Inlines.Add(uic);
 
            cellHeight = uic.Height + 10;
 
            return cellHeight;
 }

and another question is - In what Table property can I save my ViewModel ID(table ID) value, because when
I try to save it in a Tag property, it dissapears when I do an export my Document(contains a table with Tag initialized property) to Html using HtmlFormatProvider?

Thanks in advance.
Petya
Telerik team
 answered on 31 Jan 2013
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?