Telerik Forums
UI for WPF Forum
5 answers
1.1K+ views
I'm using a cell style selector and want to be able to set the border color of a cell. Setting the background color works fine. My code looks something like this:


<my:CellStyleSelector.SmallStadiumStyle>
                    <Style TargetType="telerik:GridViewCell">
                        <Setter Property="Background" Value="Yellow" />
                        <Setter Property="BorderBrush" Value="White"/>
                    </Style>
                </my:CellStyleSelector.SmallStadiumStyle>
Dimitrina
Telerik team
 answered on 03 Sep 2015
3 answers
91 views

Is it possible to change the key binding as follows?

up / down : go to item above or below that is visible in the tree right now
right: open folder to get to children
left: close folder so you don't see children anymore
 

If so can you please point me to documentation on how to override the default behavior?  Thanks.

Yoan
Telerik team
 answered on 03 Sep 2015
1 answer
123 views

Hi,

I am working on localization of Telerik controls for one system. I have noticed the peculiarity in key naming and am trying to standardize the key naming. I am using this specific Telerik control version: 2009.3.1314.35.

1) RadPivotGrid - Pivot prefix
    RadGridView - GridView prefix
    RadRibbonView - RibbonView prefix

2) RadSchedulerView, RadDocking is not using any prefix. A few example keys: Of, Ok, Last, Every, Hide, Floating.

- Any documentation pertaining to the version we are using? Some documentation on Telerik might not be applicable to the particular version we are using as ​it is for the most current version​.

- We have resource files split and categorized alphabetically - A to Z. All the keys in RadGridView starts with GridView and it would mean we has to put all the keys in "G" resource file and that "G" resource would get too unwieldy. I have an idea on how to handle this.

  <data name="GridViewAlwaysVisibleNewRow" xml:space="preserve">
    <value>Click here to add new item</value>
  </data>
  <data name="GridViewFilterSelectAll" xml:space="preserve">
    <value>Select All</value>
  </data> 

The solution is to use a mapping table to map from Telerik string key to resource string key:
i.e.
Mapping table:
GridViewAlwaysVisibleNewRow --> ClickHereToAddNewItemText --> put in "C" resource file
GridViewFilterSelectAll --> SelectAllText --> put in "S" resource file

Any better suggestion?​

Martin Ivanov
Telerik team
 answered on 03 Sep 2015
1 answer
136 views
Hi  ....how to validate autocomplete textbox and normal textbox inside the wpf radgridview  in vb.net
Dimitrina
Telerik team
 answered on 03 Sep 2015
1 answer
182 views

I'd like to use the VisualizationLayer, in a geocoding application situation.  We start with a number of data objects that do not have lat/long data, then add that data, and ideally animate them as they appear on the map. 

These data objects are in an observable collection, and are represented with the following data template:

 

<DataTemplate x:Key="MyDataModelTemplate" DataType="{x:Type models:MyDataModel}">
            <Viewbox x:Name="PART_Shape"
                     HorizontalAlignment="Stretch"
                     VerticalAlignment="Stretch">
                <telerik:MapLayer.Location>
                    <MultiBinding Converter="{StaticResource LatitudeLongitudeToLocationMultiConverter}">
                        <Binding Path="Latitude"/>
                        <Binding Path="Longitude"/>
                    </MultiBinding>
                </telerik:MapLayer.Location>
                <telerik:MapLayer.HotSpot>
                    <telerik:HotSpot X="0.5" Y="0.5"/>
                </telerik:MapLayer.HotSpot>
                <Ellipse Fill="DodgerBlue"
                         Width="15"
                         Height="15"
                         StrokeThickness="1"
                         Stroke="Black"
                         ToolTip="{Binding DisplayName}">
                </Ellipse>
            </Viewbox>
        </DataTemplate>

The converter returns Location.Empty when the latitude ​or longitude are null (they are nullable doubles), otherwise it just returns the Telerik Location object that correspondes to those properties.

 

Here's my problem:

When a location moves from a valid location to another valid location, the ellipse moves accordingly based on the above binding.  But when a location changes from Location.Empty to a valid location, it does not immediately appear.  The user must change zoom levels in order for the location to appear.

