Telerik Forums
UI for WPF Forum
1 answer
94 views
Hi all,
I ran into a situation where I programmatically grouped my Grid by a property that was not a column on the Grid using a GroupDescriptor.  It worked fine of course until I tried to persist it.  The GridViewCustomPropertyProvider.cs that I downloaded from Telerik many moons ago expected ColumnGroupDescriptors only.  After some investigation I found that I had to make modifications to support both types.  I share the code here in case someone else also needs this support.

In the ProvideValue method...
case "GroupDescriptors":
    {
        List<GroupDescriptorProxy> groupDescriptorProxies = new List<GroupDescriptorProxy>();
 
        foreach (GroupDescriptorBase descriptor in gridView.GroupDescriptors)
        {
            if (descriptor is GroupDescriptor)
            {
                groupDescriptorProxies.Add(new GroupDescriptorProxy()
                {
                    ColumnUniqueName = (descriptor as GroupDescriptor).Member,
                    SortDirection = descriptor.SortDirection,
                });
            }
            else if (descriptor is ColumnGroupDescriptor)
            {
                groupDescriptorProxies.Add(new GroupDescriptorProxy()
                {
                    ColumnUniqueName = (descriptor as ColumnGroupDescriptor).Column.UniqueName,
                    SortDirection = descriptor.SortDirection,
                });
            }
 
        }
 
        return groupDescriptorProxies;
    }

In the RestoreValueMethod....
case "GroupDescriptors":
    {
        gridView.GroupDescriptors.SuspendNotifications();
 
        gridView.GroupDescriptors.Clear();
 
        List<GroupDescriptorProxy> groupDescriptorProxies = value as List<GroupDescriptorProxy>;
 
        foreach (GroupDescriptorProxy proxy in groupDescriptorProxies)
        {
            GridViewColumn column = gridView.Columns[proxy.ColumnUniqueName];
            GroupDescriptorBase gd = null;
            if (column != null)
            {
                gd = new ColumnGroupDescriptor()
                {
                    Column = column,
                    SortDirection = proxy.SortDirection
                };
            }
            else // assume GroupDescriptor
            {
                gd = new GroupDescriptor()
                {
                    Member = proxy.ColumnUniqueName,
                    SortDirection = proxy.SortDirection
                };
            }
            gridView.GroupDescriptors.Add(gd);
        }
 
        gridView.GroupDescriptors.ResumeNotifications();
    }





Best,
Steve

Yoan
Telerik team
 answered on 14 Aug 2013
1 answer
106 views
When I programmatically change row selection, i would like it to have Keyboard.focus. I did this with TreeView by adding a handler for the TreeViewItem Select event.  I tried to do a similar thing for GridView by adding a handler to the GridViewRow Select event. But this does not work: It gets a "handler type is not valid". I notice that there is a command, "ActivateRow", but I can't find any documentation on what an active row is or how to execute the command.  Does an active row have keyboard focus?  How would I invoke it for the selected row? Or is there another way to do what I what?
Yoan
Telerik team
 answered on 14 Aug 2013
1 answer
200 views
Hi,

I'm using Telerik V2012.2.912.35 and I would like to know why the TimelineViewDefinition doesn't respect the DayEndTime parameter...
When I'm in timeline view, every day time start at my parameter value but it don't stop at my end time parameter.

Thank's
Alain

Here is my piece of code:

                   <scheduleView:RadScheduleView AppointmentEdited="ScheduleView_AppointmentEdited" Grid.Column="1" x:Name="ScheduleView" FirstDayOfWeek="Sunday" ActiveViewDefinitionIndex="1" AppointmentsSource="{Binding}" AppointmentItemContentTemplate="{StaticResource AppointmentTemplate}" ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}" Margin="0 2 2 2">
                        <scheduleView:RadScheduleView.ViewDefinitions>
                            <scheduleView:DayViewDefinition DayStartTime="9:00" DayEndTime="18:00" MajorTickLength="1h" MinorTickLength="15min" TimerulerMajorTickStringFormat="{}{0:H tt}:{0:mm} " TimerulerMinorTickStringFormat=":{0:mm} " GroupHeaderDateStringFormat="{}{0:dddd d MMMM yyyy}" />
                            <scheduleView:WeekViewDefinition DayStartTime="9:00" DayEndTime="18:00" MajorTickLength="1h" FirstDayOfWeek="Monday" VisibleDays="5" MinorTickLength="15min" TimerulerMajorTickStringFormat="{}{0:H tt}:{0:mm} " TimerulerMinorTickStringFormat=":{0:mm} " GroupHeaderDateStringFormat="{}{0:dddd d MMMM yyyy}" />
                            <scheduleView:MonthViewDefinition DayStartTime="9:00" DayEndTime="18:00" TimerulerMajorTickStringFormat="{}{0:d MMMM} " GroupHeaderDateStringFormat="{}{0:dddd d MMMM yyyy}" />
                            <scheduleView:TimelineViewDefinition DayStartTime="9:00" DayEndTime="18:00" TimerulerGroupStringFormat="{}{0:dddd d MMMM yyyy}" TimerulerMajorTickStringFormat="{}{0:%H}h" TimerulerMinorTickStringFormat=":{0:%m}" MajorTickLength="1h" MinorTickLength="15min" MinTimeRulerExtent="30400" MaxTimeRulerExtent="30400" StretchAppointments="True" StretchGroupHeaders="True" />
                        </scheduleView:RadScheduleView.ViewDefinitions>
                    </scheduleView:RadScheduleView>

