Telerik Forums
UI for WPF Forum
0 answers
93 views

In addition to the class provided by the class, I ask if there are any classes or methods that can be applied to a class that has style gridview

ex) no applied style gridview export option source, I want to applied style gridview export option

 public bool SaveDocument_GridViewUse(RadGridView gridViewList, ExcelExportTypeFDC selectedFormat)
        {
            try
            {
                string fileName;
                string appFileName = "";
                using (Stream stream = CreateFile(out fileName, selectedFormat))
                {
                        gridViewList.Export(stream, new GridViewExportOptions() {
                        Format = ExportFormat.Csv,
                        ShowColumnHeaders = true,
                    });
                }

                if (selectedFormat == ExcelExportTypeFDC.Xlsx) appFileName = "excel.exe";
                else if (selectedFormat == ExcelExportTypeFDC.Csv) appFileName = "excel.exe";
                else if (selectedFormat == ExcelExportTypeFDC.Txt) appFileName = "notepad.exe";

                ProcessStartInfo pInfo = new ProcessStartInfo(appFileName, fileName);
                pInfo.WindowStyle = ProcessWindowStyle.Maximized;
                Process.Start(pInfo);
            }

Top achievements
Rank 1
 asked on 05 Mar 2017
1 answer
183 views

The following is the code snippet from my code.  I have the command CheckTypeCommand defined in my Model. There are over 100,000 items in my collection and the number of columns is 50 odd. If I scroll up or down of this grid the command of this check box for every row that is render is getting executed. I want the command only to execute on UI trigger that is when I change the Check Type in the combobox. Can you please let me know what is I am missing here. If I disable Virtualization then the performance goes for a spin.

  <telerik:RadGridView x:Name="radGridView"  ItemsSource="{Binding myList}"  AutoGenerateColumns="False"
                             Grid.Row="3" Grid.ColumnSpan="2" FontSize="11"
                             SelectionMode="Single"  SelectionUnit="Mixed"
                             ClipboardCopyMode="Default"
                                 ActionOnLostFocus="CommitEdit" ScrollMode="RealTime" ElementExporting="radGridView_ElementExporting"
                                 SelectedItem="{Binding  Data.GridSelectedRow, Source={StaticResource proxy} , Mode=TwoWay}"  IsSynchronizedWithCurrentItem="False"
                                 ShowColumnSortIndexes="True" RowIndicatorVisibility="Collapsed" behaviours:ContextMenuBehavior.ContextMenu="{Binding ElementName=GridContextMenu}" FrozenColumnCount="3" >
                                  
                <telerik:RadContextMenu.ContextMenu>
                    <telerik:RadContextMenu x:Name="GridContextMenu" ItemsSource="{Binding ContextMenu}" ItemContainerStyle="{StaticResource MenuItemContainer}"  >
                    </telerik:RadContextMenu>
                 <telerik:GridViewDataColumn x:Name="checktypecombo" DataMemberBinding="{Binding CheckType, Mode=TwoWay}" 
                                UniqueName="CheckType" IsReadOnlyBinding="{Binding IsReadOnly}"    IsReadOnly="True"
                                                SortMemberPath="CheckType"   EditTriggers="CellClick"   IsFilterable="False" IsGroupable="False"
                                                IsSortable="False" Width="75">
                        <telerik:GridViewDataColumn.Header>
                            <TextBlock Text="Check Type" TextWrapping="Wrap" Style="{StaticResource TextBlockWhite}" />
                        </telerik:GridViewDataColumn.Header>
                        <telerik:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <telerik:RadComboBox Command="{Binding CheckTypeChanged}" 
                                                    SelectedValue="{Binding CheckType, Mode=OneWay}" SelectedValuePath="Tag"
                                                     IsEditable="False">
                                    <telerik:RadComboBoxItem Tag="C1" Content="Checktype1"/>
                                    <telerik:RadComboBoxItem Tag="C2" Content="C2"/>                    
                                </telerik:RadComboBox>
                                   </DataTemplate>
                        </telerik:GridViewColumn.CellTemplate>
                    </telerik:GridViewDataColumn>   
                         
</telerik:RadGridView

  <telerik:RadGridView x:Name="radGridView"  ItemsSource="{Binding myList}"  AutoGenerateColumns="False"
                             Grid.Row="3" Grid.ColumnSpan="2" FontSize="11" EnableColumnVirtualization="False" 
                             SelectionMode="Single"  SelectionUnit="Mixed"
                             ClipboardCopyMode="Default" 
                                 ActionOnLostFocus="CommitEdit" ScrollMode="RealTime" ElementExporting="radGridView_ElementExporting" 
                                 SelectedItem="{Binding  Data.GridSelectedRow, Source={StaticResource proxy} , Mode=TwoWay}"  IsSynchronizedWithCurrentItem="False"
                                 ShowColumnSortIndexes="True" RowIndicatorVisibility="Collapsed" behaviours:ContextMenuBehavior.ContextMenu="{Binding ElementName=GridContextMenu}" FrozenColumnCount="3" >
 
                <telerik:RadContextMenu.ContextMenu>
                    <telerik:RadContextMenu x:Name="GridContextMenu" ItemsSource="{Binding ContextMenu}" ItemContainerStyle="{StaticResource MenuItemContainer}"  >
                    </telerik:RadContextMenu>
    <telerik:GridViewDataColumn x:Name="checktypecombo" DataMemberBinding="{Binding CheckType, Mode=TwoWay}"  
UniqueName="CheckType" IsReadOnlyBinding="{Binding IsReadOnly}"    IsReadOnly="True" 
                                                SortMemberPath="CheckType"   EditTriggers="CellClick"   IsFilterable="False" IsGroupable="False"
                                                IsSortable="False" Width="75">
                        <telerik:GridViewDataColumn.Header>
                            <TextBlock Text="Check Type" TextWrapping="Wrap" Style="{StaticResource TextBlockWhite}" />
                        </telerik:GridViewDataColumn.Header>
                        <telerik:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <telerik:RadComboBox Command="{Binding CheckTypeChanged}"  
                                                    SelectedValue="{Binding CheckType, Mode=OneWay}" SelectedValuePath="Tag" 
                                                     IsEditable="False">
                                    <telerik:RadComboBoxItem Tag="C1" Content="Checktype1"/>
                                    <telerik:RadComboBoxItem Tag="C2" Content="C2"/>  
</telerik:RadComboBox>
      </DataTemplate>
                        </telerik:GridViewColumn.CellTemplate>
                    </telerik:GridViewDataColumn>  

</telerik:RadGridView

Bernard
Top achievements
Rank 1
 answered on 03 Mar 2017
5 answers
513 views
Hi,

I am actually using a RadAutoCompleteBox, which is linked to an ObservableCollection of contacts (from entity).
But on run, when a contact  is selected, the property (DisplayMemberPath) does not display.

Here's my xaml code;

<telerik:RadAutoCompleteBox x:Name="lstReceiver"  <br> 
                           Margin="0" Grid.Column="1"  Height="25"<
br
                           ItemsSource="{Binding RecipientList, Mode=TwoWay}"<
br>
                           DisplayMemberPath="EmailAddress" SelectionMode="Multiple"<
br
                           SelectedItem="{Binding SelectedRecipient, Mode=TwoWay}"<
br>
                           TextSearchMode="StartsWith"<
br
                           SearchText="{Binding ContactSearchKeyWords, Mode=TwoWay, BindsDirectlyToSource=True}"<
br
                           TextSearchPath="EmailAddress">

And here's what is being displayed in Run Mode (View attached image).
Am I missing something here?

Dilyan Traykov
Telerik team
 answered on 03 Mar 2017
0 answers
151 views

Hi!
It is seems that gridview doesn't separate null value and enum's first value while filtering or sorting.

Example: 

MainWindow.xaml.cs : https://codeshare.io/aJb3dK

MainWindow.xaml:  https://codeshare.io/5Odrk0

Try to filter column by choosing Item 1.
dmitriy
Top achievements
Rank 1
 asked on 03 Mar 2017
1 answer
76 views

Hello everyone,

is it possible to disable the search criteria modifiers like +,- and " so that those characters are treated like any other? We have a grid that contains some records that start with a minus (e.g. -test, -1234), however when users start typing "-123" no results are returned. 

 

Dilyan Traykov
Telerik team
 answered on 03 Mar 2017
6 answers
259 views
Hi, I'm trying to get the following working:

I have a ViewModel which loads a list in a list.xaml. If something is clicked in the list.xaml a detail.xaml is opened

Now in this detail.xaml I have first a grid with some information about the clicked list item (description etc.) and below I want to show a RadDiagram with shapes.

To achieve this I have a property in my ViewModel which creates a object GraphSource of ObservableGraphSourceBase and returns it.

For simplicity the object just have a constructor with the following code:

1.Public Sub New()
2.    Dim warenEingang = New NodeViewModelBase With {.Content = "Wareneingang", .Position = New Point(40, 40)}
3.    Dim waschhaus = New NodeViewModelBase With {.Content = "Waschhaus", .Position = New Point(40, 80)}
4.    Dim warenAusgang = New NodeViewModelBase With {.Content = "Warenausgang", .Position = New Point(40, 120)}
5.    MyBase.AddNode(warenEingang)
6.    MyBase.AddNode(waschhaus)
7.    MyBase.AddNode(warenAusgang)
8.End Sub

 

In the ViewModel the property looks like this:

1.Public ReadOnly Property myGraphProperty()
2.    Get
3.        Dim graphSource = New GraphSource()
4.        Return graphSource
5.    End Get
6.End Property

 

Now on my detail.xaml the stuff for my RadDiagram is loaded from an external xaml, let's call it "raddiagram.xaml"

1.<!-- detail.xaml-->
2.<UserControl x:Class="detail" [...]>
3.    <!-- grid implementation -->
4.    <local:raddiagram.xaml />
5.</UserControl>

 

Finally I'min the raddiagram.xaml :-)

01.<UserControl x:Class="raddiagram"
06.    xmlns:local="clr-namespace:Views"
07.    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
09.    mc:Ignorable="d"
10.    d:DesignHeight="800" d:DesignWidth="800">
11.<Grid x:Name="LayoutRoot">
12.   <telerik:RadDiagram x:Name="diagram" GraphSource="{Binding myGraphProperty}" />
13. 
14.   <telerik:RadTreeView x:Name="tree" Grid.Column="1" Width="300" ItemsSource="{Binding Items}">
15.        <telerik:RadTreeView.ItemTemplate>
16.           <DataTemplate>
17.                <TextBlock Text="{Binding Content}" />
18.           </DataTemplate>
19.       </telerik:RadTreeView.ItemTemplate>
20.   </telerik:RadTreeView>
21.</Grid>
22.</UserControl>

 

With this example xaml - taken from the documentation --> two-way-mvvm , my shapes are shown (still the content needs a toString, but this is not the big problem here).
Unfortunately all shapes are laying at position (0,0) - but when trying to achieve anything written in with styles / templates nothing is shown anymore.

Question: How can I achieve, via a property access of a ViewModel, that I can "iterate" in my xaml over all shapes to style them (setter property position etc.).
The goal is (later) after the three shapes are shown correctly (as you can see above, the x-position is the same, but y- is increasing) to insert connections between them.

I tried this: http://docs.telerik.com/devtools/wpf/controls/raddiagram/howto/mvvm-style-selectors but then nothing (shapes) is shown anymore on the RadDiagram.

Thanks for any hints/help

Timon

Dinko | Tech Support Engineer
Telerik team
 answered on 03 Mar 2017
2 answers
408 views

Hello, 

I have been trying to figure out how I can set the Label on a Categorical Axis to pull from my data object.  After hours of searching I was not able to find any examples or answers to this.

I have a set of objects which I am binding to for the series and plot points.  

public class UiDynamicChartSeries
{
    public string Name { get; set; }
    public List<UiDynamicChartPlot> ChartPlots { get; set; }
}
public class UiDynamicChartPlot
{
    public string PlotHeader { get; set; }
    public string CategoryHeader { get; set; }
    public object CategoryAxisLabel { get; set; }
    public string ValueFormat { get; set; }
    public object PlotCategory { get; set; }
    public object PlotValue { get; set; }
}

In the XAML, the PlotCategory binds the category values on the chart, whereas the PlotValue binds the values on the chart.

Here is the XAML in which I am binding (note: I did not include all of the various resources since those already work)

<telerik:RadCartesianChart x:Name="DynamicChartView" Grid.Row="1" Grid.Column="0"
                           Palette="{StaticResource ChartPalette}"
                           VerticalZoomRangeEnd="{Binding ChartVerticalZoomRangeEnd}"
                           VerticalZoomRangeStart="0">
    <telerik:RadCartesianChart.Style>
        <Style TargetType="{x:Type telerik:RadCartesianChart}">
            <Setter Property="TrackBallLineStyle" Value="{StaticResource TrackBallLineChartView}" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding ShowTrackInfo}" Value="false">
                    <Setter Property="TrackBallLineStyle" Value="{x:Null}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </telerik:RadCartesianChart.Style>
    <telerik:RadCartesianChart.TrackBallInfoStyle>
        <Style TargetType="{x:Type telerik:TrackBallInfoControl}">
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock FontSize="14" Foreground="{StaticResource DarkSteelBlueBrush}" Style="{StaticResource TextBlockLabelCentered}" Text="{Binding}" />
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </telerik:RadCartesianChart.TrackBallInfoStyle>
    <telerik:RadCartesianChart.Behaviors>
        <telerik:ChartPanAndZoomBehavior DragMode="Pan" MouseWheelMode="PanHorizontally" ZoomMode="Both" />
        <telerikChartView:ChartTrackBallBehavior ShowIntersectionPoints="{Binding ShowIntersectionPoints}" ShowTrackInfo="{Binding ShowTrackInfo}" SnapMode="ClosestPoint" TrackInfoUpdated="ChartTrackBallBehaviorOnTrackInfoUpdated" />
    </telerik:RadCartesianChart.Behaviors>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis Title="{Binding LineChartDynamicDataSets.CategoryTitle}" LabelFitMode="Rotate" LabelRotationAngle="-65" SmartLabelsMode="SmartStep" TitleTemplate="{StaticResource DataTemplateChartTitle}">
            <telerik:CategoricalAxis.LabelTemplate>
                <DataTemplate>
                 
                    <!-- This gives me the Date on the Event, what I want to do -->
                    <TextBlock Text="{Binding DataPoint.DataItem.CategoryAxisLabel}" />
                     
                    <!-- This gives me the Event Number, not desired -->
                    <TextBlock Text="{Binding}" />
                     
                </DataTemplate>
            </telerik:CategoricalAxis.LabelTemplate>
        </telerik:CategoricalAxis>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Title="{Binding LineChartDynamicDataSets.ValueTitle}" MajorStep=".25" SmartLabelsMode="SmartStep" TitleTemplate="{StaticResource DataTemplateChartTitle}" />
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.SeriesProvider>
        <telerik:ChartSeriesProvider Source="{Binding ChartData}">
            <telerik:ChartSeriesProvider.SeriesDescriptors>
                <telerik:CategoricalSeriesDescriptor CategoryPath="PlotCategory" ItemsSourcePath="ChartPlots" ValuePath="PlotValue">
                    <telerik:CategoricalSeriesDescriptor.Style>
                        <Style TargetType="{x:Type telerikChartView:LineSeries}">
                            <Setter Property="LegendSettings" Value="{Binding Name, Converter={StaticResource StringToChartLegendSettingsConverter}}" />
                            <Setter Property="TrackBallInfoTemplate" Value="{StaticResource TrackBallInfoTemplate}" />
                            <Setter Property="TrackBallTemplate" Value="{StaticResource TrackBallTemplate}" />
                        </Style>
                    </telerik:CategoricalSeriesDescriptor.Style>
                </telerik:CategoricalSeriesDescriptor>
            </telerik:ChartSeriesProvider.SeriesDescriptors>
        </telerik:ChartSeriesProvider>
    </telerik:RadCartesianChart.SeriesProvider>
