Telerik Forums
UI for WPF Forum
3 answers
58 views
We are trying to develop an RadGridView that has two possible styles/templates for each row and are toggled based on the edit status of any cell within the same row.

Two Row Styles
1) Normal/Initial Status
The row shows basic text-only details
Sample cell contents:  "State - NY"

2) Cell-being-edited Status
When a cell is being edited, it will show labels, comboboxes, datepickers, etc depending on the data type
Sample cell contents: "State - [ComboBox with NY selected]"
(Only one row can be selected and one cell can be edited at any one time)

Behavior
All rows start out in status 1. If a cell is clicked on for editing, that cell and all other cells in that same row switch to status 2.

Roadblocks
We have tried using a DataTemplateSelector to do this logic, but we are having trouble with two aspects
a) What is the best property to key off of in the DataTemplateSelector.SelectTemplate function? What is best way to set the style of all cells based on the edit status of one cell?
b) How can we get DataTemplateSelector.SelectTemplate to evaluate both when a cell is edited and when editing is complete? We can get the cell to change to style 2 upon edit, but not back to style 1 one the edit is complete (CommitEdit or row loses focus)

Thanks for reading
Vlad
Telerik team
 answered on 07 Dec 2011
3 answers
246 views
Hello team,

I have a view (window) with RadGridView which displays multiple columns. I want to utilize the available realestate on the screen as much as possible. The window has font magnifier using which user can select their font size. When the user switch from higher font size to lower the GridView does not adjust row height and column width for the content and wastes more real estate.

Can you recomend a solution to override the default behavior?

NOTE: Attached a sample project

Regards
Selvam Paramasivan
Vlad
Telerik team
 answered on 07 Dec 2011
0 answers
63 views
Hi,

I'm in .Net 3.5, VS2008 and Telerik 2011.3.1116.35 and with one of my form I have the following exception in my designer section:

Exception has been thrown by the target of an invocation.

at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Delegate.DynamicInvokeImpl(Object[] args) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

 

Ambiguous match found.

at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) at System.Type.GetProperty(String name) at MS.Internal.ComponentModel.DependencyPropertyKind.get_IsDirect() at MS.Internal.ComponentModel.DependencyPropertyKind.get_IsAttached() at MS.Internal.ComponentModel.APCustomTypeDescriptor.GetProperties(Attribute[] attributes) at MS.Internal.ComponentModel.APCustomTypeDescriptor.GetProperties() at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultExtendedTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties() at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes) at System.ComponentModel.TypeDescriptor.GetProperties(Object component) at MS.Internal.Model.ModelPropertyCollectionImpl.GetProperties(String propertyNameHint) at MS.Internal.Model.ModelPropertyCollectionImpl.<GetEnumerator>d__0.MoveNext() at MS.Internal.Designer.PropertyEditing.Model.ModelPropertyMerger.<GetFirstProperties>d__0.MoveNext() at MS.Internal.Designer.PropertyEditing.Views.PropertyEntryReader.RedraftEntries(IPropertyViewManager viewManager, Selection selection, Boolean attachedOnly, IEventCodeBehindProxy eventCodeBehindProxy, CategoryList categoryList) at MS.Internal.Designer.PropertyEditing.PropertyInspector.UpdateCategories(Selection selection, Boolean attachedOnly, IEntryReader entryReader) at MS.Internal.Designer.PropertyEditing.PropertyInspector.RefreshPropertyList(Boolean attachedOnly) at MS.Internal.Designer.PropertyEditing.PropertyInspector.OnSelectionChangedIdle()


Thank's
Oliver
Top achievements
Rank 1
 asked on 07 Dec 2011
0 answers
159 views
Hello!
I have a next XAML in my Dictionary:


<Style TargetType="{x:Type telerik:GridViewRow}">
  <Style.Triggers>
    <Trigger Property="IsSelected" Value="True">
      <Setter Property="Background" Value="{StaticResource SelectedBrush}"/>
      <
Setter Property="Foreground" Value="{StaticResource SelectedForeground}"/>
    </Trigger>  
    <Trigger Property="IsMouseOver" Value="True">
      <Setter Property="Background" Value="{StaticResource SelectedBrushLight}"/>
      <
Setter Property="Foreground" Value="{StaticResource SelectedForegroundLight}"/>
    </
Trigger>
  </Style.Triggers>
</Style>
<Style TargetType="{x:Type telerik:GridViewCell}">
  <Style.Triggers>
    <Trigger Property="IsSelected" Value="True">
      <Setter Property="Background" Value="{StaticResource SelectedBrush}"/>
      <
Setter Property="Foreground" Value="{StaticResource SelectedForeground}"/>
    </
Trigger>
    <Trigger Property="IsMouseOver" Value="True">
      <Setter Property="Background" Value="{StaticResource SelectedBrushLight}"/>
      <Setter Property="Foreground" Value="{StaticResource SelectedForegroundLight}"/>
    </Trigger>
  </Style.Triggers>
</Style>

  So, i need set background for all row about Mouse Over. How to me it to make?
