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

It seems that a bug has slipped into the ToggleChildrenVisibilityRecursively method.
Indeed, this method doesn't take into account the property AreChildrenVisible value of the connection target. So even if a shape is declared as collapsed, when a shape parent is expanded, this child shape is also expanded. Unfortunately, the togglebutton doesn't indicate this state.

Below, a proposed solution :

private void ToggleChildrenVisibilityRecursively(Visibility nextVisibility, IShape shape)
{
    foreach (var connection in this.ParentDiagram.GetOutgoingConnectionsForShape(shape))
    {
        connection.Visibility = nextVisibility;
        if (!shape.Equals(connection.Target) && connection.Target != null)
        {
            connection.Target.Visibility = nextVisibility;
            var l_mindshapeTarget = connection.Target as MindmapShapeBase;
            if (nextVisibility == System.Windows.Visibility.Visible && l_mindshapeTarget != null && !l_mindshapeTarget.AreChildrenVisible)
            {
                continue;
            }
            this.ToggleChildrenVisibilityRecursively(nextVisibility, connection.Target);
        }
    }
}

Keep up the good work
Robert
Zarko
Telerik team
 answered on 04 Jul 2012
1 answer
157 views
Hi!

I'm not sure if it is bug, or I'm doing something wrong.

I have a RadDocument-object. When I try to add a picture in the back und export it to a PDF the property RelativeFrom of VerticalPosition doesn't work as expected when it is set to VerticalRelativeFrom.Page. 



private void Pic2PDF()
{
    var doc = new Telerik.Windows.Documents.Model.RadDocument();
    var stream = new FileStream("C:\\temp\\test.pdf", FileMode.Create);
    var pdfExp = new Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider();
    var pic = new FileStream("C:\\temp\\picture.jpg", FileMode.Open);
 
    var image = new Telerik.Windows.Documents.Model.FloatingImageBlock(pic, new Size(150, 150), "jpg");
    image.AllowOverlap = true;
    image.WrappingStyle = Telerik.Windows.Documents.Model.WrappingStyle.BehindText;
    image.HorizontalPosition = new Telerik.Windows.Documents.Model.FloatingBlockHorizontalPosition(Telerik.Windows.Documents.Model.FloatingBlocks.HorizontalRelativeFrom.Page, 250);
    image.VerticalPosition = new Telerik.Windows.Documents.Model.FloatingBlockVerticalPosition(Telerik.Windows.Documents.Model.FloatingBlocks.VerticalRelativeFrom.Page, 250);
    // if I uncomment the next line it works
    //image.VerticalPosition.RelativeFrom = Telerik.Windows.Documents.Model.FloatingBlocks.VerticalRelativeFrom.Paragraph;
 
    doc.InsertInline(image);
 
    pdfExp.Export(doc, stream);
 
}
Iva Toteva
Telerik team
 answered on 04 Jul 2012
1 answer
109 views
First, I have to say it's the best book for C# I've seen. Great product. Amazing features. But I have some wishes...and to see if they are valid and if can be done. Are about how the book looks.
1. First and most important i wish there is a shadow on the inside of the flipped page made by the flipped corner. I belive that this shadow should be in diagonal, parallel to the "bended" end of the page and it should move with it (from diagonal to the center of the page).  I attached an example of where and how the shadows would like to be.
2. Light reflexion on the page durring flip (some white at he end of the gradient)?
3. Also, why is there only one, I mean on one side-page, inner shadow once the book is opened? Plus, i wish we could control all these shadows (if they are applied or not) from some hooks/events in the program...
4. A question: is the book using hardware acceleration durring flip?
5. Durring the hard-page flip, text is flickering a lot. Why is that?
Zarko
Telerik team
 answered on 04 Jul 2012
1 answer
79 views
I have found in this post that the positions can be populated from the code-behind. But I'm wondering whether there is a databind solution for this? To make it more friendly for MVVM?
Andrey
Telerik team
 answered on 04 Jul 2012
1 answer
120 views
My goal is to take a datatable based (dynamic, unknown column names or row values until runtime) gridview and apply formatting or cell styling (column foreground, background, font weight, text wrapping and column width) from settings the user defines. When I generate my columns (GridViewBoundColumnBase) I see that background color is simple but changing the font weight or color seems a mystery...