Kalin
Telerik team
 answered on 14 Aug 2013
12 answers
237 views
How would I display information about the current timeslice the mouse is hovered in? This would be similar to a tooltip, but pertain to whatever zoom level and timeslice (8 PM or the 8th) the timebar is in.
Tsvetie
Telerik team
 answered on 14 Aug 2013
16 answers
446 views

Hi,

I try drag & drop function from gridview1 to gridview2 in wpf application. but i don't know
please help me..

Thanks.

Yoan
Telerik team
 answered on 14 Aug 2013
8 answers
463 views
Hi,

Is it possible to change the background color for special weekdays (for example saturday and sunday) in timeline-view-modus?
Or (as alternative) is it possible to change the column width or visibility for special weekdays. In my scenario I must differentiate between working days and weekend days.

Thanks in advance,

Best regards,
Stefan
Yana
Telerik team
 answered on 14 Aug 2013
1 answer
104 views
I am trying to create a couple connectors automatically when a shape is dragged onto the diagram. I am formatting them to be green and red and have a label that says True and False, that's not an issue. I basically want the True connector to attach to the "Right" connecter at the source and NOT connect to a target but just have the connector go out to the right by 20 pixels or something. This is simply creating a "stub" for the user to route to their next target. 

For this post, we can only talk about the True connector. The problem I'm having is that I want to set the connectors EndPoint just to the right of the "Right" Connector by 20 pixels BUT the connectors AbsolutePosition is returning 0,0. I'm using the ShapeDeserialized event which might be the problem, as the shape is probably not actually on the grid yet.

Here is the line of code I'm talking about:
    tc.EndPoint = new Point(e.Shape.Connectors["Right"].AbsolutePosition.X + 20, e.Shape.Connectors["Right"].AbsolutePosition.Y);

Any suggestions are appreciated.

private void diagram_ShapeDeserialized_1(object sender, Telerik.Windows.Controls.Diagrams.ShapeSerializationRoutedEventArgs e)
{
     
    if(e.Shape.OutgoingLinks.Count() == 0)
    {
        CreateTrueConnection(e);
        CreateFalseConnection(e);
    }
 
    if (e.Shape is IFlowchartStepUI)           
        ((IFlowchartStepUI)e.Shape).LoadStep(_stepsData, e.Shape.Id);
                 
}
 
private void CreateTrueConnection(Telerik.Windows.Controls.Diagrams.ShapeSerializationRoutedEventArgs e)
{
    RadDiagramConnection tc = new RadDiagramConnection();
    tc.Stroke = Brushes.Green;
    tc.StrokeThickness = 2;
 
    // Add the "True" Label
    var lbltrue = new System.Windows.Controls.Label();
    lbltrue.Style = this.FindResource("TrueLabelStyle") as Style;
    lbltrue.Content = "True";
    tc.Content = lbltrue;
 
    //tc.Position = new Point(750, 150);
    tc.SourceConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Right;
    //tc.TargetConnectorPosition = Telerik.Windows.Diagrams.Core.ConnectorPosition.Auto;
    //tc.SourceCapSize = new System.Windows.Size(7, 7);
    //tc.TargetCapSize = new System.Windows.Size(7, 7);
    tc.ConnectionType = Telerik.Windows.Diagrams.Core.ConnectionType.Polyline;
    //tc.StartPoint = new Point(750, 150);
    Console.WriteLine(e.Shape.Connectors["Right"].AbsolutePosition.X.ToString());
    Console.WriteLine(e.Shape.Connectors["Right"].AbsolutePosition.Y.ToString());
    tc.EndPoint = new Point(e.Shape.Connectors["Right"].AbsolutePosition.X + 20, e.Shape.Connectors["Right"].AbsolutePosition.Y);
    tc.TargetCapType = Telerik.Windows.Diagrams.Core.CapType.Arrow2Filled;           
    tc.Source = e.Shape;
    this.diagram.AddConnection(tc);
}
Zarko
Telerik team
 answered on 14 Aug 2013
3 answers
532 views
Hi,
I'm using dynamically generated data for PropertyGrid, bound to property definitions.
What I want to do is to manually add a button control in the PropertyGrid.
How can I manually add a control in code-behind?
Maya
Telerik team
 answered on 14 Aug 2013
0 answers
202 views

hi

i'm using Radgridview , My scenario is i have totals in one row  i need to enter some numbers in next row cells ,when ever i entered number ,based on that number it  calculate % of above totals and the calculated figure should be displayed in next row ..... how to implement this cell triggers using C# plz help me

If you see below attachment u can understand .. if i enter 10 in cell then the calculated total figure should to next row cells

thanks in advance 

Pranavi
Top achievements
Rank 1
 asked on 14 Aug 2013
3 answers
187 views
Hi,

I am trying to create email sender using RichTextBox to allow user write email text with Mail Merge.  I have few extra fields like Mail To and Subject where I want user to be able to enter Mail Merge fields.  In other word, I want to have one RadRichTextBoxRibbonUI

control, but several RichTextBox controls.  For example, when my focus is in Subject field, I should be able to add a Mail Merge to that control. When my focus is in main body, all mail merge fields should go there.  Of course, when I scan through items, both should change.

If someone can attach a sample program, it would be best.

Thank you in advance.

Michael

Boby
Telerik team
 answered on 14 Aug 2013
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?