Anatoly
Top achievements
Rank 1
 asked on 06 Dec 2011
1 answer
48 views
Hello,
I was wondering if it's possible to have a Column footer for each GridViewRow I've in my application, even if I've different columns... is it possible?
Thanks
Paolo
Vlad
Telerik team
 answered on 06 Dec 2011
2 answers
228 views
I'm using GridView version 2011.3.1116.40.

<telerik:RadGridView ItemsSource="{Binding Jobs}" AutoGenerateColumns="False" ShowInsertRow="False"
                     IsReadOnly="False" CanUserDeleteRows="False" CanUserFreezeColumns="True"
                     CanUserInsertRows="False" CanUserReorderColumns="True" CanUserSelect="True"
                     RowIndicatorVisibility="Collapsed" Margin="0,0,0,-12" >
    <telerik:RadGridView.RowDetailsTemplate>
        <DataTemplate>
            <telerik:RadTabControl TabStripPlacement="Left" TabOrientation="Vertical">
                <telerik:RadTabItem Header="History">
                    <telerik:RadGridView ItemsSource="{Binding History}" AutoGenerateColumns="False" ShowGroupPanel="False" ShowInsertRow="False" IsReadOnly="True">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Name="ActionDate" DataMemberBinding="{Binding ActionDate}" Header="Date" DataFormatString="{} {0:D}" />
                            <telerik:GridViewDataColumn Name="ActionTime" DataMemberBinding="{Binding ActionTime}" Header="Time" />
                            <telerik:GridViewComboBoxColumn ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=Page}, Path=DataContext.Users}"
                                                                SelectedValueMemberPath="OID"
                                                                DataMemberBinding="{Binding UserInitiator}"
                                                                DisplayMemberPath="FullName"
                                                                Header="Name"
                                                                IsComboBoxEditable="False" />
 
                            <telerik:GridViewComboBoxColumn DisplayMemberPath=""
                                                                ItemsSource="{Binding Source={StaticResource historyEventType}}"
                                                                DataMemberBinding="{Binding HistoryType}"
                                                                Header="Action"
                                                                IsComboBoxEditable="False" />
                            <telerik:GridViewDataColumn Name="Reason" DataMemberBinding="{Binding ReasonDescription}" Header="Reason" DataFormatString="{} {0:D}" />
 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Notes}" Header="Notes"/>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </telerik:RadTabItem>
 
            </telerik:RadTabControl>
 
        </DataTemplate>
    </telerik:RadGridView.RowDetailsTemplate>           
    <telerik:RadGridView.Columns>
        <telerik:GridViewToggleRowDetailsColumn ExpandMode="Single" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding FeederSourceName}" Header="Feeder Source" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding NPSOffenceDescription}" Header="Offence Code" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding NPSLocation}" Header="Location" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding VRM}" Header="VRM" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding NPSMakeModel}" Header="Make/Model" IsReadOnly="True"/>               
        <telerik:GridViewDataColumn DataMemberBinding="{Binding TimeStampDate}" Header="Offence Date" DataFormatString="{} {0:D}" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding TimeStampTime}" Header="Offence Time" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding ProcessedDatePart}" Header="Input Date" DataFormatString="{} {0:D}" IsReadOnly="True"/>
 
        <telerik:GridViewDataColumn DataMemberBinding="{Binding ProcessedTimePart}" Header="Input Time" IsReadOnly="True" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Status}" Header="Status" IsReadOnly="True" />
        <telerik:GridViewComboBoxColumn ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=Page}, Path=DataContext.Queues}"
                                                                SelectedValueMemberPath="OID"
                                                                IsReadOnly ="{Binding RelativeSource={RelativeSource AncestorType=Page}, Path=DataContext.CanChangeJobQueue, Converter={StaticResource NotConverter}}"
                                                                DataMemberBinding="{Binding Queue!Key}"
                                                                DisplayMemberPath="Name"
                                                                Header="Assign To Queue"
                                                                IsComboBoxEditable="True"/>
 
    </telerik:RadGridView.Columns>
</telerik:RadGridView>


When a page is initally loaded, my column widths are fine and default to that of the longest value. The grid is too wide for the page so I can scroll it horizontally.

If I use the thumb on the scroll bar to move right 'slowly' then the widths are preserved (see attachment 'small scroll to right'). However, if I scroll to the right more aggresively using the scroll bars 'Large Change' value then the width of the columns on the right all seem to expand to match a common denominator that I don't want (see attachment 'large scroll to right').

Is there a property I can set on the grid or columns to stop this automatic resizing? Thanks for your time!

Paul



Paul
Top achievements
Rank 1
 answered on 06 Dec 2011
3 answers
123 views
Hi,
We are trying to use Scrolling and zooming with external buttons as in provided example of the chart. We are in need to disable zooming from chart for this we make scrollmode="ScrollOnly" and enabled the zooming with external button. Now zooming is working fine but chart do not show scroll navigtion tab.
 
