Telerik Forums
UI for WPF Forum
4 answers
450 views
Hi,

I am new to this telerik controls. I want to align the expand arrow to the left corner of the bar. currently it is in the right corner. How can i acheive it.

Thanks,
Subash
Vijay
Top achievements
Rank 1
 answered on 30 Dec 2012
0 answers
251 views
When I create a table with LayoutMode = TableLayoutMode.Fixed, multiple columns and different size TableCells, the cells in the second row and onwards have incorrect widths.

When running the code below (see also the attached screenshot):
  • the widths of the cells in the first row are correct
  • the first cell in the second and third row are too wide
  • the second and fourth cell in the second and third row should be the same width, but they are not

Am I doing something wrong? Should I take some margin or border width into account when working with fixed with TableCells?

I'm using version 2012.3.1129.40

using System.Collections.Generic;
using System.Windows.Media;
using Telerik.Windows.Documents.Model;
 
namespace RadDocumentTableTest
{
    public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
 
            var document = new RadDocument();
            var section = new Section();
            section.Blocks.Add(new Paragraph());
 
            var table = new Table
            {
                LayoutMode = TableLayoutMode.Fixed,
                Style = document.StyleRepository["TableGrid"],
                PreferredWidth = new TableWidthUnit(618)
            };
 
            table.Rows.AddRange(CreateRows());
 
            section.Blocks.Add(table);
            document.Sections.Add(section);
 
            RichTextBox.Document = document;
        }
 
        private static TableCell CreateTableCell(int colSpan, double width, string text)
        {
            var cell = new TableCell
            {
                ColumnSpan = colSpan,
                PreferredWidth = new TableWidthUnit(TableWidthUnitType.Fixed, width),
            };
 
            var par = new Paragraph();
            var span = new Span
            {
                Text = text,
                FontFamily = new FontFamily("Calibri"),
                FontSize = 15
            };
 
            par.Inlines.Add(span);
            cell.Blocks.Add(par);
            return cell;
        }
 
        private static IEnumerable<TableRow> CreateRows()
        {
            var rows = new List<TableRow>();
 
            var row1 = new TableRow();
            row1.Cells.Add(CreateTableCell(1, 55, "r1c1:cs1:w55"));
            row1.Cells.Add(CreateTableCell(2, 125, "r1c2:cs2:w125"));
            row1.Cells.Add(CreateTableCell(1, 90, "r1c3:cs1:w90"));
            row1.Cells.Add(CreateTableCell(3, 348, "r1c4:cs3:w348"));
            rows.Add(row1);
 
            var row2 = new TableRow();
            row2.Cells.Add(CreateTableCell(2, 90, "r2c1:cs2:w90"));
            row2.Cells.Add(CreateTableCell(3, 219, "r2c2:cs3:w219"));
            row2.Cells.Add(CreateTableCell(1, 90, "r2c3:cs1:w90"));
            row2.Cells.Add(CreateTableCell(1, 219, "r2c4:cs1:w219"));
            rows.Add(row2);
 
            var row3 = new TableRow();
            row3.Cells.Add(CreateTableCell(2, 90, "r3c1:cs2:w90"));
            row3.Cells.Add(CreateTableCell(3, 219, "r3c2:cs3:w219"));
            row3.Cells.Add(CreateTableCell(1, 90, "r3c3:cs1:w90"));
            row3.Cells.Add(CreateTableCell(1, 219, "r3c4:cs1:w219"));
            rows.Add(row3);
 
            return rows;
        }
    }
}
Erik
Top achievements
Rank 1
 asked on 29 Dec 2012
1 answer
128 views
That title should read "Grouping fails for nullable columns when no data rows are present in the grid"

When the grid has data in it, all columns group and ungroup normally by dragging them to the group bar.
If the grid has no data rows, only a header is showing, then only non-nullable columns (DateTime in my case) can dragged to the group bar and all the others show a red circle with a line through it as you drag them over the bar.

Same is true for sorting. If you click on a nullable column with no data rows, sort indicator does not change. Non-nullable (DateTime) do.
Also, the nullable columns, when no data rows are present, have no filter icon. Non-nullable (DateTime) do.

Has anyone else noticed this? Is there any solution or is this a bug in the grid?

I code behind generate all the columns of the grid, and everything works perfectly if the grid has data rows. It could be the generation, but the code behind is fairly straightforward and again works fine with data.

I have attached a picture of the filter absence/presence. The types are easily identifiable.

Any input would be appreciated.
Matt
Top achievements
Rank 2
 answered on 29 Dec 2012
1 answer
152 views
I'm trying to display some of the Data as Text in my TimelineItems, but all my Template can access is an Object of type TimelineDataItem

System.Windows.Data Error: 40 : BindingExpression path error: 'Iteration' property not found on 'object' ''TimelineDataItem'

TimelineDataItem has no Property that holds the original value object. In the ToolTip I can access the original Data object, though.
Can anyone tell me please how I can get the original Data in the template?

                                        <ControlTemplate TargetType="{x:Type telerik:TimelineItemControl}">
                                            <Border Background="#01FFFFFF" Height="30" Margin="0,5,0,0">
                                                <Grid>
                                                    <Rectangle x:Name="timelineItem" Height="29" Stroke="#FFCBCBCB" VerticalAlignment="Center">
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                <GradientStop Color="#FF4786AA" Offset="0"/>
                                                                <GradientStop Color="#FF163D59" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                    <TextBlock Text="{Binding Path=Iteration.Name}"></TextBlock>
                                                </Grid>
                                            </Border>
                                        </ControlTemplate>
