Telerik Forums
UI for WPF Forum
4 answers
218 views

Space is premium on my TreeListView.  I removed the Row Selector but I still seem to have a column reserved for it.  Is there a way to set that column to zero width or eliminate it all together?

Thanks for your help,

Joel.

Data Templates:

<DataTemplate
    x:Key="TreeNodeTemplate">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
 
        <Image
            Grid.Column="0"
            Source="{Binding Image, Mode=TwoWay}"
            ToolTip="{Binding Barcode, Mode=TwoWay}"/>
 
        <Image
            Grid.Column="0"
            Height="20"
            Width="20"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Margin="-20,0,0,0"
            Source="{Binding StatusImage, Mode=TwoWay}"
            ToolTip="{Binding StatusName, Mode=TwoWay}"/>
 
        <TextBlock
            Grid.Column="1"
            Text="{Binding Name, Mode=TwoWay}"
            Margin="5"
            ToolTip="{Binding Description}"/>
    </Grid>
</DataTemplate>
<DataTemplate
    x:Key="TreeNodeEditTemplate">
 
    <StackPanel
        Orientation="Horizontal">
 
        <StackPanel
            Orientation="Vertical">
 
            <Image
                Height="20"
                Width="20"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Source="{Binding StatusImage, Mode=TwoWay}"
                ToolTip="{Binding StatusName, Mode=TwoWay}"/>
 
            <Image
                Source="{Binding Image, Mode=TwoWay}"
                VerticalAlignment="Top"/>
        </StackPanel>
 
        <Grid
            Margin="5"
            Background="Cornsilk">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
 
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="125"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
 
                <Grid.RowDefinitions>
                    <RowDefinition Height="28"/>
                    <RowDefinition Height="28"/>
                    <RowDefinition Height="28"/>
                    <RowDefinition Height="28"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
 
                <Label
                    Content="ID:"
                    Grid.Column="0"
                    Grid.Row="0"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center"/>
 
                <TextBlock
                    Grid.Column="1"
                    VerticalAlignment="Center"
                    Text="{Binding ID, Mode=TwoWay}"/>
 
                <Label
                    Content="Name:"
                    Grid.Column="0"
                    Grid.Row="1"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center"/>
 
                <TextBox
                    Grid.Column="1"
                    Grid.Row="1"
                    VerticalAlignment="Center"
                    Text="{Binding Name, Mode=TwoWay}"
                    IsEnabled="{Binding IsEditableStatus}"
                    IsReadOnly="{Binding IsEditableStatus, Converter={StaticResource BoolToOppositeBoolConverter}}"/>
 
                <Label
                    Content="Description:"
                    Grid.Column="0"
                    Grid.Row="2"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center"/>
 
                <TextBox
                    Grid.Column="1"
                    Grid.Row="2"
                    VerticalAlignment="Center"
                    Text="{Binding Description, Mode=TwoWay}"
                    IsEnabled="{Binding IsEditableStatus}"
                    IsReadOnly="{Binding IsEditableStatus, Converter={StaticResource BoolToOppositeBoolConverter}}"/>
 
                <Label
                    Content="Barcode:"
                    Grid.Column="0"
                    Grid.Row="3"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center"/>
 
                <TextBox
                    Grid.Column="1"
                    Grid.Row="3"
                    VerticalAlignment="Center"
                    Text="{Binding Barcode, Mode=TwoWay}"/>
            </Grid>
 
            <GroupBox
                Header="Status"
                Grid.Row="4"
                Margin="5">
 
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="125"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
 
                    <Grid.RowDefinitions>
                        <RowDefinition Height="28"/>
                        <RowDefinition Height="28"/>
                    </Grid.RowDefinitions>
 
                    <Label
                        Content="CRUD Status:"
                        Grid.Column="0"
                        Grid.Row="0"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Center"/>
 
                    <TextBlock
                        Grid.Column="1"
                        Grid.Row="0"
                        VerticalAlignment="Center"
                        Text="{Binding StatusName, Mode=TwoWay}"/>
 
                    <Label
                        Content="Inspect Status:"
                        Grid.Column="0"
                        Grid.Row="1"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Center"/>
 
                    <TextBlock
                        Grid.Column="1"
                        Grid.Row="1"
                        Text="{Binding InspectStatusName, Mode=TwoWay}"
                        VerticalAlignment="Center"/>
                </Grid>
            </GroupBox>
 
        </Grid>
    </StackPanel>
</DataTemplate>

 

Control Configuration:

<telerik:RadTreeListView
    x:Name="treeListView"
    AutoGenerateColumns="False"
    HorizontalAlignment="Stretch"
    VerticalAlignment="Stretch"
    CanUserFreezeColumns="False"
    CanUserReorderColumns="False"
    SelectionMode="Single"
    Grid.Row="1"
    Margin="5"
    IsReadOnly="{Binding IsReadOnly}"
    ItemsSource="{Binding Hierarchy, Mode=TwoWay}"
    SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
    IsExpandedBinding="{Binding IsExpanded, Mode=TwoWay}"
    AutoExpandItems="True"
    ShowGroupPanel="False"
    IsFilteringAllowed="False"
    ShowColumnHeaders="False"
    EditTriggers="F2"
    HierarchyIndent="12"
    MinColumnWidth="12"
    RowIndicatorVisibility="Hidden"
    MouseDoubleClick="treeListView_MouseDoubleClick"
    PreviewMouseLeftButtonDown="treeListView_PreviewMouseLeftButtonDown">
 
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition 
            ItemsSource="{Binding Children}"/>
    </telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:RadTreeListView.Columns>
 
        <telerik:GridViewDataColumn
            DataMemberBinding="{Binding Name, Mode=TwoWay}"
            CellTemplate="{StaticResource TreeNodeTemplate}"
            CellEditTemplate="{StaticResource TreeNodeEditTemplate}"
            IsReadOnly="False"
            Width="*"/>
 
        <telerik:GridViewComboBoxColumn
            x:Name="itemTypeColumn"
            Header="Item Type"
            DataMemberBinding="{Binding ItemTypeID, Mode=TwoWay}"
            DisplayMemberPath="Name"
            SelectedValueMemberPath="ID"
            SortMemberPath="Order"
            SortingState="Ascending"
            ItemsSource="{Binding TypeModel.Items, Mode=TwoWay}"
            IsReadOnly="True"
            Width="150"/>
 
        <telerik:GridViewDataColumn
            DataMemberBinding="{Binding IsActive, Mode=TwoWay}"
            Header="Include"/>
 
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>

Joel Palmer
Top achievements
Rank 2
 answered on 19 Aug 2015
2 answers
189 views

 When I use this control or the numeric control I can only type 3 digits and 2 are positioned after the decimal, if I keep typing digits it just overwrites the last decimal place.  Initial value is zero, decimal property, version 2015.2.623.45.

<telerik:RadMaskedCurrencyInput Width="100"
                                InputBehavior="Replace"
                                Mask="c9.2"
                                SelectionOnFocus="SelectAll"
                                Value="{Binding TotalAmount}"
                                Culture="en-CA"
                                Grid.Column="5"
                                Grid.Row="1"
                                HorizontalContentAlignment="Right"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Top" />

public decimal TotalAmount
{
    get
    {
        return workDetail.Total;
    }
    set
    {
        if (workDetail.Total != value)
        {
            workDetail.Total = value;
            OnPropertyChanged("TotalAmount");
        }
    }
}
Patrick
Top achievements
Rank 1
 answered on 19 Aug 2015
3 answers
217 views

Hi,

 I'm using the latest version of Telerik and I created a UserControl which contain a RadImageEditorUI. My UserControl contain a property named "Image" of type "Stream" and I would like to know how I can display it in the editor and I would like to know also how I can take the image in the editor and transform it as a stream?

 

Thank's

Alain

Todor
Telerik team
 answered on 19 Aug 2015
4 answers
656 views

Hi, I would like to use RadTreeView to display a flat list, but all items have significant indentation.

I could have used a RadListBox, but since I have the same nodes in a hierarchically TreeView another place in the application, I thought using the same control would be the easiest way to get the same look and functionality (context menu, click etc).

 

My idea was to set the ItemTemplate of the treeview to a normal DataTemplate or a HierarchicalDataTemplate without specifying ItemSource. It works as I want, except that there is an indention of all the items, leaving a lot of space to the left.

I have also tried to set the ExpanderStyle to a style containing a collapse template, but it only seems to affect the indentation of child items.

Philip
Top achievements
Rank 1
 answered on 19 Aug 2015
1 answer
120 views

I would like to find out if there is a good way of applying DTED information on top of the RadMap so that whenever a user clicks on the

Map location the elevation information can be retrieved. Currently it seems to me that the RadMap can read data from shape files only.

Possible to convert DTED to raster base information to be applied on RadMap?

Martin Ivanov
Telerik team
 answered on 18 Aug 2015
2 answers
389 views
Hi, does the RadDocking control use virtualization? And can I disable it? To be more specific, after a user action, I add a new Pane to a PaneGroup and set its Content and DataContext to a new ViewModel. In my App.xaml, I have a DataTemplate so that this ViewModel is shown as a certain UserControl. This works great, except that the UserControl is being reused. I can see that because I'm only entering the constructor once. Subsequent adds of ViewModels won't add new UserControls.

