Telerik Forums
UI for WPF Forum
1 answer
266 views
I define a custom style for RadComboBoxItem, i want to change HighlightVisual, so i change the controltemplate.
It's works, but when i specify the DisplayMemberPath in my comboBox, the toString() property is used but not the DisplayMemberPath.
Thanks.

<Style x:Key="RadComboBoxItemStyle"
           TargetType="{x:Type telerik:RadComboBoxItem}">
        <Setter Property="MinHeight"
                Value="19" />
        <Setter Property="Margin"
                Value="0,-1,0,0" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="BorderBrush"
                Value="Transparent" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Padding"
                Value="3,2" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="FocusVisualStyle"
                Value="{x:Null}" />       
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadComboBoxItem}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="HighlightVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="Content">
                                            <DiscreteDoubleKeyFrame KeyTime="0"
                                                                    Value="0.33" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Border x:Name="HighlightVisual"
                                    BorderBrush="{StaticResource ControlFocusedBrush}"
                                    BorderThickness="1"
                                    CornerRadius="0"
                                    Visibility="Collapsed">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1"
                                                         StartPoint="0.5,0">
                                        <GradientStop Color="#FFFFFBDA"
                                                      Offset="0" />
                                        <GradientStop Color="#FFFFFBA3"
                                                      Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Border BorderBrush="White"
                                        BorderThickness="1"
                                        CornerRadius="0" />
                            </Border>
                            <ContentPresenter x:Name="Content"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Content="{TemplateBinding Content}"
                                              ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Margin="{TemplateBinding Padding}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


Vladi
Telerik team
 answered on 28 Jun 2012
6 answers
200 views

Hello

Is there option add new rows by default

 When the users get to the end of the row Like in SQL?

Best regards

Ehud

Dimitrina
Telerik team
 answered on 28 Jun 2012
3 answers
199 views
I just installed Q2 2012 and now the diagram doesnt save the background of the shapes. 
The background was properly saved in the previous version. I have included the diagram config and the 
output file. the docs say Background is automatically saved but I am not getting it. I tried using the 
serialize/deserialize methods but that just gives me a blank background for the shapes. 
How can I get the background

<tk:RadDiagram x:Name="diagram" HorizontalAlignment="Stretch" BorderThickness="0" Margin="5,2,2,2"
		tk:DiagramSurface.IsVirtualizing="True" AllowCopy="False" IsPanEnabled="False" IsZoomEnabled="False" IsEditable="False"
                AllowCut="False" AllowDelete="False" AllowPaste="False" IsConnectorsManipulationEnabled="False" IsBackgroundSurfaceVisible="False"
                Loaded="diagram_Loaded" SizeChanged="diagram_SizeChanged" ShapeSerialized="diagram_ShapeSerialized" ShapeDeserialized="diagram_ShapeDeserialized"
                Drag="diagram_Drag" Resize="diagram_Resize" Rotate="diagram_Rotate" ShapeClicked="diagram_ShapeClicked" >
</tk:RadDiagram>


<?xml version="1.0" encoding="utf-8"?>
<RadDiagram Type="Telerik.Windows.Diagrams.Core.IGraphInternal" Version="2012.2">
<Metadata Type="Telerik.Windows.Controls.RadDiagram" Id="9ca231cc-84d5-4729-ac75-6bf52c99cf99" BackgroundImage="C:\hal\Acclima\code\IrrigMgr\Map_346516.jpg" Zoom="1" Position="0;0" IsRotationEnabled="true" IsResizingEnabled="true" IsManipulationAdornerVisible="true" SelectionMode="Extended" IsSnapEnabled="true" SnapX="20" SnapY="20" IsBackgroundSurfaceVisible="false" IsEditable="false" IsDraggingEnabled="true" IsPanEnabled="false" IsZoomEnabled="false" IsConnectorsManipulationEnabled="false" AllowDelete="false" AllowCut="false" AllowCopy="false" AllowPaste="false">
<Title>Diagram [6/20/2012 7:15:55 PM]</Title>
<Description/>
<Background>#FFFFFFFF</Background>
</Metadata>
<Groups />
<Shapes QNs="Telerik.Windows.Controls.Diagrams, Version=2012.2.607.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7;">
<RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="65a360f7-d29d-4249-a31e-2bdfbaa9314b" ZIndex="1" Position="140;300" Content="1" Size="50;50" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M0.5,0.5L111.5,0.5 111.5,74.5 0.5,74.5z" QN="0" Tag="zone" Opacity="0.85" />
<RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="ed57edca-df4f-45b7-9ed0-623f1eafa076" ZIndex="1" Position="320;350" Content="2" Size="50;50" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M0.5,0.5L111.5,0.5 111.5,74.5 0.5,74.5z" QN="0" Tag="zone" Opacity="0.85" />
<RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="f8f09e12-11c8-4a9a-9abc-a6c623b7901d" ZIndex="1" Position="780;350" Content="3" Size="50;50" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M0.5,0.5L111.5,0.5 111.5,74.5 0.5,74.5z" QN="0" Tag="zone" Opacity="0.85" />
<RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="85f55681-3a7e-452e-a8cf-984d724a5309" ZIndex="1" Position="680;160" Content="1" Size="35;35" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M111.5,37.5C111.5,57.91 86.67,74.5 56,74.5 25.33,74.5 0.5,57.91 0.5,37.5 0.5,17.09 25.33,0.5 56,0.5 86.67,0.5 111.5,17.09 111.5,37.5z" QN="0" Tag="device" Opacity="0.85" />
<RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="b6dc0f75-efb2-4ce5-a196-0094494e86f2" ZIndex="1" Position="620;315" Content="5" Size="35;35" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M111.5,37.5C111.5,57.91 86.67,74.5 56,74.5 25.33,74.5 0.5,57.91 0.5,37.5 0.5,17.09 25.33,0.5 56,0.5 86.67,0.5 111.5,17.09 111.5,37.5z" QN="0" Tag="device" Opacity="0.85" />
<RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="c2387d2e-4851-4a06-914d-894206908a7f" ZIndex="1" Position="180;140" Content="10" Size="35;35" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M111.5,37.5C111.5,57.91 86.67,74.5 56,74.5 25.33,74.5 0.5,57.91 0.5,37.5 0.5,17.09 25.33,0.5 56,0.5 86.67,0.5 111.5,17.09 111.5,37.5z" QN="0" Tag="device" Opacity="0.85" />
<RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="f727cafc-5f14-46e4-9a79-84bfcd704130" ZIndex="1" Position="285;220" Content="7" Size="35;35" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M111.5,37.5C111.5,57.91 86.67,74.5 56,74.5 25.33,74.5 0.5,57.91 0.5,37.5 0.5,17.09 25.33,0.5 56,0.5 86.67,0.5 111.5,17.09 111.5,37.5z" QN="0" Tag="device" Opacity="0.85" />
</Shapes>
<Connections />
</RadDiagram>
Alex Fidanov
Telerik team
 answered on 28 Jun 2012
