Telerik Forums
UI for WPF Forum
1 answer
131 views
Hi,

Assembly version :2011.2.823.40

I've got a weird issue on telerik radgridview:
i create and destroy columns on view code behind by the code :
myGrid.Columns.RemoveAt(i);
...
myGrid.Columns.Add(NewColumns);

when i rebind my grid, the new column is systematiquely at the place of the removed column but the header is wrong, the new header is at the end of the grid.

is someone had the issue before and know how to resolve that?

thanks by advance
Vera
Telerik team
 answered on 26 Sep 2011
3 answers
112 views
Is there any way to get or set the HighlightedElement with the RadComboBox?  The HighlightedElement seems to follow the SelectedItem when there is a SelectedItem, but the highlight does not go away when SelectedItem is null.

Thanks.
Valeri Hristov
Telerik team
 answered on 26 Sep 2011
4 answers
178 views
I'm wondering if anybody has done any work extending DataFilter to handle dealing with child collections in a complicated manner. For instance, I have an IParent interface, which has an IEnumerable<IChild> Children member. I'd like to be able to express visually:

from p in parents where p.Children.Any(i => i.Type == 1 && i.Foo = "Bar")

Basically, I want to select parents based on whether any children exists.

I have this notion that I could implement this entirely on my own... somehow. Perhaps a custom 3-part editor control for teh Children property, with a "any" operator... and a sub-RadDataFilter rendered in part-3.

That seems pretty kludgy though.
Rossen Hristov
Telerik team
 answered on 26 Sep 2011
1 answer
92 views
Hi Support
I was able to bind combo according to this thread http://www.telerik.com/help/silverlight/raddatafilter-how-to-create-custom-filter-editors.html
but i don't know how to bind it to special value and Description, is there any idea?
<DataTemplate x:Key="ComboKind">

<telerik:RadComboBox DisplayMemberPath="Dsc"

                     SelectedValue="{Binding Value, Mode=TwoWay, FallbackValue=null}"/>

 

</DataTemplate>


P.S. Item Source contain ID and Dsc

Thanks in advance 
Mehri
Rossen Hristov
Telerik team
 answered on 26 Sep 2011
2 answers
376 views
Hi,

I have an issue about the scroll on my gridview.
My gridview contains a lot of data so there is vertical scrollbars and I set the insert row to visible.
The problem is when I enter data on the insert row and I press enter the gridview don't scroll to the the added row.
Here is my gridview:
<telerik:RadGridView telerik:StyleManager.Theme="Office_Blue"  Width="auto" Height="200"  x:Name="rgvTest"
    ItemsSource="{Binding TrckTest, IsAsync=True}"
    DataLoadMode="Asynchronous"
    SelectionMode="Extended"
    AutoGenerateColumns="False"
    ScrollMode="Deferred"
    EnableRowVirtualization="True"
    SnapsToDevicePixels="True"
    UseLayoutRounding="True"
    ActionOnLostFocus="None"
    ShowInsertRow="{Binding IsReadOnly}"
    CanUserInsertRows="{Binding IsReadOnly}"
    CanUserDeleteRows="{Binding IsReadOnly}"
    Grid.Column="0" RowEditEnded="rgvTest_RowEditEnded">
 
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="RowEditEnded">
    <Commanding:EventToCommand Command="{Binding TestEditEndedCommand}" PassEventArgsToCommand="True"/>
    </i:EventTrigger>
 
    <i:EventTrigger EventName="AddingNewDataItem">
    <Commanding:EventToCommand Command="{Binding AddNewTestEvent}" PassEventArgsToCommand="True" />
    </i:EventTrigger>
 
    <i:EventTrigger EventName="SelectionChanged">
    <Commanding:EventToCommand Command="{Binding ItemTestSelectedCommand}" CommandParameter="{Binding ElementName=rgvTest, Mode=OneWay, Path=SelectedItem}"/>
    </i:EventTrigger>
    </i:Interaction.Triggers>
 
    <telerik:RadGridView.Columns>
    ...
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

I tried to use the event RowEditEnded in the code behind to scroll to the position of  the row like this but it didn't work:
private void rgvTest_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
{
        rgvTest.ScrollIntoView(e.Row);
}

Do you any solution about this issue?
Thanks
Hakim
Top achievements
Rank 1
 answered on 26 Sep 2011
8 answers
297 views
Hello all, 

we are having a big problem with radchart performance. I'll explain  an example to illustrate the situation. 

