Hi,
I have a little problem with my scroll on RadGridView. One of my column's cell template is RadTreeView. When mouse is over tree, mouse-wheel move does not take affect on RadGridView scroll. When mouse is over any other cell, mouse-wheel scroll works correct, like always. It looks like RadTreeView inside cell is stealing mouse-wheel event and RadGridView doesn't scroll? Because my cell height is adjusting itself to RadTreeView size, there is no scroll bars inside cell, it is ok, I want scroll only on RadGridView.
Thanks for any help!
As the title says, when I bind an ImageColumn to a URL which points to a an image on the web, I get an exception in the event of the image not being available (for example if the server is down). Is there any way to prevent this?
Value cannot be null.
Parameter name: uriSource
at System.Windows.Media.Imaging.BitmapImage..ctor(Uri uriSource, RequestCachePolicy uriCachePolicy)
at Telerik.Windows.Controls.GridViewImageColumn.Image_ImageFailed(Object sender, ExceptionRoutedEventArgs e)
Hello!
There are the following types of data:
namespace
TelerikHierarchyChildTemplate.Model
{
public
class
WatchList
{
public
int
WatchListId {
get
;
set
; }
public
string
Moniker {
get
;
set
; }
public
ICollection<ContentWatchList> Content {
get
;
set
; }
}
public
class
ContentWatchList
{
public
int
ContentWatchListId {
get
;
set
; }
public
WatchList ParentWatchList {
get
;
set
; }
public
Item ItemItem {
get
;
set
; }
}
public
class
Item
{
public
int
ItemId {
get
;
set
; }
public
string
Moniker {
get
;
set
; }
public
string
Note {
get
;
set
; }
public
ICollection<ContentWatchList> ContentsWatchLists {
get
;
set
; }
}
}
There is a model (MainViewModel) that in the creation fills the collection. To be filled in correctly :)
using
System;
using
System.Collections.Generic;
using
System.Collections.ObjectModel;
using
System.Linq;
using
Telerik.Windows.Controls;
using
TelerikHierarchyChildTemplate.Model;
namespace
TelerikHierarchyChildTemplate
{
public
class
MainViewModel : ViewModelBase
{
private
ObservableCollection<WatchList> _watchListsCollection;
private
ObservableCollection<ContentWatchList> _contentWatchListCollection;
private
ObservableCollection<Item> _itemsCollection;
public
ObservableCollection<WatchList> WatchListsCollection
{
get
{
return
_watchListsCollection; }
set
{
_watchListsCollection = value;
OnPropertyChanged(()=> WatchListsCollection);
}
}
public
ObservableCollection<ContentWatchList> ContentWatchListCollection
{
get
{
return
_contentWatchListCollection; }
set
{
_contentWatchListCollection = value;
OnPropertyChanged(()=>ContentWatchListCollection);
}
}
public
ObservableCollection<Item> ItemsCollection
{
get
{
return
_itemsCollection; }
set
{
_itemsCollection = value;
OnPropertyChanged(()=> ItemsCollection);
}
}
public
MainViewModel()
{
WatchListsCollection =
new
ObservableCollection<WatchList>
{
new
WatchList()
{
WatchListId = 0,
Moniker =
"List One"
,
Content =
new
List<ContentWatchList>()
},
new
WatchList()
{
WatchListId = 1,
Moniker =
"List Two"
,
Content =
new
List<ContentWatchList>()
},
new
WatchList()
{
WatchListId = 2,
Moniker =
"List Three"
,
Content =
new
List<ContentWatchList>()
}
};
ItemsCollection =
new
ObservableCollection<Item>
{
new
Item()
{
ItemId = 0,
Moniker =
"Item One"
,
Note =
"Note One"
,
ContentsWatchLists =
new
List<ContentWatchList>()
},
new
Item()
{
ItemId = 1,
Moniker =
"Item Two"
,
Note =
"Note Two"
,
ContentsWatchLists =
new
List<ContentWatchList>()
},
new
Item()
{
ItemId = 2,
Moniker =
"Item Three"
,
Note =
"Note Tree"
,
ContentsWatchLists =
new
List<ContentWatchList>()
},
new
Item()
{
ItemId = 3,
Moniker =
"Item Four"
,
Note =
"Note Four"
,
ContentsWatchLists =
new
List<ContentWatchList>()
}
};
ContentWatchListCollection =
new
ObservableCollection<ContentWatchList>
{
new
ContentWatchList()
{
ContentWatchListId = 0,
ParentWatchList = WatchListsCollection.First(p=>p.WatchListId==0),
ItemItem = ItemsCollection.First(p=>p.ItemId==0)
},
new
ContentWatchList()
{
ContentWatchListId = 1,
ParentWatchList = WatchListsCollection.First(p=>p.WatchListId==0),
ItemItem = ItemsCollection.First(p=>p.ItemId==1)
},
new
ContentWatchList()
{
ContentWatchListId = 2,
ParentWatchList = WatchListsCollection.First(p=>p.WatchListId==0),
ItemItem = ItemsCollection.First(p=>p.ItemId==2)
},
new
ContentWatchList()
{
ContentWatchListId = 3,
ParentWatchList = WatchListsCollection.First(p=>p.WatchListId==1),
ItemItem = ItemsCollection.First(p=>p.ItemId==3)
},
new
ContentWatchList()
{
ContentWatchListId = 4,
ParentWatchList = WatchListsCollection.First(p=>p.WatchListId==1),
ItemItem = ItemsCollection.First(p=>p.ItemId==2)
},
new
ContentWatchList()
{
ContentWatchListId = 5,
ParentWatchList = WatchListsCollection.First(p=>p.WatchListId==1),
ItemItem = ItemsCollection.First(p=>p.ItemId==1)
}
};
foreach
(var item
in
ItemsCollection)
{
foreach
(var content
in
ContentWatchListCollection)
{
if
(item.ItemId == content.ItemItem.ItemId) item.ContentsWatchLists.Add(content);
}
}
foreach
(var wachlist
in
WatchListsCollection)
{
foreach
(var content
in
ContentWatchListCollection)
{
if
(wachlist.WatchListId == content.ParentWatchList.WatchListId) wachlist.Content.Add(content);
}
}
}
}
}
There is a view:
<
Window
x:Class
=
"TelerikHierarchyChildTemplate.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
Grid
Grid.Row
=
"0"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
telerik:RadGridView
Grid.Column
=
"0"
ItemsSource
=
"{Binding WatchListsCollection}"
></
telerik:RadGridView
>
<
telerik:RadGridView
Grid.Column
=
"1"
ItemsSource
=
"{Binding ContentWatchListCollection}"
></
telerik:RadGridView
>
<
telerik:RadGridView
Grid.Column
=
"2"
ItemsSource
=
"{Binding ItemsCollection}"
></
telerik:RadGridView
>
</
Grid
>
<
Grid
Grid.Row
=
"1"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
telerik:RadGridView
ItemsSource
=
"{Binding WatchListsCollection}"
>
<
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:GridViewTableDefinition
>
<
telerik:GridViewTableDefinition.Relation
>
<
telerik:PropertyRelation
ParentPropertyName
=
"Content"
/>
</
telerik:GridViewTableDefinition.Relation
>
</
telerik:GridViewTableDefinition
>
</
telerik:RadGridView.ChildTableDefinitions
>
</
telerik:RadGridView
>
<
telerik:RadGridView
Grid.Column
=
"1"
ItemsSource
=
"{Binding WatchListsCollection}"
>
<
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:GridViewTableDefinition
/>
</
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
telerik:RadGridView
x:Name
=
"RadGridView1"
GroupRenderMode
=
"Flat"
DataContext
=
"{Binding}"
BorderThickness
=
"0,1,0,1"
GridLinesVisibility
=
"None"
CanUserFreezeColumns
=
"False"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding ContentWatchListCollection}"
ShowGroupPanel
=
"False"
IsReadOnly
=
"True"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ItemItem.Moniker}"
Header
=
"Moniker"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ItemItem.Note}"
Header
=
"Note"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
DataTemplate
>
</
telerik:RadGridView.HierarchyChildTemplate
>
</
telerik:RadGridView
>
</
Grid
>
</
Grid
>
</
Window
>
Results of work on the attached image.
A hierarchical structure is displayed when using GridViewTableDefinition.Relation, and when using HierarchyChildTemplate, there is no.
I ask you to inform me that it is necessary to correct that the nested data began to be displayed at usage HierarchyChildTemplate
I have created a simple project to test RadDocking. My Xaml is pretty basic(exactly what's given in the examplehttp://docs.telerik.com/devtools/wpf/controls/raddocking/features/panes/docked-floating-panes). But I cannot see the controls in the designer and also when I execute the code nothing appears on the window.
<Window x:Class="DockTest.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:DockTest"xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"mc:Ignorable="d"Title="MainWindow" Height="350" Width="525"><Grid><telerik:RadDocking x:Name="radDocking"><telerik:RadSplitContainer x:Name="radSplitContainer" InitialPosition="DockedRight"><telerik:RadPaneGroup x:Name="radPaneGroup"><telerik:RadPane x:Name="radPane" Header="Docked Pane"><TextBlock Text="Docked Pane."></TextBlock></telerik:RadPane></telerik:RadPaneGroup></telerik:RadSplitContainer></telerik:RadDocking></Grid>
I have included all the required dlls:
Telerik.Windows.Controls
Telerik.Windows.Controls.Navigation
Telerik.Windows.Controls.Docking
Telerik.Windows.Data
I get no error on design or runtime. The version of my Dlls is "2016.1.216.45". My project is running with .Net Framework 4.6.
Hello,
I'm working on a custom template of the RadGridView and I styled the SearchPanel to be only a text box part of a user control. The instant search/filtering works correctly, however, it seems that the highlighting doesn't.
While going through the source code, I saw that each column keeps a reference to the SearchPanel, in my case, it seems that this reference is null so the highlighting is not processed.
I simply declare the search panel in my user control and declare the user control as part of my template for RadGridView
<
grid:GridViewSearchPanel
Grid.Column
=
"1"
Style
=
"{StaticResource GridViewSearchPanelStyle}"
/>
With a style:
<
Style
x:Key
=
"GridViewSearchPanelStyle"
TargetType
=
"grid:GridViewSearchPanel"
>
<
Setter
Property
=
"Margin"
Value
=
"5 0 0 1"
/>
<
Setter
Property
=
"MaxHeight"
Value
=
"28"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"1"
/>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Stretch"
/>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Stretch"
/>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource GridView_SearchPanelBackground}"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"{StaticResource GridView_SearchPanelOuterBorder}"
/>
<
Setter
Property
=
"SnapsToDevicePixels"
Value
=
"True"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
x:Name
=
"CustomSearch"
TargetType
=
"telerik:GridViewSearchPanel"
>
<
Grid
UseLayoutRounding
=
"True"
>
<
TextBox
x:Name
=
"PART_SearchAsYouTypeTextBox"
Text
=
"{Binding SearchText, Mode=TwoWay, Delay=100, UpdateSourceTrigger=PropertyChanged}"
MinWidth
=
"160"
MaxWidth
=
"200"
MaxHeight
=
"25"
Margin
=
"0 0 0 1"
VerticalContentAlignment
=
"Center"
telerik:TextBoxBehavior.UpdateTextOnEnter
=
"True"
>
<
TextBox.IsTabStop
>
<
Binding
RelativeSource
=
"{RelativeSource TemplatedParent}"
Path
=
"IsTabStop"
/>
</
TextBox.IsTabStop
>
</
TextBox
>
<
telerik:RadButton
x:Name
=
"ClearButton"
IsTabStop
=
"False"
Style
=
"{StaticResource ClearSearchValueButtonStyle}"
Command
=
"searchPanel:GridViewSearchPanelCommands.ClearSearchValue"
/>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
So nothing fancy and for the most part this code is from Telerik's xaml files.
Am I missing something? Do I need to bind something somewhere in order for the highlighting feature to work?
Thank you in advance,
Bastian
I can change the GanttTask item's background color by set its background property. but when I set the task to milestone. it didn't work. it shows original theming color.
How to change the Milestone background color?
Thanks,
-Jacky
Hello everyone.
Currently I'm developing an application for my parents busines and I came to a problem which I can not solve.I am trying to show in the RadCombobox a description (External, Internal) depending on the value I get from SQL (1 or 2). I've try different solutions but I don't know if I am doing something wrong because I am not able to show it.
I have a RadTreeView with an underlying Collection. When I add a new item to that collection I want to set that node into edit mode so the user can immediately enter a name for that node.
After modifying the collection and calling Refresh() on it I call BeginEdit() on the newly created RadTreeViewItem. The item is not set into edit mode though. When I call BeginEdit() on another node, that node is set into edit mode. It seems to be only the newly created item which does not enter the desired state.