Telerik Forums
UI for WPF Forum
0 answers
81 views

when the window is display at a big monitor

I hide the RadRibbonView by click the expander  on the right ,when click a RadRibbonTab  header  the RadRibbonTab's width is not stretch to the screen' width

How to resolve this

 

rui
Top achievements
Rank 1
 asked on 15 Dec 2017
5 answers
194 views

I have three questions for my project. The output is attached.

  1. The first one is the tooltip is not shown. I tried both DefaultVisualStyle and PointTemplate. This is the main thing so I post it in ToolTip sub-forum.
  2. I want to line up the legend and Y axis. Which means the left side of colorful squares line up with the Y axis of the chart. I guess may  e ItemsPanel can be changed. 
  3. Because I added margin to the series Margin="30,0". So the entire series shifts to the right. a little. Notice the right side the series is beyond the line scope. Is it possible to extend the line so the series is still within the line.
<Grid>
       <StackPanel>
           <telerik:RadCartesianChart Palette="Windows8" Height="300">
               <telerik:RadCartesianChart.Behaviors>
                   <telerik:ChartTooltipBehavior Placement="Top" />
               </telerik:RadCartesianChart.Behaviors>
               <telerik:RadCartesianChart.VerticalAxis>
                   <telerik:LinearAxis Margin="0 0 20 0" MajorTickLength="0" LineStroke="Transparent">
                       <telerik:LinearAxis.LabelStyle>
                           <Style TargetType="TextBlock">
                               <Setter Property="Margin" Value="0 0 10 0" />
                           </Style>
                       </telerik:LinearAxis.LabelStyle>
                   </telerik:LinearAxis>
               </telerik:RadCartesianChart.VerticalAxis>
               <telerik:RadCartesianChart.HorizontalAxis>
                   <telerik:CategoricalAxis Margin="0 20 0 0" MajorTickLength="0" LineStroke="Transparent"/>
               </telerik:RadCartesianChart.HorizontalAxis>
 
               <telerik:AreaSeries CategoryBinding="Category" ValueBinding="YValue"
                               ItemsSource="{Binding Items}" Fill="Blue" Margin="30,0">
                   <telerik:AreaSeries.TooltipTemplate>
                       <DataTemplate>
                           <ItemsControl ItemsSource="{Binding Converter={StaticResource MyConverter}}">
                               <ItemsControl.ItemTemplate>
                                   <DataTemplate>
                                       <TextBlock Text="{Binding}" FontSize="14">
                                       </TextBlock>
                                   </DataTemplate>
                               </ItemsControl.ItemTemplate>
                           </ItemsControl>
                       </DataTemplate>
                   </telerik:AreaSeries.TooltipTemplate>
                   <telerik:AreaSeries.DefaultVisualStyle>
                       <Style TargetType="Path">
                           <Setter Property="Fill" Value="Transparent"/>
                       </Style>
                   </telerik:AreaSeries.DefaultVisualStyle>
               </telerik:AreaSeries>
 
               <telerik:RadCartesianChart.Grid>
                   <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
               </telerik:RadCartesianChart.Grid>
           </telerik:RadCartesianChart>
           <telerik:RadLegend>
               <telerik:RadLegend.ItemsPanel>
                   <ItemsPanelTemplate>
                       <telerik:RadWrapPanel Orientation="Vertical" ItemWidth="120" />
                   </ItemsPanelTemplate>
               </telerik:RadLegend.ItemsPanel>
               <telerik:RadLegend.Items>
                   <telerik:LegendItemCollection>
                       <telerik:LegendItem MarkerFill="#FF55AA33" MarkerStroke="Black" Title="Legend item 1" />
                       <telerik:LegendItem MarkerFill="#FFCC3399" MarkerStroke="Black" Title="Legend item 2" />
                       <telerik:LegendItem MarkerFill="#FF5511BB" MarkerStroke="Black" Title="Legend item 3" />
                       <telerik:LegendItem MarkerFill="#FF55AA33" MarkerStroke="Black" Title="Legend item 4" />
                       <telerik:LegendItem MarkerFill="#FFCC3399" MarkerStroke="Black" Title="Legend item 5" />
                       <telerik:LegendItem MarkerFill="#FF5511BB" MarkerStroke="Black" Title="Legend item 6" />
                       <telerik:LegendItem MarkerFill="#FF55AA33" MarkerStroke="Black" Title="Legend item 7" />
                       <telerik:LegendItem MarkerFill="#FFCC3399" MarkerStroke="Black" Title="Legend item 8" />
                       <telerik:LegendItem MarkerFill="#FF5511BB" MarkerStroke="Black" Title="Legend item 9" />
                   </telerik:LegendItemCollection>
               </telerik:RadLegend.Items>
           </telerik:RadLegend>
       </StackPanel>
   </Grid>