In one part of our app, a user control that contains 5 Radcharts is loaded. Each chart contains two series for a total of 10, and each series has exactly 2880 points in our database. Internally, each chart is set to use a sampling threshold of 200, X axis range is set to DateTime and AutoRange, and zoom settings are set to zoom and scroll. As these are multi-series charts, the schema we used is that found in Telerik's documentation (binding to nested collections), associating each series mapping to one collection index. 

As the user refreshes, one WCF call is asynchronously made to retrieve each series data (thus, 10 calls in total). The call returns really fast, and in around 2 seconds all the lists of points that feed the series are loaded in memory.

The problem arises when updating the charts's ItemsSource property. It takes a lot of time since the ItemsSource of each chart is updated until all the charts are shown in the screen properly (around 15-20 seconds!!). This is totally a mess for us, as our customer needs to change the date queries dinamycally and perform refresh operations frequently. Waiting for 20-25 seconds every time a refresh is made is not acceptable for him. 

Showing point marks, labels and so on is disabled, as well as animations. Please, could you provide any help for this?

I post the chart configuration code here:

// Local variables
            bool bResult = true;
            TimeSpan DateDifference = new TimeSpan();
 
            try
            {
                // Sampling threshold
                this.Chart.SamplingSettings.SamplingThreshold = 200;
                this.Chart.SamplingSettings.SamplingFunction = ChartSamplingFunction.Min;
                 
                // Settings for X axis --> manual setting for min, max, step, label step
                this.Chart.DefaultView.ChartArea.AxisX.IsDateTime = true;
 
                // Note: set to true !!!!
                this.Chart.DefaultView.ChartArea.AxisX.AutoRange = true;
                this.Chart.DefaultView.ChartArea.AxisX.TicksDistance = 15;
 
                // Set the label format depending on the selected timespan
                DateDifference = this.m_dtDateTo.Subtract(this.m_dtDateFrom);
 
                TimeSpan FifteenMinutes = new TimeSpan(0, 15, 0);
                TimeSpan OneDay = new TimeSpan(1, 0, 0, 0);
                TimeSpan OneMonth = new TimeSpan(31, 0, 0, 0);
                TimeSpan OneYear = new TimeSpan(365, 0, 0, 0);
 
                // Less than 15 minutes
                if (DateDifference.TotalMilliseconds < FifteenMinutes.TotalMilliseconds)
                {
                    // Hours, minutes and seconds
                    this.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "HH:mm:ss";
                }
                // Between 15 minutes and 1 day
                else if ((DateDifference.TotalMilliseconds > FifteenMinutes.TotalMilliseconds) && (DateDifference.TotalMilliseconds < OneDay.TotalMilliseconds))
                {
                    // Hours and minutes
                    this.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "HH:mm";
                }
                // Between 1 day and 31 days
                else if ((DateDifference.Days >= OneDay.Days) && (DateDifference.Days <= OneMonth.Days))
                {
                    // Show the day
                    this.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "M-dd";
                     
                    // No auto range... the chart does not handle this properly in some cases
                    this.Chart.DefaultView.ChartArea.AxisX.AutoRange = false;
                    this.Chart.DefaultView.ChartArea.AxisX.MinValue = this.m_dtDateFrom.ToOADate();
                    this.Chart.DefaultView.ChartArea.AxisX.MaxValue = new DateTime(this.m_dtDateTo.Year, this.m_dtDateTo.Month, this.m_dtDateTo.Day, 0, 0, 0).ToOADate();
                    DateTime aux1 = new DateTime(2000, 1, 1, 0, 0, 0);
                    DateTime aux2 = new DateTime(2000, 1, 2, 0, 0, 0);
                    double Step = aux2.ToOADate() - aux1.ToOADate();
                    this.Chart.DefaultView.ChartArea.AxisX.Step = Step;
                    this.Chart.DefaultView.ChartArea.AxisX.LabelStep = 1;
                }
                else if ((DateDifference.TotalMilliseconds > OneMonth.TotalMilliseconds) && (DateDifference.TotalMilliseconds <= OneYear.TotalMilliseconds))
                {
                    // Month and year
                    this.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "yyyy-M";
                }
                else if (DateDifference.TotalMilliseconds > OneYear.TotalMilliseconds)
                {
                    // Year value
                    this.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "yyyy";
                }
 
                // Label orientation
                this.Chart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;
                this.Chart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Auto;
 
                // Disable animations
                this.Chart.DefaultView.ChartArea.EnableAnimations = false;
 
                // X Axis label style
                this.Chart.DefaultView.ChartArea.AxisX.AxisStyles.ItemLabelStyle = this.Resources["ItemLabelStyle"] as Style;
 
                // Configuring the Y axis
                this.Chart.DefaultView.ChartArea.AdditionalYAxes.Clear();
 
                // Get the lower Y axis index
                this.m_iLowerAxisIndex = (from axis in this.m_obcAxisY
                                          select axis.ID).Min();
                
 
                foreach (DLL_CustomControls.ReportChartSettings.AxisY obConfiguredAxisY in this.m_obcAxisY)
                {
                    if (obConfiguredAxisY.ID == this.m_iLowerAxisIndex)
                    {
                        // Configuration for the default axis
                        this.Chart.DefaultView.ChartArea.AxisY.MinValue = obConfiguredAxisY.MinValue;
                        this.Chart.DefaultView.ChartArea.AxisY.MaxValue = obConfiguredAxisY.MaxValue;
                        this.Chart.DefaultView.ChartArea.AxisY.AutoRange = obConfiguredAxisY.AutoRange;
                        this.Chart.DefaultView.ChartArea.AxisY.Title = obConfiguredAxisY.Label;
                        continue;
                    }
 
                    // Create and add new axis
                    Telerik.Windows.Controls.Charting.AxisY NewAxis = new Telerik.Windows.Controls.Charting.AxisY();
                    NewAxis.MinValue = obConfiguredAxisY.MinValue;
                    NewAxis.MaxValue = obConfiguredAxisY.MaxValue;
                    NewAxis.AutoRange = obConfiguredAxisY.AutoRange;
                    NewAxis.AxisName = obConfiguredAxisY.ID.ToString();
                    NewAxis.Title = obConfiguredAxisY.Label;
 
                    // Add the secondary axis
                    this.Chart.DefaultView.ChartArea.AdditionalYAxes.Add(NewAxis);                   
                }
            }
            catch (Exception ex)
            {
                bResult = false;
                ExceptionManager.Write("DLL_CustomControls", "ReportChart", "ConfigureChart", "Exception: " + ex.Message);
            }
 
            return bResult;

