While using RadGridView with VirtualQueryableCollectionView and moving CurrentPosition with any of MoveCurrent* methods, I have found, that CurrentItem is not loaded when CurrentPosition changes to an index of not yet loaded item (in my case LoadSize is 50 and items are loaded from our WCF service) and thus CurrentItem is null.
The problem is in QueryableCollectionView.InternalGetItemAt where
return
this
.InternalList[index];
ignores items loading.
My fix for now is:
public
class
VirtualQueryableCollectionView<T> :
Telerik.Windows.Data.VirtualQueryableCollectionView<T>
{
protected
override
void
OnCurrentChanged(EventArgs args)
{
// fix not loaded CurrentItem is not loaded when CurrentPosition changes
if
(
!IsCurrentBeforeFirst &&
!IsCurrentAfterLast &&
CurrentItem ==
null
)
{
SetCurrent(GetItemAt(CurrentPosition), CurrentPosition);
}
base
.OnCurrentChanged(args);
}
}
It has a drawback that OnCurrentChanged is called twice when this fix is effective.
Hello,
I'm currently applying the office2013 theme to a project and I'm having some strange/unexpected issues. I have copied the Telerik.Windows.Themes.Office2013.dll file to a project folder.
Here is the relevant code of the App.xaml file:
<
ResourceDictionary
>
<
ResourceDictionary.MergedDictionaries
>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Input.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.GridView.xaml"
/>
<
ResourceDictionary
>
<
Style
TargetType
=
"telerik:RadComboBox"
BasedOn
=
"{StaticResource RadComboBoxStyle}"
>
<
Setter
Property
=
"MinHeight"
Value
=
"0"
/>
</
Style
>
<
Style
TargetType
=
"TextBox"
BasedOn
=
"{StaticResource TextBoxStyle}"
>
<
Setter
Property
=
"MinHeight"
Value
=
"0"
/>
<
Setter
Property
=
"Padding"
Value
=
"2"
/>
</
Style
>
<
Style
TargetType
=
"telerik:GridViewHeaderCell"
BasedOn
=
"{StaticResource GridViewHeaderCellStyle}"
>
<
Setter
Property
=
"Margin"
Value
=
"0"
/>
<
Setter
Property
=
"Padding"
Value
=
"6,0,0,0"
/>
<
Setter
Property
=
"FontSize"
Value
=
"13"
/>
</
Style
>
<
Style
TargetType
=
"telerik:RadButton"
BasedOn
=
"{StaticResource RadButtonStyle}"
>
<
Setter
Property
=
"MinHeight"
Value
=
"0"
/>
</
Style
>
<
Style
TargetType
=
"telerik:RadNumericUpDown"
BasedOn
=
"{StaticResource RadNumericUpDownStyle}"
>
<
Setter
Property
=
"MinHeight"
Value
=
"0"
/>
</
Style
>
<
Style
TargetType
=
"Label"
>
<
Setter
Property
=
"MinHeight"
Value
=
"0"
/>
</
Style
>
</
ResourceDictionary
>
</
ResourceDictionary.MergedDictionaries
>
</
ResourceDictionary
>
Greetings
Raul
<
telerik:RadMaskedTextInput
Grid.Row
=
"0"
x:Name
=
"firstInput"
Grid.Column
=
"1"
Margin
=
"10 5 10 5"
HorizontalAlignment
=
"Stretch"
TextMode
=
"PlainText"
Mask
=
"###.###.###.###"
Value
=
"{Binding IpValue, Mode=OneWay, ValidatesOnExceptions=True, Converter={StaticResource converter}}"
Text
=
"{Binding IpText, Mode=OneWayToSource, ValidatesOnExceptions=True, UpdateSourceTrigger=LostFocus}"
/>
Note that there are two values to be bound to. Sorry for my stupidity and i can't come up a way to do that according to the way stated in that article.
Jingfei
Hi team,
We know that we need to leverage the UI Virtualization of RadGridView to improve its performance. But sometimes I still suffer some big latency, so I would want to know which part of is to be blamed. One of ways i know is shown below.
private
Stopwatch _watch;
private
ILog _log;
public
HistoryData()
{
InitializeComponent();
this
._log = LogManager.GetLogger(
typeof
(App));
_watch = Stopwatch.StartNew();
this
.HistoryDataGridView.Filtering +=
this
.ResetTime;
this
.ResetTimeAndSubscribeToLayoutUpdated();
}
private
void
ResetTime(
object
sender, GridViewFilteringEventArgs e)
{
ResetTimeAndSubscribeToLayoutUpdated();
}
private
void
ResetTimeAndSubscribeToLayoutUpdated()
{
this
.HistoryDataGridView.LayoutUpdated +=
this
.HistoryDataGridView_LayoutUpdated;
this
._watch.Restart();
}
private
void
HistoryDataGridView_LayoutUpdated(
object
sender, EventArgs e)
{
this
.HistoryDataGridView.LayoutUpdated -=
this
.HistoryDataGridView_LayoutUpdated;
_log.Info(
string
.Format(
"GridView operations take {0} ms"
,
this
._watch.ElapsedMilliseconds));
}
The elapsed milliseconds logged here is usually no more than 3000, but sometimes, I feel like it's taking 6~9 seconds to display the final GridView. So i want to know deeper insights of where and when the GridView spend time on
Thanks,
-J
Hi,
i have sortabletelrik grid with 10 columns.By default telerik provides sorting option.
i need to customize the sorting facility,i mean ,say i have these two columns with colums1 and columns2. when i click on column header column1,it should not sort.This can be done by setting isortable=false in XAML.But my problem is,wen i click on column2 for sorting,it takes up the first column data for sorting which should not happen. The data of column1 should be freezed wen ever i click on sort on any column header of the grid,it has to exclude coulmn1 and den sort.
Please see the required output in the example.
Ex before sort
column1 column2
A1 Oligo 1
C1 Oligo 2
F1 Oligo 3
A2 Oligo 4
B2 Oligo 5
After sort
column1 column2
A1 Oligo 5
C1 Oligo 4
F1 Oligo 3
A2 Oligo 2
B2 Oligo 1
and one more condition is, this freezing should only happen wen sorting is clicked,not by default. Please reply ASAP.
Hi Team,
I am new to the Telerik WPF Controls, My requirement is to create a custom header. Which contains 2 header rows one is the default header row and other one is a dropdown header row. Which is the units row of first row columns, all the details we will get it dynamically and also some times the 2nd row exist and some times it does not based on the condition. Can you please provide a sample it.
Hi,
I posted a sample project here to illustrate issue.
I use a prism project to navigate between view (I don't think that issue is related to prism and think can be reproduce with tabcontrol for sample). I have one page with one RadGridView and one fake page. In the attached project if you navigate to the gridview page, expand some row and return to the fake page so when you go back to the grid all rows are collapsed and expanded state was not preserved.
After investigation it's appear that if I set the DataContext of ViewGrid control in its constructor all works like desire, rows expanded are preserve. For sample replacing ctor "public ViewGrid() { InitializeComponent(); }" by "public ViewGrid(Model m) { InitializeComponent(); this.DataContext = m; }" works fine.
Unfortunatly I can not do that and viewmodel is created in the MainWindow.
How can I preserve the rowdetail state ?
Thanks
Luc
hi
in my application (application is developed using WPF c#) data is loading asynchronously to the radgridview when user clicks on refresh button. i used telerik DelegateCommand to handle the button event. and i just want to cancel the request before data is load to the grid. my UI is look like as follows (attached the screen shot.)
thank you.
Hi,
I am trying to extend the PropertyGridColumnResizer and restrict the dragging of column resizer to a minimum value.
Now i dont see anyway to unregister the dragevent registered for thumb control.
Can you please let me know is there a way to do it.
Thanks.
Hi,
I have RadGridView with defined RowDetailsTemplate as below:
<
telerik:RadGridView.RowDetailsTemplate
>
<
DataTemplate
>
<
telerik:RadTabControl
>
<
telerik:RadTabItem
Header
=
"Tab1"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"100"
/>
<
RowDefinition
Height
=
"50"
/>
</
Grid.RowDefinitions
>
<
TextBlock
Grid.Row
=
"0"
Text
=
"TestVar1"
/>
<
TextBlock
Grid.Row
=
"1"
Text
=
"TestVar2"
/>
</
Grid
>
</
telerik:RadTabItem
>
</
telerik:RadTabControl
>
</
DataTemplate
>
</
telerik:RadGridView.RowDetailsTemplate
>
When I expand row details, scroll down until details are not visibile and then go back to see again row details - a scrollbar jumps in strange way just before details shows. You can easy reproduce this behavior because there is no binding or anything. I found that when i comments out RadTabControl from details template as below:
<
telerik:RadGridView.RowDetailsTemplate
>
<
DataTemplate
>
<!--<
telerik:RadTabControl
>
<
telerik:RadTabItem
Header
=
"Tab1"
>-->
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"100"
/>
<
RowDefinition
Height
=
"50"
/>
</
Grid.RowDefinitions
>
<
TextBlock
Grid.Row
=
"0"
Text
=
"TestVar1"
/>
<
TextBlock
Grid.Row
=
"1"
Text
=
"TestVar2"
/>
</
Grid
>
<!--</
telerik:RadTabItem
>
</
telerik:RadTabControl
>-->
</
DataTemplate
>
</
telerik:RadGridView.RowDetailsTemplate
>
there is no problem with jumping scroll. Can you help me guys?
Thanks