Is this a bug in the RadMap control or am I doing something wrong? 

 

Thank you,

Alan

Petar Mladenov
Telerik team
 answered on 03 Sep 2015
1 answer
241 views

 I have an expander containing a grid with a ComboBoxColumn and a template applied in order to provide for the application of a style to result in an embedded search behavior.  Mostly that works well, with one clear problem.  The text displayed in the resulting drop down is truncated and I have been unable to affect this truncation.

 

I doubt the converter I am using to load only distinct values has anything to do with the truncation, but I have include all of the potentially significant code and attached an image of the resulting display with a selection of a row being truncated in the drop down display (not in the grid cell) to demonstrate the problem.  I want to cause the drop down to use the entire width to display the items, and it is not.

 

I will entertain any useful recommendations.  I have tried manually controlling the width of the drop down both with explicit and automatic width settings in the template and it can change the width of the drop down, but the text is still truncated.

 

       <converters:DropDownCodesDistinctOpen x:Key="DropDownCodesDistinctOpen" />

======================================================== 

                    <telerik:RadExpander Style="{StaticResource RatesExpander}" Expanded="RadExpander_Expanded"
                            Header="Time Code (D) Flat" Name="rexTimeCode">
                        <StackPanel>
                            <telerik:RadGridView Style="{StaticResource rgvRatesDetail}"
                                    AddingNewDataItem="rgvTkprClass_AddingNewDataItem"
                                    CellEditEnded="rgvTkprIDActivityCode_CellEditEnded" Name="rgvTimeCode"
                                    RowValidating="IDs_RowValidating">
                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewColumn>
                                        <telerik:GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <telerik:RadButton Height="18" Width="20"
                                                        Command="telerik:RadGridViewCommands.Delete"
                                                        CommandParameter="{Binding}" Name="btnDelete">
                                                    <Image Source="/LawtimeMain;component/Icons/delete.png" />
                                                </telerik:RadButton>
                                            </DataTemplate>
                                        </telerik:GridViewColumn.CellTemplate>
                                    </telerik:GridViewColumn>
                                    <telerik:GridViewComboBoxColumn Width="*"
                                            DataMemberBinding="{Binding Id1, Mode=TwoWay}" 
                                            DisplayMemberPath="Value"
                                            ItemsSourceBinding="{Binding Id1, Converter={StaticResource DropDownCodesDistinctOpen}, ConverterParameter=TC}"
                                            SelectedValueMemberPath="Key"
                                            IsComboBoxEditable="True"
                                            EditTriggers="CellClick"
                                            Header="Time Code"
                                            CellStyleSelector="{StaticResource CellStyleSelector}"
                                            IsSortable="True">
                                        <telerik:GridViewComboBoxColumn.EditorStyle>
                                            <Style TargetType="telerik:RadComboBox">
                                                <Setter Property="ItemContainerStyle" Value="{StaticResource comboBoxItemStyle}" />
                                                <Setter Property="IsFilteringEnabled" Value="True"/>
                                                <Setter Property="StaysOpenOnEdit" Value="True"/>
                                                <Setter Property="OpenDropDownOnFocus" Value="True"/>
                                                <Setter Property="TextSearchMode" Value="Contains" />
                                                <Setter Property="ItemsPanel">
                                                    <Setter.Value>
                                                        <ItemsPanelTemplate>
                                                            <StackPanel/>
                                                        </ItemsPanelTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </telerik:GridViewComboBoxColumn.EditorStyle>
                                    </telerik:GridViewComboBoxColumn>

                                    <telerik:GridViewCheckBoxColumn
                                            CellStyleSelector="{StaticResource CellStyleSelector}"
                                            DataMemberBinding="{Binding IsPercent}" Header="%" />
                                    <telerik:GridViewDataColumn CellStyleSelector="{StaticResource CellStyleSelector}"
                                            DataFormatString="{}{0:n}" DataMemberBinding="{Binding RateOrPct}"
                                            Header="Rate" />
                                </telerik:RadGridView.Columns>
                                <telerik:RadGridView.Resources>
                                    <Style TargetType="TextBlock" />
                                </telerik:RadGridView.Resources>
                            </telerik:RadGridView>
                        </StackPanel>
                    </telerik:RadExpander>

