Hi,
If you set the Item to an IEnumerable, the control strips away all the Attributes of the source properties. For example, the DisplayNameAttribute, or the DescriptionAttribute (all of them). So, what you get is with one item, you see the display names of properties as declared in the class, but then if you supply a List of 2 items, all the display names are shown as the original property name. Kind of odd.
To further confirm, if I hook onto the AutoGeneratingPropertyDefinition event, and I want to add logic like suppress a property if it has the MergableProperty(false) attribute, well, I can't, because the PropertyDefinition.SourceProperty.Descriptor you supply has no Attributes. The collection is empty. You've supplanted the original PropertyDescriptor with a PropertySetPropertyDescriptor that has stripped away much useful information.
Luckily, I can work around all of these problems by matching up property names with the original PropertyDescriptors for the given type, and then fixing up the property definitions, but I don't know, I think you can do this a lot better.
Also, it seems necessary to have to switch the PropertySetMode between 'None' and 1 of the other choices when going from single item to multiple items. Why? Why can't the logic be smart enough to say, if Item is not an IEnumerable, then do single item properties, else if multiple items, then do multi-item logic. The property should not need to change. Changing PropertySetMode causes an internal Refresh, so we must set Item to null first. There are other quirky behaviors I've noticed when going to and from single-item mode and multi-item mode, like with the CategoryAttribute, it can stick in the UI when in Grouped mode, even though the Category heading should disappear, but I'll wait to see what you say to all of this.
Create a couple of RadPanes in one RadPaneGroup so that it shows the tab headers. Create another RadPaneGroup with a RadPane.
Put a RadTreeView in the first RadPane, populate with some items.
OK, select 1 of the TreeView items.
1. If you click on the RadPane header in the separate group to activate it, the selected TreeView item will switch to "SelectedUnfocused" state (turns gray).
2. Click back on the TreeView item to focus it again.
3. This time, click on the other RadPane tab in the same group. Click back on the pane tab header with the TreeView. In this case, the TreeView item is still blue (in a SelectedFocused state). But it actually is not "focused". At least not keyboard focused, so it should be gray.
Code I found :)
If you look in Docking.PaneHeader.OnMouseLeftButtonDown(), when the user selects a RadPaneGroup, Focus() will be called on that group. That is why the RadTreeViewItem turns gray in the first test.
But no such "Focus()" call can be found when only a RadPane is activated. To fix, I put a Focus() call in RadDocking.ActivePaneChanged event, but you may want to do it differently. :)
Hello All,
I have been tasked in a WPF/MVVM application to setup a TreeListView that shows some "Property/Value" pairs. For most of the properties, the value should be a simple textbox, but for some of the particular properties, the values should be displayed as a dropdown selection. Is there a way to get this done. I'm starting down the path of in the table that stores these property/value pairs, have a column that designates what type of "Value" cell show be displayed, the by using that setting up a CellEditTemplate to properly configure the cell as either a textbox or dropdown... Having never created a CellEditTemplate before, I wasn't sure if this is possible or even the correct path to venture down... So, there's my dilemma/question... If this is the correct path, is there a good example of how to get this done???
Thanks in advance,
Kevin Orcutt
Senior Software Engineer
Wurth Electronics ICS, Inc.
7496 Webster St., Dayton, OH 45414
Tel: 937.415.7700
Toll Free: 877.690.2207
Fax: 937.415.7710
Email: Kevin.Orcutt@we-ics.com
http://www.we-ics.com
Hi people,
I have problem with RadGridView and background color: I can't set it ! I have a MVVM application and the grid is bind with observable collection; all my data are displayed correctly:
<
telerik:RadGridView
x:Name
=
"dataGrid"
ItemsSource
=
"{Binding Model, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
AutoGenerateColumns
=
"False"
FrozenColumnCount
=
"1"
CanUserDeleteRows
=
"False"
CanUserInsertRows
=
"False"
GroupRenderMode
=
"Flat"
ShowGroupPanel
=
"False"
ClipboardPasteMode
=
"Default"
SelectionMode
=
"Extended"
SelectionUnit
=
"Cell"
>
<
telerik:GridViewDataColumn
Header
=
"Data"
DataMemberBinding
=
"{Binding Date}"
DataFormatString
=
"{} {0:dd/MM/yyyy}"
IsReorderable
=
"False"
IsSortable
=
"False"
IsFilterable
=
"False"
IsReadOnly
=
"True"
Width
=
"80"
/>
<
telerik:GridViewDataColumn
Header
=
"Flow"
DataMemberBinding
=
"{Binding Flow}"
IsSortable
=
"False"
IsFilterable
=
"False"
IsReadOnly
=
"True"
Width
=
"110"
/>
Now I want to color the row and bind it to property named UserInput (boolean) using converter like this:
internal
class
UserInputConveter : IValueConverter
{
public
object
Convert(
object
value, Type targetType,
object
parameter, System.Globalization.CultureInfo culture)
{
var userInput = (
bool
)value;
if
(userInput)
return
new
SolidColorBrush(Colors.GreenYellow);
return
new
SolidColorBrush(Colors.Transparent);
}
public
object
ConvertBack(
object
value, Type targetType,
object
parameter, System.Globalization.CultureInfo culture)
{
throw
new
NotImplementedException();
}
}
But it doesn't work. I tried:
1)
<
telerik:RadGridView.RowStyle
>
<
Style
TargetType
=
"telerik:GridViewRow"
>
<
Setter
Property
=
"Background"
Value
=
"{Binding UserInput,Converter={StaticResource UserInputConveter}}"
></
Setter
>
</
Style
>
</
telerik:RadGridView.RowStyle
>
Result: all my rows disappear!
2)
<
telerik:GridViewDataColumn.CellStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"{Binding Path=UserInput, Converter={StaticResource UserInputConveter}}"
></
Setter
>
</
Style
>
</
telerik:GridViewDataColumn.CellStyle
>
Result: my single cell disappear.
3)
<
telerik:GridViewDataColumn
Header
=
"Flow"
DataMemberBinding
=
"{Binding Flow}"
IsSortable
=
"False"
IsFilterable
=
"False"
IsReadOnly
=
"True"
Width
=
"110"
Background
=
"{Binding Path=UserInput, Converter={StaticResource userInputConverter}}"
/>
OR
<
telerik:GridViewColumn.Background
>
<
SolidColorBrush
Color
=
"{Binding Path=UserInput, Converter={StaticResource userInputConverter}}"
/>
</
telerik:GridViewColumn.Background
>
Result: the color of cell is thedefault, no change.
Where is my error? How I can do it?
Thanks a lot.
Is there a way to initialize a map to a specific position without having to see the map rapidly pan and zoom?
I have a set of items in a VisualizationLayer and I would like to display those items on the map without scrolling and zooming. The layer is bound to a list in the xaml.
Currently, I set the bounds by calling GetBestView() on the VisualizationLayer to get the precise boundaries. This works, but the map starts at coordinates 0,0 and then scrolls and zooms. It does this for several seconds - the appearance is very annoying to the user.
I would like to be able to set the bounds directly and have the map go straight to the area without scrolling and zooming. It may be that I am not setting the bounds at the appropriate time?
Is this even possible?
Hello,
I started using this custom polyline tool (http://www.telerik.com/forums/polyline-tool) but somehow it does not receive the keyboard input (pressing the Enter key to 'stop' the drawing of the polyline).
The exact same happens with the default PathTool (which should respond to the ESC key as can be seen in the Demo application).
What could this be? I did not find any setting which has anything to do with handling keyboard input.
Best regards,
Douwe
I have a TreeListView control that I need to expand and collapse rows via the view model. The problem is the TreeListView control will sometimes update after updating the view model but not always. Or sometimes the TreeListView control will update after a few seconds. If I scroll to the bottom of the TreeListView control and back it will always refresh to match the correct view model values.
I have put debug statements next to the OnPropertyChanged calls and it always seems to be firing correctly. Since the TreeListView control will sometimes update it seems like it is not a binding issue to me. It's configured to use TwoWay binding. INotifyPropertyChanged is implemented in the view model. It feels like the TreeListView is not always getting the OnPropertyChanged event but I don't know why it would get it sometimes and not other times.
I am thinking I could implement a way to force the TreeListView control to refresh any time the property that IsExpandedBinding is bound to changes but this does not seem like a good solution to me.
Any thoughts as to why this may occur?
I'm using RadGridView with GridViewMaskedInputColumn like that:
<telerik:GridViewMaskedInputColumn DataMemberBinding="{Binding RealCurrent, Mode=TwoWay}" DataFormatString="n2" Width="85" Style="{StaticResource BlueGridViewColumnStyle}" Header="{x:Static commonResources:ControlResources.RealCurrent }"/>
This is great, because in the column I see numbers rounded to 2 digits after decimal point.
But when I want to edit it and I delete whole number I cannot type decimal point...
I can fix it by adding Mask="#1.2", but than I can type only one digit BEFORE decimal point and I see underscore as a placeholder. I don't want to have any limitations for that (user should be able to place 0.55, 45.8, 131645651654.1 or whatever) and any underscores. How to achieve this?