I'd love to see this implemented, it would be a natural.
Thanks in advance,
Steve
Is is possible to create bar scale as in the attached image?
Currently I have done it this way:
<
Border
Background
=
"#FF1B1B1F"
CornerRadius
=
"24"
>
<
telerik:RadVerticalLinearGauge
telerik:StyleManager.Theme
=
"Green"
>
<
telerik:VerticalLinearScale
MajorTickBackground
=
"DeepSkyBlue"
MiddleTickBackground
=
"DeepSkyBlue"
MinorTickBackground
=
"DeepSkyBlue"
MajorTickOffset
=
"-10"
MiddleTickOffset
=
"-10"
MinorTickOffset
=
"-10"
Min
=
"0"
Max
=
"100"
LabelLocation
=
"Inside"
MajorTickLocation
=
"Inside"
MinorTickLocation
=
"Inside"
MiddleTickLocation
=
"Inside"
MiddleTicks
=
"2"
MinorTicks
=
"1"
LabelFormat
=
"{}{0:F0} %"
FontSize
=
"20"
Foreground
=
"#FF9EABAA"
Fill
=
"{x:Null}"
>
<
telerik:VerticalLinearScale.Indicators
>
<
telerik:BarIndicator
BorderBrush
=
"{x:Null}"
Value
=
"100"
Background
=
"#FF323232"
/>
<
telerik:BarIndicator
BorderBrush
=
"{x:Null}"
Value
=
"70"
Background
=
"DeepSkyBlue"
/>
</
telerik:VerticalLinearScale.Indicators
>
</
telerik:VerticalLinearScale
>
</
telerik:RadVerticalLinearGauge
>
</
Border
>
I cannot change the width of either the VerticalLinearScale or the BarIndicator objects. So to accomplish what I want, I hid the scale object and added two indicators. The first is the "base color" and the second the actual value indicator. In the end it's just rendering objects, but is there a better way to do this? Not the biggest fan of these "bubble gum solutions".
Also, is there a way to align the whole thing center? So that the bar scale and the tick labels together are always in the center during resizing. I would prefer not to use Padding. Currently there's wasted empty space on the left which makes the whole thing larger than it should be.
And is there a way to round the bar scale itself? Currently I'm rounding the border object, but when the whole thing is resized small enough, the bar scale's sharp corners start to render outside the border's rounder corners.
I can't seem to get rid of the extra space around RadVerticalLinearGauge. Is this a bug or am I missing a property?
Try this code:
<
Grid
>
<
Border B
ackground
=
"#FF1B1B1F" Co
rnerRadius
=
"0"
>
<
telerik:RadVerticalLinearGauge
OuterBorderThickness
=
"0"
OuterBorderBrush
=
"Green"
Background
=
"Red"
telerik:StyleManager.Theme
=
"Green"
>
<
telerik:VerticalLinearScale
MajorTickBackground
=
"DeepSkyBlue"
MiddleTickBackground
=
"DeepSkyBlue"
MinorTickBackground
=
"DeepSkyBlue"
MajorTickOffset
=
"-10"
MiddleTickOffset
=
"-10"
MinorTickOffset
=
"-10"
Min
=
"0"
Max
=
"100"
LabelLocation
=
"Inside"
MajorTickLocation
=
"Inside"
MinorTickLocation
=
"Inside"
MiddleTickLocation
=
"Inside"
MiddleTicks
=
"2"
MinorTicks
=
"1"
LabelFormat
=
"{}{0:F0} %"
FontSize
=
"20"
Foreground
=
"#FF9EABAA"
Fill
=
"{x:Null}"
>
<
telerik:VerticalLinearScale.Indicators
>
<
telerik:BarIndicator
BorderBrush
=
"{x:Null}"
Value
=
"100"
Background
=
"#FF323232"
/>
<
telerik:BarIndicator
BorderBrush
=
"{x:Null}"
Value
=
"70"
Background
=
"DeepSkyBlue"
/>
</
telerik:VerticalLinearScale.Indicators
>
</
telerik:VerticalLinearScale
>
</
telerik:RadVerticalLinearGauge
>
</
Border
>
</
Grid
>
There is a black extra space around the red gauge object. Margin is 0 so that's not the culprit. I added OuterBorderThickness and OuterBorderBrush for demonstration purpose. If I set OuterBorderThickness to 10 the green border is drawn over the black area. Not sure if they are related but something to start with.
Shouldn't the red area fill the entire border object with the above property values? Especially if you remove both OuterBorderThickness and OuterBorderBrush property values from the code.
In my application I bind the value of a textbox to properties of the selected item of a grid.
When do something like (note: grdParts is defined elsewhere and has the default SelectionUnit = FullRow)
<
TextBox
Text
=
"{Binding ElementName=grdParts, Path=SelectedItem.OrderCode}"
/>
the error list shows the error 'SelectedItem' is not accessible. But the application compiles fine and works as intended. My biggest problem is that these 'fake' errors obscure real problems.
A while ago I tackled this problem by adding the ElementName in the Path, but recently (because I updated to the newest Telerik version?) this stopped working, so I had to revert back to this way of binding.
What is wrong with this binding?
Hi,
I'm trying to apply the RowReorderBehavior (example xaml-sdk) in a hierarchical-gridview and wondering how to enable to childgrid for drah-and-drop.
<controls:GridView
x:Name="GridView"
ItemsSource="{Binding Items}">
<telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition />
</telerik:RadGridView.ChildTableDefinitions>
<telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<controls:GridView
x:Name="ChildGrid"
AllowDrop="True"
Drop="UIElement_OnDrop"
ItemsSource="{Binding InvoiceLines}"
RowIndicatorVisibility="Visible"
SelectedItem="{Binding CurrentChild, Mode=TwoWay}">
<controls:GridView.Resources>
<DataTemplate x:Key="DraggedItemTemplate">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Dragging:" />
<TextBlock FontWeight="Bold" Text="{Binding CurrentDraggedItem}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
MinWidth="45"
FontWeight="Bold"
Text="{Binding CurrentDropPosition}" />
<TextBlock Foreground="Gray" Text=", (" />
<TextBlock Text="{Binding CurrentDraggedOverItem}" />
<TextBlock Foreground="Gray" Text=")" />
</StackPanel>
</StackPanel>
</DataTemplate>
</controls:GridView.Resources>
<controls:GridView.RowStyle>
<Style TargetType="telerik:GridViewRow">
<Setter Property="telerik:DragDropManager.AllowDrag" Value="True" />
<Setter Property="telerik:DragDropManager.TouchDragTrigger" Value="TapAndHold" />
</Style>
</controls:GridView.RowStyle>
in the code behind is want to enable the childgrid like: RowReorderBehavior.SetIsEnabled(childgrid, isEnabled);
My problem is how to find the dependencyobject for the childgrid. Trying something like this...
this.GridView.HierarchyChildTemplate.FindName("ChildGrid", ????)
I am trying to bind a dynamically generated menu. I have set up the following style:
<
Style
x:Key
=
"MenuItemStyle"
TargetType
=
"telerik:RadMenuItem"
>
<
Setter
Property
=
"Header"
Value
=
"{Binding Header}"
/>
<
Setter
Property
=
"IsCheckable"
Value
=
"{Binding IsCheckable}"
/>
<
Setter
Property
=
"IsSeparator"
Value
=
"{Binding IsSeparator}"
/>
<
Setter
Property
=
"IsChecked"
Value
=
"{Binding IsChecked}"
/>
<
Setter
Property
=
"Icon"
Value
=
"{Binding IconUrl}"
/>
<
Setter
Property
=
"ItemsSource"
Value
=
"{Binding SubMenuItems}"
/>
<
Setter
Property
=
"Command"
Value
=
"{Binding MenuItemClicked}"
/>
<
Setter
Property
=
"CommandParameter"
Value
=
"{Binding RelativeSource={RelativeSource Self}}"
/>
<
Setter
Property
=
"IconTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
Image
Source
=
"{Binding}"
Stretch
=
"Fill"
/>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
Window.Resources
>
This Generates the menus just fine and they appear exactly as I expect HOWEVER the command does nothing ()i.e. the MENUCLICKED. I have set up the command MenuItemClicked in the ViewModel and correct instantiated it as an ICOMMAND but it never fires the command. What am I missing??. The command is set up as follows:
public ICommand MenuItemClicked { get; set; }
MenuItemClicked = new Command<
RadMenuItem
>(c =>
{
....executesomeciodec);
});
I must have missed something but for the life of me I cannot see what. I know it is bound correctly as the menus are getting populated with the correct properties, icons and layouts.
Please advise - thank you
Hi Progress Telerik,
I have selected an GanttTask in GanttView. The selection is OK. But while exporting the whole GanttArea it is showing with different Task Selection. Please find the attachment for a clear understanding and kindly provide me the solution. I have used the below code which is available in https://github.com/telerik/xaml-sdk/tree/master/GanttView/PrintingAndExporting
var exportSettings = new ImageExportSettings(new Size(816, 1056), true, GanttArea.AllAreas);
using (var export = ganttView.ExportingService.BeginExporting(exportSettings))
{
exportImages = export.ImageInfos.ToList().Select(info => info.Export());
}
Thanks and Regards,
Muhammad Azhar Shah
MSC Technology
I am getting a null reference exception whenever assigning to the RadPdfViewer FixedDocumentPresenter property. The last line of code below is where an exception is thrown. I have also tried to set the FixedDocumentPresenter property by using pdfViewer.GetRegisteredPresenter(), but I get the same exception. I need the presenter to be set so I can get coordinates of the PDF but the value is null.
pdfViewer = new RadPdfViewer();
string pdfFilePath = "C:\\temp\\GeneratedDocument.pdf";
MemoryStream stream = new MemoryStream();
using (Stream input = File.OpenRead(pdfFilePath))
{
input.CopyTo(stream);
}
FormatProviderSettings settings = new FormatProviderSettings(ReadingMode.OnDemand);
PdfFormatProvider provider = new PdfFormatProvider(stream, settings);
RadFixedDocument doc = provider.Import();
pdfViewer.Document = doc;
pdfViewer.MouseDoubleClick += PdfViewer_MouseDoubleClick;
var myPresenter = new FixedDocumentSinglePageViewPresenter();
pdfViewer.FixedDocumentPresenter = myPresenter;
EXCEPTION:Error Message: Object reference not set to an instance of an object.
at Telerik.Windows.Controls.FixedDocumentViewerBase.InitializeFixedDocumentPresenter(IFixedDocumentPresenter releasedPresenter, IFixedDocumentPresenter presenter)
at Telerik.Windows.Controls.FixedDocumentViewerBase.set_FixedDocumentPresenter(IFixedDocumentPresenter value)
Would it be possible to reorder the columns by dragging as in the GridView?
Thanks in advance,
Steve