Tsvetie
Telerik team
 answered on 28 Dec 2012
0 answers
177 views
 Hi:
    I want to expand all children of one parent note, but the children rows do not show. Detailed information please read from the attachment. Please give me a help.
    Thanks.

Attachment
Joke
Top achievements
Rank 1
 asked on 28 Dec 2012
0 answers
93 views
Hi:
      I want to expand all children of one parent note, but the children rows do not show. Detailed information please read from the attachment.

Thanks.
Joke
Top achievements
Rank 1
 asked on 28 Dec 2012
1 answer
85 views
Hi,
Am I able to freeze rows in the TreeListView ?

Best regards & have a nice holidays :)
Kristján.
Vlad
Telerik team
 answered on 28 Dec 2012
0 answers
117 views
Hey guys
I am newbie in Telerik WPF Dev, I have a trouble with implementation of telerik already prepared examples. For example here is one link

http://demos.telerik.com/silverlight/#GridView/Selectors/StyleSelectors/RowStyleSelector

Under the code we can notice

xmlns:Examples="clr-namespace:Telerik.Windows.Examples"

and further down xaml tag

<Examples:UnitPriceConveter x:Key="converter" />

How to get access to that 'Examples',
how to implement the example to make it work with my DataTable as my DataSource.
I could not find any info of how to make these examples to work with DataTable.

If you will explain or provide at least one example of how to go around that 'Examples:' tag and of how to use DataTable as DataSource I will be ok

Thanks
 
Lukasz
Top achievements
Rank 1
 asked on 27 Dec 2012
4 answers
162 views
I have a RadDataForm that contains a number of fields.

When I add a DataFormDateField and bring up the form in ReadOnly mode, the field is disabled.  When I add a DataFormDataField that contains a RadDateTimePickerand bring up the form in ReadOnly mode, the field is not disabled.

In other words, this works:
<telerik:DataFormDateField
    Label="Contact Date"
    DataMemberBinding="{Binding Path=contactdt}"
    />

And this does not:
<telerik:DataFormDataField
    Label="Contact Date"
    >
    <telerik:RadDateTimePicker
        SelectedValue="{Binding Path=contactdt}"
    />
</telerik:DataFormDataField>

Is there a way to get a DataFormDataFields contained controls to respond to the form's Mode?
Jeff
Top achievements
Rank 1
 answered on 27 Dec 2012
1 answer
387 views
Hi,

The following works when the context menu is declared in the TreeView directly.
<telerik:RadTreeView Name="radTreeView" ExpanderStyle="{StaticResource ExpanderStyle}" ItemsSource="{Binding Path=EnvironmentMenuDataSource}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemTemplate="{StaticResource EnvironmentMenu}">
                                    <telerik:RadContextMenu.ContextMenu>
                                        <telerik:RadContextMenu Opened="RadTreeViewContextMenuOpened">
                                            <telerik:RadMenuItem Header="{Binding Path=SelectedItem.ContextCommandName}"  Command="{Binding Path=ViewListCommand}" CommandParameter="{Binding SelectedItem}">
                                                <telerik:RadMenuItem.Icon>
                                                    <Image Source="../Images/Menu/Blue.png" Stretch="Uniform" />
                                                </telerik:RadMenuItem.Icon>
                                            </telerik:RadMenuItem>
                                        </telerik:RadContextMenu>
                                    </telerik:RadContextMenu.ContextMenu>
                                </telerik:RadTreeView>

However when placed my context menu inside the Data template as I only want a context menu with leave items,
<DataTemplate x:Key="EntityMenu">
           <Grid>
               <Grid.ColumnDefinitions>
                   <ColumnDefinition Width="0.35*"/>
                   <ColumnDefinition Width="0.65*"/>
               </Grid.ColumnDefinitions>
               <Image Source="{Binding ImageUrl, Mode=OneWay}" Width="16" Height="16"/>
               <TextBlock Margin="3,0,0,0" Grid.Column="1" TextWrapping="Wrap" Text="{Binding Name, Mode=OneWay}">
                    <telerik:RadTreeView Name="radTreeView" ExpanderStyle="{StaticResource ExpanderStyle}" ItemsSource="{Binding Path=EnvironmentMenuDataSource}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemTemplate="{StaticResource EnvironmentMenu}">
                                   <telerik:RadContextMenu.ContextMenu>
                                       <telerik:RadContextMenu Opened="RadTreeViewContextMenuOpened">
                                           <telerik:RadMenuItem Header="{Binding Path=SelectedItem.ContextCommandName}"  Command="{Binding Path=ViewListCommand}" CommandParameter="{Binding SelectedItem}">
                                               <telerik:RadMenuItem.Icon>
                                                   <Image Source="../Images/Menu/Blue.png" Stretch="Uniform" />
                                               </telerik:RadMenuItem.Icon>
                                           </telerik:RadMenuItem>
                                       </telerik:RadContextMenu>
                                   </telerik:RadContextMenu.ContextMenu>
                               </telerik:RadTreeView>
               </TextBlock>
           </Grid>
       </DataTemplate>
       <HierarchicalDataTemplate x:Key="EnvironmentMenu" ItemTemplate="{StaticResource EntityMenu}"
          ItemsSource="{Binding EntityMenus}">
           <TextBlock Text="{Binding Name}" />
       </HierarchicalDataTemplate>

it does not work anymore. I tried to change the binding with the relativesouce but no luck. we are using the MVVM. The commands are in the ViewModel of the view.

Do you have any examples with it?

Thanks
Pavel R. Pavlov
Telerik team
 answered on 27 Dec 2012
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?