From what I have read it would be achieved with some sort of converter and datatemplate. Any documentation or examples that could assist me complete this task that actually uses a datatable and could do font weight, color, column background color and text wrapping etc...? I don't want to reinvent the wheel if as much as possible.
Dimitrina
Telerik team
 answered on 04 Jul 2012
1 answer
95 views
Hi,

I am implementing the rad grid at run time.I need to access the value of a cell (say,case_number) in every row by column name,Plz let me know how to do it?

here is my code,

   IList<GridViewRow> rows = radGrid1.ChildrenOfType<GridViewRow>().ToList();
           foreach (GridViewRow  drow in rows)
{
                                   //drv.Cells[1].Text;          I can do this via column index but I need the same with column name
}

Thanks
Vlad
Telerik team
 answered on 04 Jul 2012
6 answers
223 views
Hi,


I've encountered a weird behavior.  I am trying to hide certain parts (table and font formatting) of a RadRichTextBox's content menu using the "Use ContextMenuBuilder class" approach of this example: http://www.telerik.com/help/wpf/radrichtextbox-features-context-menu.html

This is the class I created to hide certain parts of the context menu:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.Windows.Documents.UI.Extensibility;
using Telerik.Windows.Documents.UI;
using Telerik.Windows.Controls.RichTextBoxUI.Menus;
using Telerik.Windows.Documents.Model;
using Telerik.Windows.Controls;
 
 
class CustomMenuBuilder : ContextMenuContentBuilder
{
    private RadRichTextBox radRichTextBox;
 
    public CustomMenuBuilder(RadRichTextBox radRichTextBox)
        : base(radRichTextBox)
    {
        this.radRichTextBox = radRichTextBox;
    }
 
    protected override ContextMenuGroup CreateTableCommands()
    {
        ContextMenuGroup g = new ContextMenuGroup();
        return g;
    }
 
    protected override ContextMenuGroup CreateHyperlinkCommands(bool forExistingHyperlink)
    {
        ContextMenuGroup g = new ContextMenuGroup();
        return g;
    }
 
    protected override ContextMenuGroup CreateTextEditCommands()
    {
        ContextMenuGroup g = new ContextMenuGroup();
        return g;
    }
}


And I then set my RichTextBox to use that new Context menu in another class:

((Telerik.Windows.Controls.RichTextBoxUI.ContextMenu)rtb1.ContextMenu).ContentBuilder = new CustomMenuBuilder(rtb1);

This works perfectly if you only have 1 RichTextBox you want to do this on.  The problem appears if you want to do this on many RichTextBoxes:

((Telerik.Windows.Controls.RichTextBoxUI.ContextMenu)rtb1.ContextMenu).ContentBuilder = new CustomMenuBuilder(rtb1);
((Telerik.Windows.Controls.RichTextBoxUI.ContextMenu)rtb2.ContextMenu).ContentBuilder = new CustomMenuBuilder(rtb2);
((Telerik.Windows.Controls.RichTextBoxUI.ContextMenu)rtb3.ContextMenu).ContentBuilder = new CustomMenuBuilder(rtb3);

Now, if you right click and paste in rtb1 or rtb2, the text appears in rtb3 (the last RichTextBox for which we assigned the menu).  It seems that the 3 menus are pointing to the same instance even though they are all new CustomMenuBuilder  objects.  Any way of hiding context menu sections and having each menu related to the right RichTextBox?

Thanks,

-- Joel
Robert
Top achievements
Rank 1
 answered on 04 Jul 2012
6 answers
417 views
Hi,

I would like to know if it's possible to create a "copy down" functionnality in GridView, a bit like in Excel.

The objective would be to enter values in some cells in the first rown of my grid, to select these cells, and with a contextual menu have a shortcut to "copy these values on every row of my grid".

The objective, is for users to type values only once instead of typing the same value on every row of the grid. I hope i'm clear enough in my explaination.

Thanks a lot for your help!
Doots
Top achievements
Rank 1
 answered on 04 Jul 2012
2 answers
248 views
I Have a GridView bound to a ItemsSource and I'm using mvvm. The problem is when I click "Insert" and/or "Click here to add new item" nothing happens. I can edit the data in the rows and delete row and then grid updates. But not insert new rows.

