Telerik Forums
UI for WPF Forum
2 answers
165 views
Hello,

I've searched for a while but didn't find anything useful about it.

I've a dataset, filled with an SQL query which contains a table of many records, and a gridView with a comboboxcolumn. I try to bind my comboboxcolumn with my dataset, but it only displays the first row, in my whole column. For example, if I have 400 records, it displays 400 times the first record.

Here's my code in my .xaml :

<telerik:RadGridView HorizontalAlignment="Left"
                             VerticalAlignment="Top"
                             ItemsSource="{Binding dataSetCameras}"

etc, and :

<telerik:GridViewComboBoxColumn Header="Cameras"
                                                UniqueName="Camera"
                                                DataMemberBinding="{Binding reference}"
                                                DisplayMemberPath="Camera"
                                                SelectedValueMemberPath="Camera"
                                                HeaderTextAlignment="Center"
                                                EditTriggers="CellClick"
                                                Width="*">
                    <telerik:GridViewComboBoxColumn.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <TextBlock Grid.ColumnSpan="2" Text="{Binding reference}" />
                                <StackPanel Grid.Row="1" Orientation="Horizontal">
                                    <TextBlock Foreground="#FF356EA6" Text="{Binding sold}" />
                                    <TextBlock Text=", " />
                                    <TextBlock Foreground="#FF356EA6" Grid.Column="1" Text="{Binding broken}" />
                                    <TextBlock Text=", " />
                                    <TextBlock Foreground="#FF356EA6" Grid.Column="2" Text="{Binding stolen}" />
                                </StackPanel>
                            </Grid>
                        </DataTemplate>
                    </telerik:GridViewComboBoxColumn.ItemTemplate>

And in my .cs :

((GridViewComboBoxColumn)this.gridViewCameras.Columns["Camera"]).ItemsSource = datas.dataSetCameras.Tables;

Did I miss something ? And yes, I'm sure that my dataset is filled with the right values.

Thanks for your help !
Christophe
Top achievements
Rank 1
 answered on 12 Jun 2014
2 answers
89 views
Hi Team,

We are trying to automate actions on ListItems present in filter properties window of Rad Grid View with VS2012 Coded UI Test Framework but we arenot successfull in it.
Name property on the listitems is used for its idetification but this name seems to be same for all the list items present in the list(i.e. "Telerik.Windows.Controls.GridView.DistinctValueViewModel").

Can you please implement ToString on the listitems to consider CheckBox name[which is present inside the listitem] ?

Regards,
Bhagavan
Bhagavan
Top achievements
Rank 1
 answered on 12 Jun 2014
6 answers
834 views
I've run into an issue where GridView will freeze when trying to auto-adjust column widths to the available window if a group is applied. I have a series of columns, most of which are Width="Auto", but one of which is Width="*". If I resize the window to allow the * column to expand, then try to reduce the width while a grouping is applied, the horizontal scroll bar flashes and the application freezes. Sometimes it comes back, sometimes it doesn't. Sometimes switching to another window and back seems to help, sometimes it doesn't.

Pausing the debugger while this is occurring (which is only possible some of the time; sometimes Visual Studio is frozen as well) tries to open the file:

c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ScrollViewer\GridViewScrollViewer.cs

The call stack is:
[External Code]
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(System.Windows.Size availableSize) Line 202 + 0x25 bytes    C#
[External Code]

The problem does not occur if the * column is switched to Auto, or if the Grouping is not applied. It also doesn't seem to happen if no vertical scrolling is necessary.

I am using 2013_3_1209, but have verified the problem still occurs with 2014_1_0224. Below is a simple application which exhibits the problem when you try to reduce the width of the window.

Is there any known way to work around this issue using other settings while achieving the same effect?

