Telerik Forums
UI for WPF Forum
3 answers
234 views
When we use the auto-layout functionality in our application our diagram ends up upside down. The code we are using for adding shapes and connectors is below. Any ideas on how to make the layout start with our start block on top and then layout downward. I tried added the End block after the start and that did not fix it. Are there any other layouts we can try?

private void PopulateDiagram()
        {
            processingDiagram.Clear();
 
            RadDiagramShape ppEnd = new RadDiagramShape()
            {
                Content = "End",
                Width = 100,
                Height = 50,
                Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.CloudShape)
            };
            processingDiagram.AddShape(ppEnd);
 
            RadDiagramShape ppStart = new RadDiagramShape()
            {
                ContentTemplate = Resources["PreprocessingStartTemplate"] as DataTemplate,
                Width = 100,
                Height = 50,
                Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.CloudShape)
            };
            processingDiagram.AddShape(ppStart);
 
            foreach (PreprocessorSegment segment in SelectedEngine.PreprocessorSegments)
            {
                RadDiagramShape segmentStart = new RadDiagramShape()
                {
                    Content = segment.Node,
                    Width = 100,
                    Height = 50,
                    Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.EllipseShape)
                };
                processingDiagram.AddShape(segmentStart);
 
                RadDiagramConnection connection = new RadDiagramConnection()
                {
                    Source = ppStart,
                    SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Bottom,
                    Target = segmentStart,
                    TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Top,
                };
                processingDiagram.AddConnection(connection);
 
                List<string> unusedOutputs = new List<string>();
                Dictionary<string, RadDiagramShape> outputShapes = new Dictionary<string, RadDiagramShape>();
                Dictionary<PreprocessorAlgorithmInstance, RadDiagramShape> algShapes = new Dictionary<PreprocessorAlgorithmInstance, RadDiagramShape>();
                foreach (PreprocessorAlgorithmInstance alg in segment.Algorithms)
                {
                    RadDiagramShape algShape = new RadDiagramShape()
                    {
                        Content = alg,
                        ContentTemplate = Resources["PreprocessingAlgorithmInstanceTemplate"] as DataTemplate,
                        Width = 100,
                        Height = 50,
                        Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.RectangleShape)
                    };
 
                    unusedOutputs.Add(alg.Output);
                    outputShapes[alg.Output] = algShape;
                    algShapes[alg] = algShape;
                    processingDiagram.AddShape(algShape);
                }
 
                // Connections from Inputs to Outputs.
                foreach (PreprocessorAlgorithmInstance alg in segment.Algorithms)
                {
                    foreach (string input in alg.Inputs)
                    {
                        if (outputShapes.ContainsKey(input))
                        {
                            RadDiagramConnection cn = new RadDiagramConnection()
                            {
                                Content = input,
                                Source = outputShapes[input],
                                SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Bottom,
                                Target = algShapes[alg],
                                TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Top,
                                TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled
                            };
                            processingDiagram.AddConnection(cn);
                            unusedOutputs.Remove(input);
                        }
                        else
                        {
                            RadDiagramConnection cn = new RadDiagramConnection()
                            {
                                Content = input,
                                Source = segmentStart,
                                SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Bottom,
                                Target = algShapes[alg],
                                TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Top,
                                TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled
                            };
                            processingDiagram.AddConnection(cn);
                        }
                    }
                }
 
                foreach (string output in unusedOutputs)
                {
                    RadDiagramConnection cn = new RadDiagramConnection()
                    {
                        Content = output,
                        Source = outputShapes[output],
                        SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Bottom,
                        Target = ppEnd,
                        TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Top,
                        TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow1Filled
                    };
                    processingDiagram.AddConnection(cn);
                }
            }
 
            processingDiagram.Layout();
        }
Peshito
Telerik team
 answered on 04 Nov 2014
3 answers
127 views
Hi all,

I'm doing on RadGridView with a customized toggle button instead of using the default toggle button. I know it's coming with the ChildTableDefination and GridViewTableDefinition by default. So, since I'm using the customized toggle button, can I populate the child from my View Model once I clicked on the customized toggle button from parent? How could I link the toggle button once I clicked to the HierarchyChildTemplate? Thanks is advanced. Hope there's someone could help me.

Best Regards, 
Ng.
Dimitrina
Telerik team
 answered on 03 Nov 2014
2 answers
137 views
I am implementing a grid hierarchy view on my UI. I have used hierarchy child template for this and it has 3 levels layer A, layer B and layer C. Now when I click to expand layer A, it ends up expanding layer B as well.

Is there any way to stop this? I do not want to expand layer B by default. Please suggest few ideas.
Rohan
Top achievements
Rank 1
 answered on 03 Nov 2014