================================================= 

     public class DropDownCodesDistinctOpen : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return LawtimeMain.LMUtils.GetCodeDropDownDistinctOpen(parameter.ToString(),8);

        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return "";
        }
    }
=========================================

        public static List<ddKeyValue> GetCodeDropDownDistinctOpen(string codeType, int? keywidth)
        {
            App ap = (App)Application.Current;
            List<ddKeyValue> ddClass = new List<ddKeyValue>();

            var tkclass = from LTMainService.LTCode a in ap.mpData.LTCodes where a.RecordType == codeType orderby  a.CoCode ,a.Description select a;

            foreach (var a in tkclass)
            {
                if (a.Status != 'C' && LawtimeMain.LMUtils.FindKey(ddClass,a.CoCode.Trim())==null)
                {//could use .contains if I figured out how do to an equality specified dynamically
                    ddKeyValue ddkv = new ddKeyValue();
                    ddkv.Key = a.CoCode.Trim();
                    if (keywidth != null && keywidth > 0)
                    {
                        ddkv.Value = a.CoCode + new String(' ', (int)(keywidth - a.CoCode.Length)) + a.Description.Trim();
                    }
                    else
                    {
                        ddkv.Value = a.CoCode.Trim() + " " + a.Description.Trim();
                    }

                    ddkv.Status = a.Status;
                    ddClass.Add(ddkv);
                }
           }
            return ddClass;
        }

        public static object FindKey(List<ddKeyValue> myList, string key)
        { 
            foreach (var item in myList)
            {
                if (item.Key == key)
                    return item;
            }
            return null;
        }


Nasko
Telerik team
 answered on 03 Sep 2015
1 answer
65 views

Hi, I can't figure how to get edited tasks from the treeview "side" of the control.

 In the "chart" side i have implemented custom drag-and-drop and resize behaviour and i can easily get task's edited start and/or end date, but these behaviour aren't triggered if I edit start-end dates from the tree.

I couldn't find anything in the docs, any help would be appreciated, thanks

Vladi
Telerik team
 answered on 03 Sep 2015
4 answers
246 views

I'm using a RadPropertyGrid to display a categorized list of string fields. I don't want the user to be able to edit the fields, but I do want them to be able to select and copy the text in the fields. In order to do this, I set the IsReadOnly property of the PropertyGrid to True. When I do this, the text fields are grayed-out. I don't like this because it makes the fields hard to read, and it is less obvious to the user that they are able to copy the text in the grayed-out fields.

I have looked all over the place, and tried a number of suggestions, to make the grayed-out fields look like normal fields, but nothing so far has worked. 

The XAML I am using to define the property grid is pretty simple:

<telerik:RadPropertyGrid Grid.Row="1" Name="propGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsGrouped="True" SortAndGroupButtonsVisibility="Collapsed" SearchBoxVisibility="Collapsed" RenderMode="Flat" IsReadOnly="True" Item="{Binding DynItem}" />

The CurrentReadOnly.png file shows the current situation, where the read-only fields are grayed-out. The DesiredReadOnly.png file shows the look I am trying to achieve. 

Is there a way to do this (preferably keeping the rest of the currently selected theme intact).

Martin
Telerik team
 answered on 02 Sep 2015
3 answers
358 views

Hi,

I am surprised that there is no MaxLength attribute for RadAutoCompleteBox.

I want user to free type text and if they don't find what they are looking for, I want to accept the value typed by user.

I figured out that I am unable to restrict the free typing after max length of 15.

How can I implement this ?

 

Nasko
Telerik team
 answered on 02 Sep 2015
2 answers
170 views
How would one change the UI culture for the text in the GroupPanel?  For example, the English content says, "Drag a column header and drop it here to group by that column."  How would that get changed to Spanish, for example?  I suppose this question could apply to all Telerik controls with localization.
Martin
Telerik team
 answered on 02 Sep 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?