<Window x:Class="Scroll.MainWindow"
        Title="MainWindow" Height="350" Width="500">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <telerik:RadGridView ItemsSource="{Binding Path=Items}" AutoGenerateColumns="False" AutoExpandGroups="True"
                                 VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <telerik:RadGridView.GroupDescriptors>
                <telerik:GroupDescriptor Member="Group" />
            </telerik:RadGridView.GroupDescriptors>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Path=Name}" Width="Auto" />
                <telerik:GridViewDataColumn Header="Number" DataMemberBinding="{Binding Path=Number}" Width="*" />
                <telerik:GridViewDataColumn Header="Group" DataMemberBinding="{Binding Path=Group}" Width="Auto" />
                <telerik:GridViewDataColumn Header="Text" DataMemberBinding="{Binding Path=Text}" Width="Auto" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

using System.Collections.ObjectModel;
using System.Windows;
 
namespace Scroll
{
    public class Item
    {
        public string Name { get; set; }
        public int Number { get; set; }
        public string Group { get; set; }
        public string Text { get; set; }
    }
 
    public partial class MainWindow : Window
    {
        public ObservableCollection<Item> Items { get; set; }
 
        public MainWindow()
        {
            InitializeComponent();
            Items = new ObservableCollection<Item>();
            for (int i = 0; i < 25; i++)
                Items.Add(new Item()
                {
                    Name = "Object " + i,
                    Number = i,
                    Group = (i % 2 == 1 ? "Odd" : "Even"),
                    Text = "this is just some long text to make the window have to resize some things."
                });
            DataContext = this;
        }
    }
}
Louis
Top achievements
Rank 1
 answered on 11 Jun 2014
5 answers
302 views
Hellow, i have RadTileView controll, which property itemsource bind to my observable collection CommonAssets.My collection has several elements, when I start to delete all items except one, RenderSize in the control does not change as long as I do not re-add a new element to the collection. 
Help me please.


 <UserControl.Resources>

        <DataTemplate x:Key="MeasureItem" >
            <Grid Background="{StaticResource MainWindowBorderBrush}" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="40"/>
                    <ColumnDefinition Width="200"/>
                    <ColumnDefinition Width="240"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <CheckBox Grid.Column="0" Grid.RowSpan="6" VerticalAlignment="Center" Background="{StaticResource LightGrayBrush}" Cursor="Hand" IsChecked="{Binding Selected,Mode=TwoWay}"/>
                <TextBlock Grid.Row="0" Grid.Column="1" Text="Название" Style="{StaticResource White18TextStyle}" />
                <Label Grid.Row="0" Grid.Column="2" Content="{Binding Name}" Style="{StaticResource EditableLabelStyle}" FontSize="16" MinWidth="50" 
                       Foreground="{StaticResource LightGrayBrush}" Margin="0,-5,0,0" />
                <TextBlock Grid.Row="1" Grid.Column="1" Text="Итоговая доза" Style="{StaticResource White18TextStyle}" Margin="0,20,0,0"/>
                <telerik:RadComboBox Grid.Row="1" Grid.Column="2"  Style="{DynamicResource TransparentComboboxStyle}" ItemsSource="{Binding FinalDoseAssetNames}" Margin="0,20,0,0"
                                     SelectedValue="{Binding SelectFinalDozeAssetName}" />
                <TextBlock Grid.Row="2" Grid.Column="1" Style="{StaticResource White18TextStyle}" Text="Значения для уровней" Margin="0,20,0,0"/>
                <PM:DataRangeSliderCtrl  Grid.Row="3" Grid.Column="1" Margin="0,20,0,20" />
                <PM:KnobSliderCtrl x:Name="KnobSlider" Grid.Row="2" Grid.RowSpan="2"  Grid.Column="2" Margin="0,50,0,0" DataContext="{Binding KnobSliderDataContext}" Opacity="0.5"
                                   vM:BaseViewModel.StatusTips="Выберите единицы измерения для радиационного фона"/>
            </Grid>
            <DataTemplate.Triggers>
                <EventTrigger RoutedEvent="MouseEnter">
                    <EventTrigger.Actions>
                        <BeginStoryboard Storyboard="{StaticResource ActivateKnobSlider}" />
                    </EventTrigger.Actions>
                </EventTrigger>
                <EventTrigger RoutedEvent="MouseLeave">
                    <EventTrigger.Actions>
                        <BeginStoryboard Storyboard="{StaticResource DiactivateKnobSlider}"/>
                    </EventTrigger.Actions>
                </EventTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
    </UserControl.Resources>
    <Grid Margin="-6,-30,0,0" >
        <Grid.RowDefinitions>
            <RowDefinition Height="35"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <toolbars:EditPanel  Grid.Row="0" DataContext="{Binding EditPanel}" HorizontalAlignment="Center" VerticalAlignment="Bottom" VerticalContentAlignment="Bottom" Foreground="{StaticResource MainWindowBorderBrush}"/>
        <telerik:RadTileView x:Name="TileView" Grid.Row="1" ItemsSource="{Binding CommonAssets}" Style="{StaticResource HiddenTitleGrayStyle}" BorderBrush="Transparent" 
                             MinimizedColumnWidth="480" MinimizedRowHeight="325" RowHeight="325" MaxWidth="1500" ColumnsCount="3" MaximizeMode="Zero"
                             ContentTemplate="{StaticResource MeasureItem}" HeaderStyle="{StaticResource GrayTileViewItemStarStyle}" ItemContainerStyle="{StaticResource ReordableItemStyle}"
                             PreviewTilePositionChanged="{bindExtension:EventBinding PreviewTilePositionChanged}" >
            <telerik:RadTileView.Resources>
                <DataTemplate DataType="{x:Type pMe:ProtectiveMeasuresAssetVM}"/>
            </telerik:RadTileView.Resources>
            <i:Interaction.Behaviors>
                <behaviors:RadTilesDragDropBehavior/>
            </i:Interaction.Behaviors>
        </telerik:RadTileView>
    </Grid>
