Telerik Forums
UI for WPF Forum
3 answers
92 views
Is it possible to scroll bar on RadChart (not to chart area)
I want to show 16 charts in grid (4x4). All charts has one XValue (datetime).
Want to have only one scroll bar to scroll all charts in grid.
Can you suggest best way to achieve this ?

Attaching screen shot of legacy system. Trying to achieve similar using RadChart 
Petar Marchev
Telerik team
 answered on 25 Jan 2012
1 answer
174 views
Hi,

I am having a very hard time finding the right documentation/example on how to override the default formatting/css that is occurring in a RichTextBox that is loaded with HTML.

I have already found and tweaked the appropriate settings to make the HTML a fragment, but for the life of me I can't seem to figure out how to declare the css that I would liked applied to the HTML within the RichTextBox.

A perfect example is I need the following css to be applied to the HTML content.

<style type="text/css">
ol {
    list-style-type: upper-roman;
}

ol ol {

    list-style-type: upper-alpha;
}
outline.css (line 5) 

 ol ol ol {
    list-style-type: decimal;
}
</style>

Any help would be greatly appreciated.
Iva Toteva
Telerik team
 answered on 25 Jan 2012
3 answers
111 views
Hello!

  I'm trying to detect when a pane (radPane1) is docked into a PaneGroup with another pane (radPane2).  I thought I could do this:

        private void radDocking1_PaneStateChange(object senderTelerik.Windows.RadRoutedEventArgs e)
        {
            var somePane = e.OriginalSource as RadPane;
            if (somePane == radPane1 && !somePane.IsFloating && radPane1.PaneGroup == radPane2.PaneGroup)
                   HandleDockEvent();
        }

...but it seems the PaneGroup is not set at this point in time, and hence that comparison fails.  How can I do this?

Konstantina
Telerik team
 answered on 25 Jan 2012
2 answers
169 views
Hi,

 I have specific requirement. I need to implement a radgridview with a row that contains a combobox in the first column on load of the grid. I have a button at the last column of the same row. i use that button to fill the details in the row based on the item selected in the combobox. once filled the combobox should be replaced with the normal cell. and the default row should be moved to the next row to add another item.

Please help me to solve this .

regards
SKB
Swaroop
Top achievements
Rank 1
 answered on 25 Jan 2012
0 answers
84 views
Hi 

I used binding DataTable to GridView...


flowing code:
DataTable table = new DataTable("Data Table");
 
DataColumn column;
DataRow row;
 
column = new DataColumn();
column.DataType = typeof(DateTime);
column.ColumnName = "Time";
column.ReadOnly = true;
column.Unique = true;
table.Columns.Add(column);
 
column = new DataColumn();
column.DataType = typeof(double);
column.ColumnName = "A";
column.ReadOnly = true;
column.Unique = false;
table.Columns.Add(column);
 
column = new DataColumn();
column.DataType = typeof(double);
column.ColumnName = "B";
column.ReadOnly = true;
column.Unique = false;
table.Columns.Add(column);
 
// Create three new DataRow objects and add
// them to the DataTable
for (int i = 0; i <= 20; i++)
{
    row = table.NewRow();
    row["Time"] = DateTime.Now.AddSeconds(i);
    row["A"] = random.NextDouble() * 100;
    row["B"] = random.NextDouble() * 50;
 
    table.Rows.Add(row);
}
 
gridView.ItemsSource = table;

and then i used CustomAggregateFunction .. 

public static class Statistics
{
    public static double StdDev<TSource>(DataTable source, Func<TSource, double> selector)
    {
        int itemCount = source.Rows.Count();
        if (itemCount > 1)
        {
            IEnumerable<double> values = from i in source select Convert.ToDouble(selector(i));
 
            double sum = SumAvg(values);
 
            return Math.Sqrt(sum / (itemCount - 1));
        }
 
        return 0;
    }
 
    private static double SumAvg(IEnumerable<double> values)
    {
        double average = values.Average();
        double sum = 0;
 
        foreach (double item in values)
        {
            sum += Math.Pow(item - average, 2);
        }
 
        return sum;
    }
}

public class StandardDeviationFunction : EnumerableSelectorAggregateFunction
{
    protected override string AggregateMethodName
    {
        get
        {
            return "StdDev";
        }
    }
 
    protected override Type ExtensionMethodsType
    {
        get
        {
            return typeof(Statistics);
        }
    }
}

but this function occur exception :
{"No generic method 'StdDev' on type 'NS.Client.Models.Controls.Statistics' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic. "}

what's wrong??

Guntae Park
Top achievements
Rank 1
 asked on 25 Jan 2012
3 answers
127 views
Hi,

How do i add RadPanelBarItem from codebehind?

regards,
SKB
Swaroop
Top achievements
Rank 1
 answered on 24 Jan 2012
