Telerik Forums
UI for WPF Forum
1 answer
162 views
Hi,
I'm trying to use multi-seleciton in PropertyGrid and the following problems occurred:

1. When I set SelectionMode to multi in Xaml and try to switch it to Single mode in code-behind, it doesn't work.
2. When I set NestedPropertiesVisibility="Visible", it worked fine in the single selection mode, but doesn't work in the multi selection mode.
3. Data Annotations set in the Display attriute doesn't work.
3. DataTemplateSelection does not work properly as in the single selection. For example, I get
PropertyType : {Name = "Object" FullName = "System.Object"} System.Type {System.RuntimeType}
for the code below.

public class PropertyGridDataTemplateSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item as PropertyDefinition != null && (item as PropertyDefinition).SourceProperty.PropertyType == typeof(Int32))
            {
                return IntegerPropertyDataTemplate;
            }
            return null;
        }

        public DataTemplate IntegerPropertyDataTemplate { get; set; }
    }

Can you get this fixed?
Thanks!

Maya
Telerik team
 answered on 14 Aug 2013
1 answer
90 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
104 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
193 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
232 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
443 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
456 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
103 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
508 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
198 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?