1 answer
84 views
Is UI Virtualization possible in RadRibbonGallery?
Thanks
Deepak
Viktor Tsvetkov
Telerik team
 answered on 28 Jun 2012
1 answer
64 views
Hi,

My company is using a RadScheduleView in one of our products, but we have come across a weird issue with the calendar.
It gets into a state where the days will repeat themselves diagonally and each time you select a day it selects all of the days with the same date. Is there any insight that you can provide to fix it or is it a problem with the control itself?

Thank you,
Eric
Yana
Telerik team
 answered on 28 Jun 2012
2 answers
171 views
Is there some way that the GridView could detect that a column value was an image url while in AutoGenerateColumns = True mode?
I have a data source that has a lot of regular data and one column that is a thumbnail of the product image.  I know I can set AutoGenerateColumns = False and create a column for each individual data element but it would be nice if AutoGenerate could detect that a data element was an ImageColumn and use the URL in the data as the source.
Chris
Top achievements
Rank 1
 answered on 27 Jun 2012
6 answers
349 views
When a user clicks a button I want to loop through the entire grid, row by row, reading the value of a specific column cell.

Can you tell me the easiest, most efficient way to accomplish this?

Thank you very much.
Ben
Top achievements
Rank 1
 answered on 27 Jun 2012
6 answers
166 views
A simplified explanation of what I need...

I have a GridView control bound to a dataset.  Column A (editable) and Column B (Read Only).

When a user changes Column A, a calculation is run in the code behind and Column B changes.

It seems simple enough, but I'm having trouble getting values in my GridView to change through code.  Can someone please post a simple example of how to do this?

Thank you in advance.
Ben
Top achievements
Rank 1
 answered on 27 Jun 2012
7 answers
354 views
I've tried everything I can think of to get this binding to work...

My situation is this:

I have a grid which has Columns generated in the code behind.  These are dynamic depending on something the user has chosen.  Each column has its Tag property set to a related object.

The rows are a collection bound to ItemsSource.  There is no corresponding property on the underlying item that matches a column, but there is a method that will return an object (e.g. item.GetItemForCell(string columnTag).

What I need is for a binding for the Cell to be able to return the correct object, and allow editing of the object.  For this, I need to get the row and the column it's in (for row.Item.GetItemForCell(column.Tag))

To do this, I've tried creating a converter that is expecting a GridViewCell (alternatively it could just take the column as a parameter).  To use this, I've set up a binding in the code behind as follows:

var binding = new Binding(".");
binding.Mode = BindingMode.TwoWay;
binding.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(GridViewCell), 1);
binding.Converter = new FactProxyConverter();

This is then applied to the DataMemberBinding of the GridViewDataColumn.

This... sort of works.  The converter is called with the GridViewCell, and each cell shows a "ToString()" representation of the object.

So I thought I'd put a cell template on.  I set CellTemplate in the code behind to FindResource("template").  But the binding doesn't bind to the converted object, it binds to the row's Item property.  Argh!

I tried creating a DataTemplate resource with the DataType of the object I want to template, but it's ignored.

I tried moving the binding to the DataTemplate, but even using the same binding as above the row's Item property is passed to the converter rather than the GridViewCell.

Any ideas?!  It doesn't seem like that big an ask, but I feel like I've been banging my head against a wall all day.
Ivan Ivanov
Telerik team
 answered on 27 Jun 2012
3 answers
124 views
Hello,

I have a GridView which is readonly and a GridViewCheckBoxColumn which is not readonly and the checkbox can be ticked and unticked. However when I tick and untick and update the bound property, the value gets persisted to the data store which I imagine is default behaviour if the cell value (i.e. true or false for a checkbox) is valid. This is no good in my scenario. I need to be able to edit this checkbox and update the bound property but NOT persist to the data store; I will do this later in the code myself. How is this achievable please?

I used the MainGrid_CellValidating event and set IsValid to false but this shows up the red border around the cell which I do not need.

Please help.

Thanks,

Alex
Dimitrina
Telerik team
 answered on 27 Jun 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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?