0 answers
156 views
I have a Telerik GridView that I am using in MVVM mode. That is, I've not implemented event handlers in the code-behind, rather I've bound it to an ObservableCollection.  And I have two problems.

When I click on the "Click here to add new item" bar in the grid, the CollectionChanged event on the collection fires, with it's Action set to NotifyCollectionChangedAction.Add.  Which is what I would expect to happen.  Then after the handler returns, the new blank row appears at the top of the grid.

The first problem: it's the second cell that is selected, and actively editable, not the first.

How do I configure the editor to have the first cell selected?  It clearly can't be in the ViewModel - the observable collection doesn't have access to the grid - and shouldn't.  Is there something I can add to the XAML that would control which field is active, when editing?

(One thing that might be relevant - the first cell is only editable when adding a new record, it's read-only when editing an existing record.  The GridViewDataColumn has its IsReadOnlyBinding property bound to a property in the viewmodel that is true when editing an existing record.  So when editing an existing row, I want to start editing with the second cell, when adding a new a new row I want to start editing with the first.)

The second problem: updating the data.

The rows in the grid are bound to elements in the collection, and those elements implement INotifyPropertyChanged.  So when I am editing a record in the grid, after I leave each file, the propertyChanged event fires on the element.  In that, I can update the underlying data store - except that I don't want to.  I don't want to insert or update the record, after every field is changed, I want to do one insert or update when the row is complete. 

But I can't figure out what event would indicate that editing of the row is complete.  PropertyChanged is fired on the element as every field is changed, it doesn't tell me when the user is done editing a row.  And Collection changed is fired when a new element is added to the collection, it doesn't fire to tell me that one of the elements has changed.

So, how do folks usually handle this?

== addendum ==
For what it's worth, I've tried adding an AddingNewDataItem handler:
void customerAttributesGrid_AddingNewDataItem(object sender,
        telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
{
    var grid = e.OwnerGridViewItemsControl;
    grid.CurrentColumn = grid.Columns[0];
}
It's not helped.  The event fires, I can walk through the handler in the debugger, setting CurrentColumn as suggested, then the CollectionChanged event fires and I walk through that.  But when I'm done, the second column is still current.
Jeff
Top achievements
Rank 1
 asked on 24 Jan 2012
1 answer
142 views
Hi,

I'm in WPF and I would like to know if it's possible to change the style of my RadTabItems to have a style like this the enclosed pictiure. Of course, the colors of my Telerik theme need to be maintain.

Thank's
Petar Mladenov
Telerik team
 answered on 24 Jan 2012
3 answers
129 views

I have a Radgrid and Datapager which is bound as the code below, the item source is a linq to sql class, the class is queried and the results are converted into a pivot table and both the pager and grid’s source properties are set and the grid has Aggregate Results and sort descriptors added this works well. I have a refresh button on the page but I can’t work out how to clear the pager and grid when the user clicks the button. I have tried your sample code but get errors. Could you please advise on the correct method.

 

<telerik:RadGridView x:Name="AgedJobsListgrid" ShowGroupPanel="False" telerik:StyleManager.Theme="Office_Black" ShowColumnFooters="True" IsScrolling="False" IsTabStop="False" RowIndicatorVisibility="Collapsed" VerticalAlignment="Stretch"  DataContext="{Binding ElementName=radDataPager}" RowHeight="35" FontSize="14"></telerik:RadGridView>

            <telerik:RadDataPager x:Name="radDataPager" telerik:StyleManager.Theme="Office_Black"

                         PageSize="10"

                         DisplayMode="All"

                         IsTotalItemCountFixed="True" Source="{Binding AgedListClass}"  DataContext="{Binding ElementName=AgedJobsListgrid}" />

 

       ‘code used to clear the pager and grid which fails when setting the itemsource to nothing.

radDataPager.Source = Nothing

AgedJobsListgrid.GroupDescriptors.Clear()

        AgedJobsListgrid.ItemsSource = Nothing

        AgedJobsListgrid.Columns.Clear()

        AgedJobsListgrid.AutoGenerateColumns = True

 

Dimitrina
Telerik team
 answered on 24 Jan 2012
2 answers
111 views
I have created a UserControl which consists of the RadDocking control.  Within this I place the RadPaneGroups and subsequent RadPanes.  Each RadPane contains a View, to which a ViewModel is created.  The problem occurs when I place the upper most UserControl, with the RadDocking, in a tab.  The tabs are dynamically created very similar to your expample with RadTab.  Each time I switch tabs I see the Views being reinstantiated and in turn the ViewModel and Model.  When I remove the upper most UserControl, with the RadDocking control, this does not occur.  What is best practice of placing the RadDocking control within tabs without encountering this behavior?

Thank you
Paul
Top achievements
Rank 1
 answered on 24 Jan 2012
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?