My real situation is a little more complex (an MVVM pattern, and a command I need to execute when each UserControl is loaded), but you can reproduce it with this setup:

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Button Click="ButtonBase_OnClick" Grid.Row="0">Click</Button>
        <telerikDocking:RadDocking Grid.Row="1">
            <telerikDocking:RadDocking.DocumentHost>
                <telerikDocking:RadSplitContainer>
                    <telerikDocking:RadPaneGroup x:Name="TheRadPaneGroup">
                        <telerikDocking:RadPaneGroup.ItemTemplate>
                            <DataTemplate>
                                <telerik:RadPane>
                                    <Style TargetType="telerik:RadPane">
                                        <Setter Property="ContentTemplate">
                                            <Setter.Value>
                                                <DataTemplate>
                                                    <!--<userControlEvents:UserControl1></userControlEvents:UserControl1>-->
                                                    <ContentControl Content="{Binding}"></ContentControl>
                                                </DataTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </telerik:RadPane>
                            </DataTemplate>
                        </telerikDocking:RadPaneGroup.ItemTemplate>
                    </telerikDocking:RadPaneGroup>
                </telerikDocking:RadSplitContainer>
            </telerikDocking:RadDocking.DocumentHost>
        </telerikDocking:RadDocking>
    </Grid>

Putting the UserControl explicitly in the DataTemplate (and no longer relying on the App.xaml) makes no difference. Putting x:Shared="False" on the Style and/or the DataTemplate makes no difference either.

From what I've read on the interent, this has to do with Virtualization. Is there a way to disable this?

I've made a simple project and put it here. You can see a new ViewModel is added every time (because the milliseconds change for every RadPane that is added), but the second piece of text (the current date, with seconds) does not change, so the UserControl is being reused. I want it to create a new UserControl every time.
Peter
Top achievements
Rank 1
 answered on 18 Aug 2015
1 answer
180 views

If this isn't possible, telling me "no" would be fully acceptable but I must ask:

  • Is there a way to​ separate the column order from the drop down order?
  • Is there a way to eliminate the Match Case button and never have it try to match the case?
  • Is there a way to only allow a top level filter?  So, don't have the + button on a lower level.
  • Can I default to "Contains" instead of "Is equal to"?

Thanks for your help,

Joel

Stefan
Telerik team
 answered on 18 Aug 2015
1 answer
182 views

I have thisRadDataPager

 <telerik:RadDataPager x:Name="radDataPager" Grid.Row="1" Source="{Binding ItemCollection}" DockPanel.Dock="Bottom" PageSize="400" DisplayMode="First, Last, Next, Previous, Text" />

 I bind to it in the ItemsSource of a RadGridView:

  <Controls:RadGridView x:Name="_rgvAdSales"
                              SelectedItem="{Binding Selected​Item, Mode=TwoWay}"
                              ItemsSource="{Binding PagedSource, ElementName=radDataPager}"
                              EnableRowVirtualization="False"
                              AutoGenerateColumns="False"
                              SelectionMode="Extended">...​

 

My columns look like this:

       <Controls:GridViewDataColumn Header="Name" DataMemberBinding="{Binding ​Name}" IsReadOnly="True" />

 

Resharper draws a lin​e under Name (the path of the binding in the column) and says this:

    Cannot resolve property 'Name' in data context of type 'Telerik.Windows.Data.IPagedCollectionView'

 

I have tried to add d:DataContext, but I cannot get that to work.

 

 â€‹

If I bind the ItemsSource of RadGridView directly to the ItemCollection on the ViewModel, then resharper does not give any warnings.

Do you know of any good way (ie. not causing performance loss) to tell resharper the datatype of the ItemSource or datacontext of the column?


Thanks,

 

      
​

Ivan Ivanov
Telerik team
 answered on 18 Aug 2015
5 answers
199 views

Hello,

 I'm trying to get the RadContextMenu attached to the RadScheduleView to open at the currently selected slot, appointment or empty field using the Apps key (a.k.a. keyboard rightclick).

 

So far I've tried changing the PlacementTarget ​in the RadContextMenu's OnOpening event, but I can't find a way to get the actual source.

RadContextMenu.elementCausedContextMenuOpen is TimeLineRulerPanel, hence RadContextMenu.GetClickedElement<AppointmentItem>() returns null.

Placing the RadContextMenu at MousePoint is not an alternative as it could be anywhere within the application.

 

So is it event possible to get the current scheduler child control to place the ContextMenu at?

 

Thanks in advance!

Jochen

​

Jochen
Top achievements
Rank 1
 answered on 18 Aug 2015
1 answer
103 views

My ItemsSource is a list of records with a Properties bag, rather than having convenient top-level properties

Attempts to define the relationship like this do not work (see error below). Is there some other mechanism?

      var p = new FieldDescriptorNamePair
      {
        ParentFieldDescriptorName = "Properties[\"OrderId\"].Value",
        ChildFieldDescriptorName  = "Properties[\"ParentOrderId\"].Value"
      };

 

----------------------------------------------------------------------------------

  Object reference not set to an instance of an object.
--- Stack Trace
   at Telerik.Windows.Data.HierarchyFilter`1.<>c__DisplayClass6.<CreateFilterLambda>b__4(TElement r1)
   at Telerik.Windows.Data.HierarchyFilter`1.CompareValues(TElement record)
   at Telerik.Windows.Data.HierarchyFilter`1.<FilteredData>b__8(TElement d)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()

Stefan
Telerik team
 answered on 18 Aug 2015
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?