2 answers
140 views
Hello everybody,

I have a probleme with my GanttView when I add event to an event that doesn't have children at beginning, when an InitialExpandBehavior is used to keep event collapsed.
I recreate this bug in a small example you can find here https://drive.google.com/file/d/0Bw_pUE-LqMWVbjZGWHJ5ZlFKX1U/view?usp=sharing
Reproduction in this project :
- at beggining, 2 event are generated : "phase 1" and "phase 2", and an event "evt phase 1" is added to children of "phase 1"
- I have an InitialExpandBehavior which return false in ShouldExpandItemByDefault in order to all items are collapsed
- I Have 2 button : "Add event to phase 1" which add an event in children of "phase 1" and "Add event to phase 2" which add an event in children of "phase 2"
- click on "Add event to phase 1" is OK, the event is added
- click on "Add event to phase 2" is KO, the event is added but the view is not refresh
If I remove the expandBehavior, the two buttons are OK.

Can you investigate ? Have you a workaround if correction is complicated ?

Thanks for your Help

PS : sorry for my english
Julien
Top achievements
Rank 1
 answered on 03 Nov 2014
1 answer
115 views
Hi There,

Can you please guide me how can we localize the text "aA" ?
Please check the attached screenshot for more information.

Thanks in advance,
Regards,
Raj.
Boris
Telerik team
 answered on 03 Nov 2014
1 answer
74 views
Hello everybody,

I have a probleme with my GanttView when I add event to an event that doesn't have children at beginning, when an InitialExpandBehavior is used to keep event collapsed.
I recreate this bug in a small example you can find here https://drive.google.com/file/d/0Bw_pUE-LqMWVbjZGWHJ5ZlFKX1U/view?usp=sharing
Reproduction in this project :
- at beggining, 2 event are generated : "phase 1" and "phase 2", and an event "evt phase 1" is added to children of "phase 1"
- I have an InitialExpandBehavior which return false in ShouldExpandItemByDefault in order to all items are collapsed
- I Have 2 button : "Add event to phase 1" which add an event in children of "phase 1" and "Add event to phase 2" which add an event in children of "phase 2"
- click on "Add event to phase 1" is OK, the event is added
- click on "Add event to phase 2" is KO, the event is added but the view is not refresh
If I remove the expandBehavior, the two buttons are OK.

Can you investigate ? Have you a workaround if correction is complicated ?

Thanks for your Help

PS : sorry for my english
Polya
Telerik team
 answered on 03 Nov 2014
8 answers
246 views
Hi,

I have a RadGridView,it contains various columns.i marked two columns of them IsVisible =  False, on certain condition.
I have another condition, on which one of the invisible columns mark IsVisible = True, But i am not able to get index of recently marked visible column on RowLoaded event.


//This is to hide two columns "Address" and "LastName"
private
void rdbHide_Checked(object sender, RoutedEventArgs e)
       {
           if ((bool)rdbHide.IsChecked)
           {
               dgQueue.Columns["Address"].IsVisible = false;
               dgQueue.Columns["LastName"].IsVisible = false;
           }
          
           dgQueue.Rebind();
       }
      //This is to show "Address" column
       private void rdbShow_Checked(object sender, RoutedEventArgs e)
       {
           if ((bool)rdbShow.IsChecked)
               dgQueue.Columns["Address"].IsVisible = true;
          
          
           dgQueue.Rebind();
       }

On RowLoaded event i am unable to get "Address" column index.
private void dgQueue_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            if (e.DataElement != null)
            {
                GridViewRow GrdRow = e.Row as GridViewRow;
                Emp objEV = e.Row.DataContext as Emp;
 
                if (GrdRow != null)
                {
                    for (int index = 0; index < GrdRow.Cells.Count; index++)
                    {
//Here i am not able to get index of "Address" column, on the bases of Address i want to show and hide Image control inside "PatInfo" column
                        if (GrdRow.Cells[index].Column.UniqueName.Equals("PatInfo"))
                        {
                         
                            Image img = null;
                            img = (Image)GrdRow.Cells[index].Content;
                            if (!string.IsNullOrEmpty(objEV.Address))
                            {
                                if (objEV.Address == "Noida")
                                {
                                    if (img != null) img.Visibility = System.Windows.Visibility.Collapsed;
                                }
                                else
                                {
                                    if (img != null) img.Visibility = System.Windows.Visibility.Visible;
                                }
                            }
                        }
                    }
                }
            }
        }