The converter is simple, it is just returning a string.

public class MyConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return "Test";
        }
 
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

Thanks.

Trump
Top achievements
Rank 1
 answered on 14 Dec 2017
5 answers
349 views

I want to add an apply button to the end of the "add new item" button when the NewRowPosition is set to e.g. Top.

After investigating which controls are involved, I tried to override the default style of DataCellsPresenter but the ItemsPresenter there seems to give me headache. Haven't used ItemsPresenter before so maybe the behavior is normal or it's modified elsewhere in your code.

Here's my modified style:

    <Style x:Key="customDataCellsPresenter" TargetType="{x:Type telerik:DataCellsPresenter}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:DataCellsPresenter}">
                    <Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <ItemsPresenter Grid.Column="0"/>
                            <Button Grid.Column="1">Click Me!</Button>
                        </Grid>            
                        <telerik:FrozenColumnsSplitter x:Name="PART_FrozenColumnsSplitter" telerik:DragDropManager.AllowDrag="True" telerik:DragDropManager.AllowCapturedDrag="True" Cursor="SizeWE" telerik:TouchManager.DragStartTrigger="TapHoldAndMove" HorizontalAlignment="Left" IsTabStop="False" Stylus.IsFlicksEnabled="False" Stylus.IsPressAndHoldEnabled="False">
                            <telerik:StyleManager.Theme>
                                <telerik:Windows8TouchTheme/>
                            </telerik:StyleManager.Theme>
                        </telerik:FrozenColumnsSplitter>
                    </Grid>    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <telerik:GridViewCellsPanel IsItemsHost="True"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>

 

The ItemsPresenter seem to span over the button. I.e., the button is not visible. If I excplicitely change column's width from * to 128, the button is shown and the ItemsControl is smaller, but it is clipped after 128 pixels.

Is there another way to add a button to the end of the new item button? I want the user to be able to use the grid with only touch screen (i.e. no physical keyboard available). A cancel button would be needed also.

The optimal solution would be if the user taps elsewhere on the screen (not just the RadGridView control) but there's only one button on the screen ("Back") so that won't do. I.e., no other controls to transfer the focus to. Propably needs some sort of "global" click/tap listener and hit test class...

Vladimir Stoyanov
Telerik team
 answered on 14 Dec 2017
1 answer
300 views

Ok,

I have a treeview that is LoadOnDemand. I have a HierarchicalDataTemplate and within it I define a RadContextMenu.

Currently, I am setting the ItemClicked event handler and calling the ViewModel from code behind. It all works, but I know I am being a bad boy calling the viewmodel from the codebehind. 

 

Here's what I'd like to do: 

Somehow, bind a command to the HierachicalDataTemplate so that I have a single function that receives all context menu clicks via a command. I should be able to sort out which context menu item was clicked in the command parameter (I think).

I have tried adding an EventToCommandBehavior to the HierachicalDataTemplate, but the compiler whines that nested properties are not supported.

I get this because I am already using EventToCommandBehavior in the treeview itself.

It seems that putting an additional EventToCommandBehavior in the HierarchicalDataTemplate is a no-go.

How can I receive commands from context menus generated in a loadondemand treeview and have it be MVVM friendly?

Thanks ... Ed

 

Stefan
Telerik team
 answered on 14 Dec 2017
1 answer
505 views

Right now I set up the label's margin in xaml

<telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis MajorTickLength="0" LineStroke="Transparent">
                      <telerik:CategoricalAxis.LabelStyle>
                           <Style TargetType="TextBlock">
                                <Setter Property="Margin" Value="20 10 15 20" />
                           </Style>
                      </telerik:CategoricalAxis.LabelStyle>
                </telerik:CategoricalAxis.LabelStyle>
</telerik:RadCartesianChart.HorizontalAxis>

But I want to use property binding, so I created the property in View Model. The type of property is Thickness. But it is not working. I doubt that CategoricalAxis doesn't support it because I saw an example.

Thanks for advice.

Dilyan Traykov
Telerik team
 answered on 13 Dec 2017
3 answers
195 views

In order to create a Custom editor with RadGridView by following a guide at: Create Custom Editor with RadGridView

It looks OK, but I would change the DataMemberBinding to Int32 instead of System.Windows.Media.Color, because System.Windows.Media.Color belongs to View class I don't really want to use it in my ViewModel. The converter looks like:

public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
      int num= System.Convert.ToInt32(value);
      Color color;
      byte[] bytes = BitConverter.GetBytes(num);
      color = Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]);
      return new SolidColorBrush(color);     
 }

 

The converter get correct value for control, but when I change color from CorlorPicker, it get validation error in the cell and it says: Object of type "System.Windows.Media.Color" cannot be converted to type "System.Int32".

Any idea to resolve the problem? Thanks in advance.

 

Quang Khải
Top achievements
Rank 1
 answered on 13 Dec 2017
4 answers
175 views

I use gridview to display a datatable, when columns count is 2000 and rows count is 100, the UI can not render out,

there is a compromise solution is divide the datatable and display them by many gridview side by side,but when drag the horizontal scroll bar,it is not smooth

How to raise the rendering efficiency of gridview

and is there a probably render limit of the gridview , how many columns and how many rows

 

rui
Top achievements
Rank 1
 answered on 13 Dec 2017
4 answers
161 views

Hi,

I created a little UI that allow user to personalize the GridView properties.

I a section of this UI, a user can add a "Format Condition" defining an Expression (using RedExpressions) and some Style preferences, in example a row background.

When a FormatCondition class is created, in the constructor, I add a StyleRule to GridView.RowStyleSelector, I bind the StyleRuleCondition to FormatCondition.Condition and I'm waiting for BackGround changes:

            Grid = g;
            Css = (ConditionalStyleSelector)(g.RowStyleSelector ?? (g.RowStyleSelector = new ConditionalStyleSelector()));
            StyleRule = new StyleRule();
            StyleRule.Bind(StyleRule.ConditionProperty, Condition, converter: new Converters.FunctionConverter<string, System.Linq.Expressions.Expression>(Convert));
            StyleRule.Style = new System.Windows.Style(typeof(GridViewRow)
, (Style)Application.Current.FindResource("GridViewRowStyle"));
            Css.Rules.Add(StyleRule);
            BackGroundColor.ValueChanged += (p) => ResetBg();

If BackGround change I edit the Background setter:

if (BgSetter != null) Style.Setters.Remove(BgSetter);

BgSetter = null;

if (!BackGroundColor.Value.HasValue) return;

BgSetter = new Setter(GridViewRow.BackgroundProperty, new SolidColorBrush(BackGroundColor.Value.Value));
Style.Setters.Add(BgSetter);

 

I think this is logically correct but Grid Style don't change until a rows refresh occours.

How I can force grid to re-evaluate row stryle rules?

marc.

Marcello
Top achievements
Rank 1
Iron
 answered on 13 Dec 2017
0 answers
87 views
I'am using the HTMLExportHelper example to export my RadDiagram's to HTML and I'am wondering if it would be possible to display scrollbars inside the html diagram when zoomed in. The problem is that a lot of users don't even realize that the Diagram is bigger than whats visible on the screen without scrollbars. Does anyone have an idea if this is even possible with HTML 5?
Davidm
Top achievements
Rank 1
 asked on 12 Dec 2017
1 answer
179 views
Hello Sirs,

I'm using RadVirtualGrid with a Custom DataProvider in which I would like to have a column with buttons. These buttons must have an image and a Click event.
Could you sirs please help me with it?

Thanks in advance,
Stefan
Telerik team
 answered on 12 Dec 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?