Telerik Forums
UI for WPF Forum
1 answer
124 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
100 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
227 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
422 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
253 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
245 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
1 answer
102 views
First, I'm a beginner. I saw the examples/demos but all asume that the list of pages for the book is hardcoded in the program. How to make a book that can load any number of pictures by simply placing those pictures in a folder? Or, better, if those files are listed in a text file or xml file how to read from this file and load the items in the book.
Another issue: In the binding example you are using a xmlns:viewModels="clr-namespace:Telerik.Windows.Examples.Book.Binding". Durring build I get an error about that line (I have exacly the same lines of code as your example and added the same pictures in the project). Can you help me find what I'm missing?
Petar Mladenov
Telerik team
 answered on 04 Jul 2012
10 answers
1.3K+ views
Right now if you change the RadTreeListView.FontSize it changes ALL FONTS on the control.

I want to be able to independently set the Font Size of the data displayed in the rows and the column headers. Basically I want to fix the column header text to one size, and then allow the user to change the font size of the data in the rows.

However it looks really bad when the user is changing this and the header changes with it.  I basically have hooked up the scroll wheel to change the font size on the TreeListView and it works just kind of looks bad that the header is changing with it and would like to lock that down if possible.

Thanks.
Rodney Foley
Top achievements
Rank 1
 answered on 03 Jul 2012
12 answers
337 views
Hi,

We have been using 2010 Q2 all this while. We recently upgraded to 2012 Q1. After the upgrade we are running into multiple issues.

We are using Docking in our application. On one of the radpanes we have gridview. On this gridview the showgrouppanel is set to false.
Now when we undock one of the pinned dockpanes, the gridview displays grouppanel and the data is grouped.
This should not be the case.

Pavel Pavlov
Telerik team
 answered on 03 Jul 2012
3 answers
493 views
Hey Guys,

Can you give me a hand and tell me how to change Background Color of TextBox of disabled DatePicker? I attached the screenshot.

Regards,
Tom
Tom
Top achievements
Rank 1
 answered on 03 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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?