And here, the function used to process the result of the asynchronous WCF call. As you can see, we make a local copy of the list returned by the WCF method inserting it in an ObservableCollection and then setting the ObservableCollection as an item of m_lstChartSource, which is a list and the object set as Chart.ItemsSource target. "ProcessChartSerie" makes additional processing regarding the serie (color, item mappings and so on):

// Capture the data
                if (!e.Result)
                {
                    // Debug, warn and return
                    DebugManager.Write(DebugManager.DebugStatus.ERROR, "DLL_CustomControls", "ReportChart", "OnGetDataCompleted", "Error in the web service function for Serie ID = " + e.outSerieID.ToString() + ": " + e.strError);
                    MessageBox.Show("Error getting data for serie " + e.outSerieID.ToString() + ". Please try again.", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }
 
                // Capture the serie that has been processed
                DLL_CustomControls.ReportChartSettings.ChartSerie obSerieToProcess = null;
 
                obSerieToProcess = (from series in this.m_obcSeries
                                   where series.ID == e.outSerieID
                                   select series).First();
 
                // Process the serie data
                if (!ProcessSerieData(obSerieToProcess))
                {
                    DebugManager.Write(DebugManager.DebugStatus.ERROR, "DLL_CustomControls", "ReportChart", "OnGetDataCompleted", "Error processing serie number " + e.outSerieID.ToString());
                }
                else
                {
                    // If the list has points, process
                    if (e.lstChartPoints != null)
                    {
                        // Add to list of datasources of the chart
                        ObservableCollection<DLL_Resources.WCF_Clients.ChartValueDateDouble> obcPoints = new ObservableCollection<DLL_Resources.WCF_Clients.ChartValueDateDouble>();
 
                        // Convert in observable collection
                        foreach (DLL_Resources.WCF_Clients.ChartValueDateDouble obPoint in e.lstChartPoints)
                        {
                            DLL_Resources.WCF_Clients.ChartValueDateDouble obNewPoint = new DLL_Resources.WCF_Clients.ChartValueDateDouble();
                            obNewPoint.XValueDateTime = obPoint.XValueDateTime;
                            obNewPoint.XValueDouble = obPoint.XValueDouble;
                            obNewPoint.YValue = obPoint.YValue;
 
                            // Add point
                            obcPoints.Add(obNewPoint);
                        }
 
                        this.m_lstChartSource.Add(obcPoints);
                    }
                }



Bartholomeo Rocca
Top achievements
Rank 1
 answered on 26 Sep 2011
3 answers
473 views

The follow code doesn't work:

<telerik:RadComboBox Name="testcc" ItemsSource="{Binding TestTypes}" SelectedItem="{Binding SelectedTestType}" IsEditable="True" StaysOpenOnEdit="True" IsFilteringEnabled="True" TextSearchMode="Contains" DisplayMemberPath="FullName"/>

I tried setting OpenDropDownOnFocus="True", and it works only for the first time. When the ComboBox is still on focus but the dropdown is close, I tried typing in the textbox the dropdown will not open.

Yana
Telerik team
 answered on 26 Sep 2011
1 answer
127 views
within wpf radChart, export to xlsx, is it possible to dump out a table of the raw data that is used in the chart?  Do i need to do this "by hand" via another process?
thanks,
robert
Yavor
Telerik team
 answered on 26 Sep 2011
0 answers
94 views
Hi,

In the Self referencing radgridview, I need to implement the below items

1. Multiple row headers (dynamically)
2. Binding the List Collection to the grid

For example, the grid should look like
------------------------------------------------------------------------------------------------------------------
                                 MICROSOFT             |                           TELERIK
------------------------------------------------------------------------------------------------------------------
Topic         |       .NET    |    Sharepoint       |     RadGridView    |    RadContextMenu
------------------------------------------------------------------------------------------------------------------
- T1           |         xyz     |      abc                 |            34            |           25
    - T11     |                   |                            |                            |            zzz
 -------------------------------------------------------------------------------------------------------------------

I have the LINQ query list as below

CompanyID | Company Name | ProductID | Product Name        | Topic ID | Topic Name|  Parent Topic ID | Value ID | Value
        1         |  Microsoft           |  1              |   .NET                    | 1            |  T1              |       NULL           |     1         | xyz
        1         |  Microsoft           |  2              |   Sharepoint           | 1            |  T1              |       NULL           |     2          | abc
        2         |  Telerik              |  3              |   RadGridView        | 1            |  T1              |       NULL           |     13        | 34
        2         |  Telerik              |  4              |   RadContextMenu | 1            |  T1              |       NULL           |     15        | 25
        2         |  Telerik              |  4              |   RadContextMenu | 2            |  T11            |       1                  |     19        | zzz

and I am having this query result in List<myClass>. myClass is having fields and properties for the above mentioned table.
Please help me to achieve this with some sample code.
Ramasamy
Top achievements
Rank 1
 asked on 25 Sep 2011
0 answers
152 views
Trouble Filtering Rows.
I have the need to bind a viewmodel that has a hierarchy of objects in the template for the TreeListView. I have a need to make rows(nodes) toggle between visible or invisible while in "ShowAll" mode where all the nodes can be seen. The user clicks the show all checkbox outside of the treeview to enter show all mode. There is an eye icon beside every treelistivew item kind of like adobe products have. The eye once clicked will turn from gray to a selected state to show that he item is visible. Once the ShowAll mode is turned off the items should be filtered from view. I can't work this out.


 <CheckBox x:Name="ShowAll" Content="Show All" Click="ShowAll_Click" ></CheckBox>
<
telerik:RadTreeListView x:Name="MyTreeView" EditTriggers="None"
                         AutoGenerateColumns="False"
                         local:SelectionBehavior.SelectionChanged="{Binding Path=ItemSelectedCommand}"
                         ItemsSource="{Binding ProjectDataInstances}"
                         ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                         HierarchyColumnIndex="3">
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children, Converter={StaticResource NodeVisibilityConverter1}}" />
    </telerik:RadTreeListView.ChildTableDefinitions>

The converter can work on my IsVisible variable internally for each of my children but there is no way to check the show all control from the TreeListViewTableDefinitino.ItemsSource as it passes through the converter(I could flag the converter to show everything). I tried to use a Multibinding which doesn' t work. I also tried to pass the Element in the ConverterParameter but that doesn't work either. I toyed with polluting my viewmodel with a static ShowAll property and manually walking the hierarchy and updating the IsVisible properties using that property flag but I am having troubles with that too.

 So, naturually my question is, how do I properly filter the rows? 


Jaime Weise
Top achievements
Rank 1
 asked on 24 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?