Telerik Forums
UI for WPF Forum
3 answers
178 views
My customer has handed me some new requirements that makes me wonder whether Telerik's ChartView can deliver upon.
For sake of simplicity I attached an illustration and marked the three features that's being requested:

A: Is it possible to add areas like in the illustration. I would need to be able to add one such area per series.
B: The area might have to change its size at some point along the X-axis and it would be great if I could highlight and textually present those points somehow
C: The series would need to be drawn differently outside the marked min/max areas. Is this possible?

I've looked at PointTemplateSelectors for feature C but I don't understand how to move on with that. How would I get to the selected color for example?

Thank you
Petar Marchev
Telerik team
 answered on 30 Oct 2012
1 answer
675 views
Hi,

I converted string to RadDocument manually.

How can i get back my string back from raddocument.

I am using value converters to do this.

here is the sample code. please help me and thanks in advance

raddocument doc = new raddocument();                                     
XamlFormatProvider
 provider = new XamlFormatProvider(); doc = provider.Import(value.ToString()); foreach (Paragraph paragraph in doc.EnumerateChildrenOfType<Paragraph>()) {  //paragraph.Inlines  foreach(Inline line in paragraph.Inlines)  {        } }

In other words:

If i have my raddoucment as

string raddocstring =  "<t:RadDocument xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
                     xmlns:t=""clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents""
                     xmlns:s=""clr-namespace:Telerik.Windows.Documents.Model.Styles;assembly=Telerik.Windows.Documents""
                     version=""1.2"" LayoutMode=""Flow"" LineSpacing=""1.15"" LineSpacingType=""Auto"" ParagraphDefaultSpacingAfter=""12""
                     ParagraphDefaultSpacingBefore=""0"" SectionDefaultPageSize=""816,1056"">
                     <t:Section>
                        <t:Paragraph>
                          <t:Span ForeColor=""Red"" Text=""testing"" />
                          <t:Span ForeColor=""Blue"" Text=""testing"" />
                          <t:Span ForeColor=""Green"" Text=""testing"" />
                        </t:Paragraph>
                     </t:Section>
                     </t:RadDocument>";
how to get testing string from above raddocument paragraphs.... please advise...its very imp and urgent
 
Petya
Telerik team
 answered on 30 Oct 2012
12 answers
384 views
The RichTextBox has got a great merge-function.
We are very pleased with this feature.

Now and then we need a sort of master-detail possibility in our merge-letters.

Think about a mailmerge-letter to your customers.
We could use the mergefields for name, address and so on.
But you would like to use a mergefield to view a list of orders which is different for every customer. Master-detail!

Have you thought about something like that?

And how about combining the mailmerge in the RichTextBox with Telerik Reporting?
Petya
Telerik team
 answered on 30 Oct 2012
4 answers
154 views
I'm trying to provide a "formula editor" for an in-house application.  I'm trying out the Expression Editor to see if it will work for what we want ... notably, the list of fields available for to be used in a formula will be determined at run-time depending on the application state/context.

I haven't done very much with WPF, so just to get my feet wet, I followed the instructions in the "Getting Started" help topic to create a small app that uses the Expression Editor (with a grid view).

I then created an almost identical sample app that uses the Expression Editor without a Grid View. 
Since the field list will be "dynamic" I'm using an ExpandoObject as the view model, as described in this forum post.  And in fact the ExpandoObject properties do show up in the field list. 
However, the expression always seems to be invalid ... even for simple expressions like "Qty_1 * Unit_Price_1". 
Again, this is almost all identical to the previous iteration ... except that now I don't have a data grid, and I'm generating the "property bag" dynamically. Do I have to use the editor in conjunction with a RadGridView?  Or is it the dynamic properties that are the problem?


Here's my model:
<PRE>
public
class FormInfoModel
{
    public IDictionary<stringobject> Elements
    {
         get { return _elements; }
    }
    private IDictionary<stringobject> _elements;
    public FormInfoModel()
    {
         _elements = new Dictionary<stringobject>();
         _elements.Add("Order_Date"DateTime.Today);
         _elements.Add("Qty_1", 0);
         _elements.Add("Unit_Price_1", 0);
    }
}
</PRE>
...and the view model:
<PRE>public class FormInfoViewModel
{
    public
ExpandoObject Info
   
{
        get { return _info;
}
    }
    private ExpandoObject _info;
    public void SetInfo(FormInfoModel model)
    {
       
dynamic dobj = new ExpandoObject();
        foreach (var key in model.Elements.Keys)
       
{
            (dobj as
IDictionary<string, object>).Add(key, model.Elements[key]);
       
}
        _info =
dobj;
    }
}</PRE>

Then in the MainWindow constructor I set the binding programmatically:

  _viewModel = this.Resources["FormInfoViewModel"] as FormInfoViewModel;
   ExpressionEditor.Item =
_viewModel.Info;

 

Vlad
Telerik team
 answered on 30 Oct 2012
1 answer
65 views
We have these two error in VS output window, and we cannot find any "OffPostion" within our entire solution, then we looked into the RadControl source code we purchased, and found there is "OffPostion" property in Telerik.Windows.Controls.Gauge.IndicatorData.  Could you please look into it?

System.Windows.Data Error: 40 : BindingExpression path error: 'OffPostion' property not found on 'object' ''BarIndicator' (Name='TrackBar')'. BindingExpression:Path=OffPostion; DataItem='BarIndicator' (Name='TrackBar'); target element is 'IndicatorData' (HashCode=46355463); target property is 'OffPostion' (type 'Double')

System.Windows.Data Error: 40 : BindingExpression path error: 'OffPostion' property not found on 'object' ''Marker' (Name='CurrentFrameMarker')'. BindingExpression:Path=OffPostion; DataItem='Marker' (Name='CurrentFrameMarker'); target element is 'IndicatorData' (HashCode=15234483); target property is 'OffPostion' (type 'Double')

Thanks.



Andrey
Telerik team
 answered on 30 Oct 2012
6 answers
476 views
I'm using the RadGridView inside a RadPane and trying to drag a row to another grid in a different pane. If the pane is pinned it works perfectly but when the pane is not pinned I get the following error as soon as I start dragging:

System.InvalidOperationException was unhandled by user code
  Message=The specified Visual and this Visual do not share a common ancestor, so there is no valid transformation between the two Visuals.
  Source=PresentationCore
  StackTrace:
       at System.Windows.Media.Visual.TransformToVisual(Visual visual)
       at Telerik.Windows.Controls.DragDrop.DragDropProvider.OnDragInitialized(Object sender, DragInitializeEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\DragProviders\DragDropProvider.cs:line 60
       at Telerik.Windows.DragDrop.DragInitializeEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDropManager\DragInitializeEventArgs.cs:line 95
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at Telerik.Windows.DragDrop.DragInitializer.StartDrag() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDropManager\DragInitializer.cs:line 173
       at Telerik.Windows.DragDrop.DragInitializer.DragSourcePreviewMouseMove(Object sender, MouseEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDropManager\DragInitializer.cs:line 157
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
  InnerException:

I'm stumped as to how go about fixing this so any help would be appreciated!

-Gary
Jc
Top achievements
Rank 1
 answered on 30 Oct 2012
5 answers
82 views
Hi Support Team,

I am using the following Way to do. Steps are following:

1. I create a new Column Group and Added a label and stack panel with 4 buttons and place all of them in Grid like following  in the code and finally assigned that grid into Header Template of RadGridView property.

<DataTemplate

xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""

xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""

xmlns:Tele=""http://schemas.telerik.com/2008/xaml/presentation""

xmlns:Event=""clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity""

xmlns:cmd=""clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"" >

<Grid HorizontalAlignment=""Stretch"" VerticalAlignment=""Stretch"" Background=""#EAF3FC"" Name=""grdcolumnHeader2"" >

<Grid.RowDefinitions>

<RowDefinition Height=""23""></RowDefinition>

</Grid.RowDefinitions>

<Grid.ColumnDefinitions>

<ColumnDefinition Width=""*""></ColumnDefinition>

<ColumnDefinition Width=""Auto""></ColumnDefinition>

</Grid.ColumnDefinitions>

<Label Name=""lblMonthName"

 

 

+ groupIndex.ToString() + @""" Grid.Row=""0"" Grid.Column=""0"" HorizontalAlignment=""Stretch"" HorizontalContentAlignment=""Center"" Padding=""0"" Margin=""0,2,0,0"" FontWeight=""DemiBold""

Content="""

 

 

+ monthContent + @"""></Label>

</Grid>

</DataTemplate>";

2. After creating new column Group, adding it into RadGridView like following and assigned it name like "month1"
RadGridView1.ColumnGroups.add(newColumnGroup);
3. the created dynamic columns based on no of days in a months and assigned column group name "month1"

newcolumn.ColumnGroupName="month1";

RadGridView1.Columns.Add(newcolumn);

This functionality works fine in version 2011 Q3 and 2012 Q2 releases.

But my issues is when I use 2012 Q2 version of telerik controls the Label controls and Panel with 4 buttons in the Colum Group Header does not cover all the columns and leave black color space at right side columns. screen shot has been attached with this thread. Please have a look and provide solution.

Note: If you do not understand anything please let me know. I will explain further.
Please help me to resove this issue. I am running out of solution.

Thanks
Laxman




 

 


 

Laxman
Top achievements
Rank 1
 answered on 30 Oct 2012
3 answers
165 views
Hi Support Team,

I would like to change the background color of GroupPanel items, by default it shows black color. I would like to change it to different color as per customer requirement. An Image has been attached for your better understanding.

Thanks
Laxman

Laxman
Top achievements
Rank 1
 answered on 30 Oct 2012
2 answers
175 views
Hi Support Team,

I want to remove borders from Grid View Header Row. I am using the following style to set the Background, Foreground and BorderThickness that style is following:

Style x:Key="GridHeaderRowStyle" TargetType="Tele:GridViewHeaderRow">
                        <Setter Property="Background" Value="#EAF3FC"/>
                        <Setter Property="Foreground" Value="#EAF3FC"/>
                        <Setter Property="BorderBrush" Value="#EAF3FC"/>
                        <Setter Property="BorderThickness" Value="0,0,0,0"/>
                        <Setter Property="Padding" Value="0,0,0,0"/>
                        <Setter Property="Margin" Value="0,0,0,0"/>
                       
                    </Style>
It changes the BackGround color but did not removing Borders. Image has been attached for your reference. You can have a look.
Please provide me the style how to do that. I don't know Expression Blend how to create styles.

Hope someone will help me to solve this issue.

Thanks
Laxman


Laxman
Top achievements
Rank 1
 answered on 30 Oct 2012
4 answers
508 views
Hello,


We are using 2012 Q3
I am AutoGenerating columns from a datatable to populate a RadGridView.

In the table there are columns who's DataType is a tuple with a couple strings, defined as "characteristic columns".

I tried setting the cell template using the following code,

        private void OneStopGrid_DataLoaded(object sender, EventArgs e)
        {
            foreach (GridViewColumn column in OneStopGrid.Columns)
            {
                if (ViewModel.CharacteristicColumns.Any(c => c.Name == column.Header))
                {
                    column.CellTemplate = (DataTemplate)this.FindResource("HistoryTemplate");
                }
            }
        }

The history template is a stackpanel containing a textblock which basically binds to one of the strings using Text="{Binding Item1}", and a rectangle which is standing in for a button.

The cell template is correctly set, but the datacontext is wrong, when I set the binding to Text="{Binding}" it showed that in the cells the datacontext was the DataRow.

I looked on the forums and found

http://www.telerik.com/community/forums/wpf/gridview/programmatically-creating-templated-columns.aspx

which advised me to to go to

http://blogs.telerik.com/vladimirenchev/posts/10-05-13/how-to-custom-percentage-column-with-radgridview-radprogressbar-and-radslider-for-silverlight-and-wpf.aspx

I set up a custom column as recommended and overrode the CreateCellElement using the following code


Then I used the ColumnsGenerating event to set up the columns as my custom column

        private void OneStopGrid_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e)
        {
            if (ViewModel.CharacteristicColumns.Any(c => c.Name == e.Column.Header))
            {
                var templateColumn = new GridViewCharacteristicColumn();
                templateColumn.Header = e.Column.Header;

                e.Column = templateColumn;
            }
        }

Unfortunately I am still having the same problem. The Context is still the DataRow.

Anything I can do to get the binding to work correctly?


Thank you.
Eli
Top achievements
Rank 1
 answered on 29 Oct 2012
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?