XAML :
<telerik:RadGridView Name="dgQueue" Grid.Row="0" AutoGenerateColumns="False" RowLoaded="dgQueue_RowLoaded">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Width="*" UniqueName="FirstName"
                                                            DataMemberBinding="{Binding FirstName}"
                                                            Header="FirstName">
 
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Width="*" UniqueName="LastName"
                                                            DataMemberBinding="{Binding LastName}"
                                                            Header="LastName">
                    </telerik:GridViewDataColumn>
 
                    <telerik:GridViewDataColumn Width="*" UniqueName="Address"
                                                            DataMemberBinding="{Binding Address}"
                                                            Header="Address" />
                    <telerik:GridViewDataColumn Width="*" UniqueName="Mobile"
                                                            DataMemberBinding="{Binding Mobile}"
                                                            Header="Mobile" />
 
                    <telerik:GridViewDataColumn Name="PatInfo" UniqueName="PatInfo" Width="90" Header="Pat Info">
                        <telerik:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Image Name="imgDemo"
                                                   Width="16"
                                                   Height="16"
                                                   ToolTip="Patient Information"
                                                   Source="/WpfDemo;component/Images/magnify3.png"
                                                   />
                            </DataTemplate>
 
                        </telerik:GridViewColumn.CellTemplate>
 
                    </telerik:GridViewDataColumn>
 
                </telerik:RadGridView.Columns>
 
            </telerik:RadGridView>
Dimitrina
Telerik team
 answered on 03 Nov 2014
5 answers
750 views
Hi all,

I wish to use radgridview for my parent data and whenever the specific parent data row have details data inside and it will show up a toggle button beside my first column data name instead of the default column for toggle button while for the parent data row which is not containing details data will be not able to see the toggle button. I know there's something related with gridviewboundcolumnbase in a new class. Could anyone give some idea or provide some sample? It will be great for me to be done this. Thanks in advance.

Best Regards,
Ng
Boris
Telerik team
 answered on 03 Nov 2014
1 answer
102 views
Hi, we've just updated to the latest Q3 2014 WPF controls and when clicking on the RibbonView backstage menu item we get a System.NullReferenceException.
It doesn't even touch our code before this happens. Is there something we are doing incorrectly here. Prior to this release it was working perfectly.

Stack trace:

A first chance exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Controls.RibbonView.dll
Wed Oct 29 2014 10:35:54.6091 [ERROR] TID:  1 Unhandled Dispatcher exception 
*** EXCEPTION ***
 System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.RadRibbonView.CreateBackstageAdorner()
   at Telerik.Windows.Controls.RadRibbonView.ShowBackstage()
   at Telerik.Windows.Controls.RadRibbonView.ToggleIsBackstageOpen()
   at Telerik.Windows.Controls.RadRibbonView.OnIsBackstageOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.RadRibbonView.set_IsBackstageOpen(Boolean value)
   at Telerik.Windows.Controls.RadRibbonView.AppButtonMouseDown(Object sender, MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   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.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   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, WindowMessage 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, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)    at Telerik.Windows.Controls.RadRibbonView.CreateBackstageAdorner()
   at Telerik.Windows.Controls.RadRibbonView.ShowBackstage()
   at Telerik.Windows.Controls.RadRibbonView.ToggleIsBackstageOpen()
   at Telerik.Windows.Controls.RadRibbonView.OnIsBackstageOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.RadRibbonView.set_IsBackstageOpen(Boolean value)
   at Telerik.Windows.Controls.RadRibbonView.AppButtonMouseDown(Object sender, MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   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.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   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, WindowMessage 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, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Martin Ivanov
Telerik team
 answered on 03 Nov 2014
1 answer
268 views
Is there any way to force a refresh/rebuild of the chart so that the labels are correctly positioned after a runtime change of the font size?  Ideally, in a MVVM way?

Currently, if you bind the font size to a property in the ViewModel and change it, the chart is not repositioned properly to accommodate the change in size.  See attached pics showing undesirable results of changing the font size, both when increasing or decreasing from the initial size.

Here's some code:

<chart:RadCartesianChart.VerticalAxis>
                <chartView:LinearAxis FontFamily="Segoe UI"
                        FontSize="{Binding AxisFontSize}"
                        Title="{Binding AxisTitle}"
                        Minimum="0"
                        Maximum="{Binding AxisMaxValue}"
                        LabelFormat="{Binding AxisLabelFormat}">
                </chartView:LinearAxis>
</chart:RadCartesianChart.VerticalAxis>

public double AxisFontSize
{
    get
    {
        return this._axisFontSize;
    }
    set
    {
        if ( this._axisFontSize != value )
        {
            this._axisFontSize = value;
            this.OnPropertyChanged( "AxisFontSize" );
            this.OnPropertyChanged( "AxisLabelFormat" );
        }
    }
}

What is the best way to accomplish a dynamic font size change?
Peshito
Telerik team
 answered on 03 Nov 2014
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?