Martin Ivanov
Telerik team
 answered on 11 Jun 2014
5 answers
105 views
I'm trying to change the series color in both PolarSeries and CartesianSeries charts (in C#)... in neither can I find the Appearance, Definition, Stroke or Fill properties mentioned in the documention, any clues how to achieve this?

Tia,

Jonathan.
Petar Marchev
Telerik team
 answered on 11 Jun 2014
1 answer
214 views
Can someone explain how to bind to the SelectedDates property to my view model?

It is not exposed in the XAML designer, why is that?
Kalin
Telerik team
 answered on 11 Jun 2014
7 answers
509 views

Hello,

I am using a RadRichTextBox as HTML editor (I use HtmlDataProvider for that)

In my xaml View, i got :  

                                     - A RadRichTextBoxRibbonUI (with only 6 RadRibbonGroup useful for HTML) and its QuickAccessToolBar
                                     - An HTMLDataProvider and its settings
                                     - A RadRichTextBox 

In my Controller the first call of InitializeComponent();  takes about 8 seconds to load the page (it is rather long)

It's only the first call (after that this is cached). I think, it's not possible to construct all of this under 3 seconds.

So I decided to implement a loader for my users. 

But due to WPF limitations (MTA thread, ...) it's pretty tough to do that. Have you an example of loader? An other solution?

An other issue is on old computers : it takes a long time when typing on keyboard in the RadRichTextBox (I already disable some features to improve that)
Have you a list of all the things which can slow the RadRichTextBox typing?


Features : 

1) How to draw a line (<hr>) in an HTML Editor ? I didn't found any buttons in the Ribbon to do that 

2) How to open an HTML document with relative path image? Images are considered as bad images


Regards,

 





Mihail
Telerik team
 answered on 11 Jun 2014
3 answers
261 views
I added a 2nd TextBlock to DataTemplate for my RadLegeng on my RadCartesianChart:

<telerik:RadLegend.ItemTemplate>
    <DataTemplate>
        <Border BorderThickness="0" BorderBrush="Transparent" Margin="10,2,5,0" Padding="0,4,0,0" >
            <Grid>
                <TextBlock Text="{Binding Percent}" Foreground="White" Margin="0,0,0,0" FontSize="13" FontWeight="Normal" Width="35" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <TextBlock Text="{Binding Title}" Foreground="White" Margin="18,0,0,0" FontSize="13" FontWeight="Normal" HorizontalAlignment="Left" VerticalAlignment="Center" />
                <Path Width="auto" Height="auto" Stroke="White" StrokeThickness="1" Fill="{Binding MarkerFill}" HorizontalAlignment="Left" VerticalAlignment="Center">
                    <Path.Data>
                        <Binding Path="ActualMarkerGeometry" RelativeSource="{RelativeSource AncestorType=telerik:LegendItemControl}" />
                    </Path.Data>
                </Path>
            </Grid>
        </Border>
    </DataTemplate>
