Telerik Forums
UI for WPF Forum
3 answers
134 views

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.

jura
Top achievements
Rank 1
 answered on 24 Aug 2015
3 answers
187 views

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>

 

  1. I wanted to reduce the font sizes because they are too large for my taste. It was no problem to set new sizes for the fonts, but the controls have a MinHeight value that prevents that the control adapts to the new size so that there is no space gain. Therefore I have defined in the ResourceDictionary that all relevant controls should have a MinHeight of 0. Why do the controls have such a large default MinHeight?
  2. As soon as I add "component/Themes/Telerik.Windows.Controls.Docking.xaml" I will get an exception. I don't know if I need it, but most examples I have seen are also using that line. They are also using the RibbonView.xaml line, which also causes an exception on my program.
  3. The style definition for Label throws an exception if I use: BasedOn="{StaticResource LabelStyle}". Is this normal? Didn't expect it because I don't have any issues with the TextBox style definition.
  4. The most strange issue I'm having comes from the filter popup window of the RadGridView (see attached image). As you can see the window sometimes does not close automatically. And one of the popup windows uses the wrong ComboBox. It's always on the same column but it is ok as soon as I remove the RadComboBox style definition from above. 
  5. How can I change the Filter-Symbol color from the column header when filtering is active. I would like to have a color that is more visible (yellor or red)?

Greetings

Raul

Masha
Telerik team
 answered on 24 Aug 2015
6 answers
255 views
Hi team,
I read the article to learn how to define a custom data field. The RadNumericUpDown seems very simple. Then I want to use the RadMaskedTextInput to define a field of IP address. I get some code snippets from another sdk example.
<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


Jackey
Top achievements
Rank 1
 answered on 22 Aug 2015
0 answers
69 views

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 se​conds to ​display the final GridView. So i want to know deeper insights of where and when the GridView spend time on

 Thanks,

-J

Jackey
Top achievements
Rank 1
 asked on 21 Aug 2015
1 answer
239 views

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. 

Dimitrina
Telerik team
 answered on 21 Aug 2015
1 answer
133 views

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. 

 

Dimitrina
Telerik team
 answered on 21 Aug 2015
1 answer
111 views

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
       

Dimitrina
Telerik team
 answered on 21 Aug 2015
3 answers
301 views

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.

Ivan Ivanov
Telerik team
 answered on 21 Aug 2015
1 answer
188 views

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.

Stefan
Telerik team
 answered on 20 Aug 2015
2 answers
193 views

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

Jakub
Top achievements
Rank 1
 answered on 20 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?