For this purpose we just checked the provided example and it is also not working there.
Old working code showing scroll tab
<telerik:ZoomScrollSettings ScrollMode="ScrollAndZoom" MinZoomRange="0.005"/>
 
 
 
Changed code do not show Scroll Tab
<telerik:ZoomScrollSettings ScrollMode="ScrollOnly" MinZoomRange="0.005"/>

Please refer to attached screen.
Thanks
Sia
Telerik team
 answered on 06 Dec 2011
1 answer
39 views
Hi,

With the TileView is there a way of selecting multiple items the same way as selecting files in Windows Explorer - by clicking in the whitespace around items and dragging a box to highlight some items inside?

Thanks
Petar Mladenov
Telerik team
 answered on 06 Dec 2011
2 answers
169 views
We are tying two bind Chart Series dynamically based on selected cell of above grid. Everything is working fine except LegendLabel is coming "Series0" and Series1. I see here that legend label is coming right if we bind our viewmodel statically in xaml but if we assign viewmodel as DataContext through code then legend label does not work.
Here is my code how I am doing.

MacroVal.MacroValCoorelation view = new MacroVal.MacroValCoorelation();
                view.DataContext = new MacroVal.MacroValCoorelationViewModel(processor);  //here I have to pass one input parameter in view model
view.showDialog()

Now my chart on view is like this
<telerik:RadChart Name="radChart1" ItemsSource="{Binding CorrelationChartData}" Grid.Row="2" BorderThickness="0" BorderBrush="Transparent">
            <telerik:RadChart.SamplingSettings>
                <telerik:SamplingSettings SamplingThreshold="400" />
            </telerik:RadChart.SamplingSettings>
 
            <telerik:RadChart.DefaultView>
                <telerik:ChartDefaultView ChartLegendPosition="Bottom">
                    <telerik:ChartDefaultView.ChartLegend>
                        <telerik:ChartLegend x:Name="chartLegend" Header="" UseAutoGeneratedItems="True" Background="Transparent" BorderThickness="0">
                        </telerik:ChartLegend>
                    </telerik:ChartDefaultView.ChartLegend>
                    <telerik:ChartDefaultView.ChartArea>
                        <telerik:ChartArea LegendName="chartLegend">
                            <telerik:ChartArea.AxisX>
                                <telerik:AxisX DefaultLabelFormat="M/d/yy" LabelRotationAngle="90">
                                </telerik:AxisX>
                            </telerik:ChartArea.AxisX>
                        </telerik:ChartArea>
                    </telerik:ChartDefaultView.ChartArea>
                </telerik:ChartDefaultView>
            </telerik:RadChart.DefaultView>
            <telerik:RadChart.SeriesMappings>
                <telerik:SeriesMapping LegendLabel="{Binding CurrentIndicatorName}">
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" LegendDisplayMode="SeriesLabel">
                        </telerik:LineSeriesDefinition>
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:SeriesMapping.ItemMappings>
                        <telerik:ItemMapping DataPointMember="XValue"
                                           FieldName="Date" />
                        <telerik:ItemMapping DataPointMember="YValue"
                                           FieldName="Value1" />
                    </telerik:SeriesMapping.ItemMappings>
                </telerik:SeriesMapping>
                <telerik:SeriesMapping LegendLabel="{Binding PreIndicatorName}">
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" LegendDisplayMode="SeriesLabel" />
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:SeriesMapping.ItemMappings>
                        <telerik:ItemMapping DataPointMember="XValue"
                                           FieldName="Date" />
                        <telerik:ItemMapping DataPointMember="YValue"
                                           FieldName="Value2" />
                    </telerik:SeriesMapping.ItemMappings>
                </telerik:SeriesMapping>
            </telerik:RadChart.SeriesMappings>
        </telerik:RadChart>

And here is my ViewModel Properties.

public List<LOB.DateValuesChartData> CorrelationChartData
        {
            get
            {
                return _ChartData;
            }
        }
 
        public string CurrentIndicatorName { get { return _CurIndicatorName; } }
        public string PreIndicatorName { get { return _PrevIndicatorName; } }
Ves
Telerik team
 answered on 06 Dec 2011
5 answers
237 views

Hello,
I would like to implement a context menu for all my application treeviews that allow users to ExpandAll, CollapseAll and Find text into nodes.
 For example, manage a style in the ressource dictionnary that looks like this :

<Style x:Key="StyleTreeViewWithContextMenu" TargetType="{x:Type telerik:RadTreeView}">
   <Setter Property="ContextMenu">
       <Setter.Value>
           <telerik:RadContextMenu>
               <telerik:RadMenuItem Header="Déployer tout"   />
               <telerik:RadMenuItem Header="Replier tout" />
               <telerik:RadMenuItem Header="Trouver" />
           </telerik:RadContextMenu>
      </Setter.Value>
   </Setter>
</Style>

How can I implement the actions of menuItems in order to apply this style on my treeviews?

Could you put me on track ?

Thanks in advance.
Olivier.

Petar Mladenov
Telerik team
 answered on 06 Dec 2011
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?