</telerik:RadLegend.ItemTemplate>
 
I would like to add custom attribute to bind (Percent) to said 2nd TextBlock through binding and with named declaration of LegendItems:

<telerik:RadLegend.Items>
    <telerik:LegendItemCollection>
        <telerik:LegendItem MarkerFill="#FFF0F8FF" MarkerStroke="White" Title="< 5" x:Name="rl_0to5s" />
        <telerik:LegendItem MarkerFill="#FF00B000" MarkerStroke="White" Title="6 - 10" x:Name="rl_6to10s" />
        <telerik:LegendItem MarkerFill="#FFFFFF00" MarkerStroke="White" Title="11 - 20" x:Name="rl_11to20s" />
        <telerik:LegendItem MarkerFill="#FFFFA83E" MarkerStroke="White" Title="21 - 30" x:Name="rl_21to30s" />
        <telerik:LegendItem MarkerFill="#FFFF2020" MarkerStroke="White" Title="31 >" x:Name="rl_31s" />
    </telerik:LegendItemCollection>
</telerik:RadLegend.Items>

Through searching, I wasn't sure how/if I can add on a new attribute to the LegendItem schema for the custom binding.

What am I missing? Any help or direction would be appreciated.
Petar Marchev
Telerik team
 answered on 11 Jun 2014
3 answers
359 views
DataConext binding for my RadContextMenu is being ignored. My menu is defined like this:

<UserControl.Resources>
    <telerik:RadContextMenu x:Key="LimbContextMenu" DataContext="{Binding SelectedLimb}" >
        <telerik:RadMenuItem Header="Expand" Command="{Binding ExpandItemCommand}" />
        <telerik:RadMenuItem Header="Expand to book" Command="{Binding ExpandToBookCommand}" />
        <telerik:RadMenuItem Header="Collapse" Command="{Binding CollapseItemCommand}" />
        <telerik:RadMenuItem Header="Collapse all" Command="{Binding CollapseAllCommand}" />
        <telerik:RadMenuItem Header="Jump to home" Command="{Binding JumpToHomeCommand}"
                             Visibility="{Binding JumpToHomeCommand.IsSupported, Converter={StaticResource BooleanToVisibilityConverter}}"/>
    </telerik:RadContextMenu>
</UserControl.Resources>


It works if I define it like this:
<UserControl.Resources>
    <telerik:RadContextMenu x:Key="LimbContextMenu"   >
      <telerik:RadContextMenu DataContext="{Binding SelectedLimb}">
        <telerik:RadMenuItem Header="Expand" Command="{Binding ExpandItemCommand}" />
        <telerik:RadMenuItem Header="Expand to book" Command="{Binding ExpandToBookCommand}" />
        <telerik:RadMenuItem Header="Collapse" Command="{Binding CollapseItemCommand}" />
        <telerik:RadMenuItem Header="Collapse all" Command="{Binding CollapseAllCommand}" />
        <telerik:RadMenuItem Header="Jump to home" Command="{Binding JumpToHomeCommand}"
                             Visibility="{Binding JumpToHomeCommand.IsSupported, Converter={StaticResource BooleanToVisibilityConverter}}"/>
      </telerik:RadContextMenu>
    </telerik:RadContextMenu>
</UserControl.Resources>

But this version displays a menu within a menu.

How can I get DataConext assigned on the outer menu?
Mahdi
Top achievements
Rank 1
 answered on 11 Jun 2014
5 answers
540 views
Hi,

how to edit the content or text in radlistiem at runtime?

Thanks.....
Vladi
Telerik team
 answered on 11 Jun 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
PersistenceFramework
DataPager
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
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
SplashScreen
Rating
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?