WPF Code:
<telerik:RadGridView ItemsSource="{Binding WellCompletionEvaluation.CompletionItems}" AutoGenerateColumns="False" CanUserInsertRows="True" Grid.Row="24" Grid.Column="0" Grid.ColumnSpan="6"
               MinHeight="200" MaxHeight="500" ShowInsertRow="True" ShowGroupPanel="False"
               CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed">

In my model I have this kind of code:
public class WellCompletionEvaluationViewModel : ValidatedViewModelBase
    {
        private readonly JobInfoOperationWellCompletionEvaluation model;
 
        public ObservableCollection<WellCompletionEvaluationCompletionItemsViewModel> CompletionItems { get; private set; }
 
 
        public WellCompletionEvaluationViewModel(JobInfoOperationWellCompletionEvaluation model)
        {
            this.model = model;
 
            WTConfiguration = new WellCompletionEvaluationWTConfigurationViewModel(model.WTConfiguration);
 
            this.CompletionItems = new ObservableCollection<WellCompletionEvaluationCompletionItemsViewModel>(
                from p in this.model.completionItems
                select new WellCompletionEvaluationCompletionItemsViewModel(p));
 
             
        }
 
        public JobInfoOperationWellCompletionEvaluation Model { get { return this.model; } }
 
 
        public WellCompletionEvaluationWTConfigurationViewModel WTConfiguration
        {
            get;
            set;
        }
}


ValidatedViewModelBase implements IDataErrorInfo and ViewModelBase that implements INotifyPropertyChanged and IDisposable

Is there something wrong with my view model+

Best Regards
Rune
Rune
Top achievements
Rank 1
 answered on 04 Jul 2012
3 answers
239 views
Hi.

I have a problem with the ScheduleView.  When changing the view from Month to Day, i get a NullReferenceException.

I've attached a sample.

Steps to reproduce the problem :
* run the sample
* expand the cell filled with data
* switch the view to Day

I get a NullReferenceException at that point.

The stack trace is :
  
at Telerik.Windows.Controls.GroupHeader.InitializeColumnsAndUpdateMaxIntersectedAppointmentsCount()
   at Telerik.Windows.Controls.GroupHeader.Initialize()
   at Telerik.Windows.Controls.AppointmentsPanel.AddHeaders(GroupHeader header, Boolean isHorizontal, Boolean showWeekHeaders, Calendar calendar, CalendarWeekRule weekRule, DayOfWeek firstDayOfWeek)
   at Telerik.Windows.Controls.AppointmentsPanel.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
(...)

The xaml i used is :

<Window x:Class="scheduleViewError.MainWindow"
        xmlns:scheduleView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
        Title="MainWindow" Height="350" Width="525">
     
    <Grid>
 
        <telerik:RadScheduleView x:Name="scheduleview" Grid.Row="2" Grid.Column="2" Margin="0"
                                 AppointmentsSource="{Binding Appointments}"
                                 BorderThickness="0 1 1 1"
                                 FirstVisibleTime="06:00">
 
         
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:MonthViewDefinition />
                <telerik:DayViewDefinition />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>
 
</Window>

the code-behind is :

public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new ViewModel();
        }
    }
 
public class ViewModel
    {
        private ObservableAppointmentCollection _apppointments;
 
 
        public ViewModel()
        {
            var today = DateTime.Today;
 
            var x = new ObservableCollection<Appointment>(Enumerable.Range(9, 14).Select(i =>
                new Appointment
                {
                    Start = today.AddMinutes(i * 60 + 15),
                    End = today.AddMinutes((i + 1) * 60),
                    Subject = string.Format("Appointment num. {0}", i),
                }));
 
            _apppointments = new ObservableAppointmentCollection();
            _apppointments.AddRange(x);
 
        }
 
        public ObservableAppointmentCollection Appointments
        {
            get
            {
                return _apppointments;
            }
            set
            {
                if (_apppointments == value)
                    return;
                _apppointments = value;
            }
        }
 
    }


I used the 2012.2.607.40 version of the library with .Net Framework 4.0.

Vladi
Telerik team
 answered on 04 Jul 2012
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
PersistenceFramework
DataPager
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?