</telerik:RadCartesianChart>

However, instead of the PlotCategory being used for the labels, I want the CategoryAxisLabel to be used instead.  The reasoning I need to do this is that in my data I have multiple events which happen on the same date.  When I originally plotted the chart all of the data points were plotted on the same day.  For a line chart that looked horrible.  So to change this I now plot to the events which gives me the lines desired, but now I want to display the date for the label and not the event number.  I have not been able to find a way to do this, and it is the last hurdle I need to overcome.

Thank you

Barry
Top achievements
Rank 1
 answered on 02 Mar 2017
0 answers
67 views
Hi, by default, if the value of a raddatetimepicker is null, and you try to change it, the month displayed is DateTime.now, is there a way to set it to maybe 3 months from today? 
band
Top achievements
Rank 1
 asked on 02 Mar 2017
9 answers
174 views

Hi,

i am thinking about a phonebook app for hour business software and i am not sure how to start. Using a TabControl for A-Z and just load data which
are in this chapter. Any ideas?

 

Thanks

Rene

Lance | Senior Manager Technical Support
Telerik team
 answered on 02 Mar 2017
23 answers
780 views
Does the GridView support live sort and/or live grouping?

By that I mean that if I'm sorting by a column, and one of the values gets updated in the underlying collection, the grid will resort and place that item correctly according to the sort. In other words, if I have a person class (assume INotifyPropertyChanged is implemented correctly, for the sake of brevity):

class Person : INotifyPropertyChanged{
    public int Age{get;set;}
    public string Name {get;set;}
}

and I have an ObservableCollection<Person> that the grid's ItemsSource is bound to, and let's say the grid looks like so:

| Name | Age |
 Tom     12
  Mark   18
  Sam    25

and Sam's age changes to 1 (a data update that happens outside of the grid), I would expect it to become the first row. Currently it does not.

The same question applies to grouping (supporting live updates).

Thanks.
Onno
Top achievements
Rank 1
 answered on 02 Mar 2017
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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?