Telerik Forums
UI for WPF Forum
6 answers
472 views
I want to change the default headers of the groups in the grid. There are two scenarios where I feel the need to do this.

1. Complex data types
When the value to group by is a simple datatype, say a string, the default headers work fine. But when grouping by a columns that is bound to a complex datatype it doesn't look as good. In those cases the headers will show all the properties of the class and the values in it.
An example:
Let's say I have a class:
public class MemberType
{
    public int Id { get; set; }
    public string Description { get; set; }
}
My grid has one column that is bound to this type. In the column XAML I specify that the Description should be displayed and all works fine. But when I group by that column, the headers of all groups will not show only the Description but all properties, like this:
"Id:1 Desciption:Editor" and so on. How can I specify that I only want to show the value of the Description i the group headers (which is what the rows are grouped by).

2. Boolean values
When the value to group by is a boolean, there will be two groups with the headers "true" and "false" (assuming both values are represented in the data). This is the desired behavior, but I would like the headers to be "Yes" and "No" instead.
Dilyan Traykov
Telerik team
 answered on 11 May 2018
7 answers
329 views

I would like to create a graph view that shows a live data that is being received from a data sampler. This view, when running, shows, for example, the last 1000 samples.

When paused, it shows a scroll bar that allows the user to scroll back and forth and see all the sampled data.

I'm thinking of saving the data into file, so when the graph is paused, the data is read from the file using FileStream.

 

I saw the examples of VirtualQueryableCollectionView, but it still doesn't work.

I've tried with and without the VirtualQueryableCollectionView. I've created a collection that derives from IReadOnlyList<int> and I return 20,0000,000 as the count and I return the index as the item (this is just an example, for checking the data virtualization). However, the GetEnumerator (on both cases) is being called, and since the count is 20M, I yield return each of the items.

I was hoping that the VirtualQueryableCollectionView will somehow prevent the GetEnumerator call (or will be able to get just the relevant portion of the items).

 

 

I have seen examples where a similar tactics is being used, and a CollectionChanged event is being raised when the items are ready. However, they still return the full count, but on these examples, the GetEnumerator is called at start, and not also after the CollectionChanged event (on my code, it is called after the CollectionChanged, so I'm back to the same problem that I had), and no item is being returned using the GetEnumerator, but only with the Indexer.

 

What am I missing?

 

Can you show me an example of streaming data to chart view from a file?

(for example, have each 4 bytes in the file represent an Int32 which is the value, so the offset inside the file for a specific item will be the index * 4).

 

Thanks.

 

Martin Ivanov
Telerik team
 answered on 11 May 2018
4 answers
414 views

I have a gridviewcolumn that is bound to a DateTime (CartridgeExpiration). I am formatting the data based on the bound Property "ExpirationDateFormat". When I set the application culture to "de-DE" and provide a DataFormatString of "MM/dd/yyyy", I see '.' as the date separator in the filter list instead of '/'. I was seeing the same behavior in the dates displayed in the gridview column until I created a CellTemplate with the MultiBinding.

Here is my GridViewColumn definition:

                <telerik:GridViewDataColumn DataMemberBinding="{Binding CartridgeExpiration}" 
                                             ShowFieldFilters = "False" 
                                            ShowFilterButton = "False"
                                            DataFormatString="{Binding ExpirationDateFormat}"
                                            HeaderCellStyle="{StaticResource SharedRadGridHeaderCellSmallFont3LineStyle}">
                                            <telerik:GridViewDataColumn.Header>
                                                <TextBlock AutomationProperties.AutomationId="QcHistoryCartridgeExpirationHeader"
                                                           Text="{x:Static AdminStrings.QcHistoryCartridgeExpirationHeader}"
                                                           TextWrapping="Wrap" TextAlignment="Center" FontSize="16"/>
                                            </telerik:GridViewDataColumn.Header>
                                            <telerik:GridViewDataColumn.CellTemplate>
                                                <DataTemplate>
                                                    <TextBlock>
                                                        <TextBlock.Text>
                                                            <MultiBinding Converter="{StaticResource DateToStringConverter}">
                                                                <Binding Path="CartridgeExpiration"/>
                                                                <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ExpirationDateFormat"/>
                                                            </MultiBinding>
                                                        </TextBlock.Text>
                                                    </TextBlock>
                                                </DataTemplate>
                                            </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>

ExpirationDate = "MM/dd/yyyy" shows in the filter as "MM.dd.yyyy"

How can I get the filter display to use the format I have provided?

Thanks.

George

George
Top achievements
Rank 1
 answered on 11 May 2018
2 answers
227 views

Hello team,

I am persisting the grid settings. And I have a button in each gridview's control panel as "Reset to default".

I am deleting the related bin file, but the default settings (as stated in xaml) is not being reflected to current grid in screen. I tried, rebinding/re assigning itemssource/InvalidateVisual with no luck. How can i reset the gridview settings, without being have to keep a default bin file and restoring that bin file, when the user clicks "reset to default".

Martin Ivanov
Telerik team
 answered on 11 May 2018
3 answers
168 views
If I have the MinValue set to 0 and I enter a negative value in the control, the value is getting set back to 0. How would I change the behavior to change the value to the absolute value of the entry rather than zero? I already have a control built that extends from RadNumericUpDown, just not sure what to hook up to to update the value. Thanks!
Stefan
Telerik team
 answered on 11 May 2018
7 answers
223 views

Hello,

We're using the RadRichTextBox control with the Windows8 Theme.
And it's possible to insert an image in the text but as soon as the user tries to select this image to resize it, the application crashes:

An unhandled exception of type 'System.NullReferenceException' occurred in PresentationFramework.dll

At first I thought we were doing something wrong, so I've tried to recreate the problem in one the the sample projects.
By doing so I've noticed that this problem occurs only when using the Windows8 Theme. Changing the theme to Windows7 for example makes the issue disappear. But this is not an actual solution for us, because we'd like to be able to use the Windows8 theme too.

I've attached a screenshot of the exception details. I apologise for it being in Dutch but I believe it still to be of use here.
It says that the resource key RadButtonStyle is missing. I'd like to point out again that this seems to only occur with the Windows8 theme.

To recreate the problem you can use the SaveAndSaveAs_WPF sample project and just set the theme of the RadRichTextBox control to Windows8.
You can just take a screenshot and paste it in the RadRichTextBox, when you try to resize this image the NullReferenceException should be thrown.
Below is an example of the adjusted MainWindow.xaml:

<Window x:Class="SaveAndSaveAs_WPF.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0" >
            <telerik:RadButton  Content="New" Click="NewDocumentButton_Click" Padding="25,5" Margin="5" />
            <telerik:RadButton  Content="Open" Click="OpenButton_Click" Padding="25,5" Margin="5" />
            <telerik:RadButton  Content="Save" Click="SaveButton_Click"  Margin="5" Padding="25,5"/>
            <telerik:RadButton  Content="Save As" Click="SaveAsButton_Click"  Margin="5" Padding="25,5"/>
        </StackPanel>
        <telerik:DocumentRuler Grid.Row="1">
            <telerik:RadRichTextBox
                    telerik:Analytics.Name="rtb"
                    x:Name="radRichTextBox"
                    IsSpellCheckingEnabled="False"
                    LayoutMode="Paged"
                    AllowDrop="True" >
                <telerik:RadRichTextBox.Style>
                    <Style TargetType="telerik:RadRichTextBox">
                        <Setter Property="telerik:StyleManager.Theme" Value="Windows8" />
                    </Style>
                </telerik:RadRichTextBox.Style>
            </telerik:RadRichTextBox>
        </telerik:DocumentRuler>
    </Grid>
</Window>

 

Is there anything we could to in order to bypass this problem and still use the Windows8 theme?

 

Tanya
Telerik team
 answered on 11 May 2018
9 answers
946 views
I would like to use a glyph for the image or a RadRibbonBackstageItem, but since it expects an Icon, it doesn't seem possible. Is there some way to do it?
Kalin
Telerik team
 answered on 09 May 2018
2 answers
207 views
We’re using a couple of other Telerik controls that incorporate selection, but few if any swap to using a hand cursor for selection. We’d like to enabled selection in the Tree Map but override the default cursor so that it uses the standard Arrow cursor. Is this possible without modifying the underlying source for the control?
Chris
Top achievements
Rank 1
 answered on 09 May 2018
1 answer
313 views

I have an expander that contains sub-expanders. I want to automatically close the sub-expanders when I close the main expander. I have implemented this logic using data binding, but it doesn't seem to work correctly.

Looks like binding to the IsExpanded property gets destroyed after you close the expander using the expander's button. Have omitted a call to the SetCurrentValue method...?

Example project attached. See the ReadMe.txt for details.

Pretty frustrating that you don't allow attaching archives. Doesn't encourage that much creating example projects. Your ticket system is a pain in the donkey if you are a consultant. Things could be done more easily and efficiently.

Anyways, here's a Google Drive link to download the project: https://drive.google.com/drive/folders/1JvBukVvfmxWsRW5Wb-nRXbT5a6EOWvCd

Let me know when you have downloaded it so I can delete the file.

Martin Ivanov
Telerik team
 answered on 09 May 2018
5 answers
615 views

I want to sort my items via a custom sort order, similar to the implementation detailed here: http://docs.telerik.com/devtools/wpf/controls/radgridview/sorting/custom#custom-sorting-handling-sorting-event

However when I do it seems that e.OldSortingState is always equal to SortingState.None and so I don't get the functionality where first click on column = Ascending, second = Descending, and third = reset to default sorting (ie. None).

The example below should mostly set the sorting to the way it would be if I didn't handle the Sorting event myself. It's only for demonstration. My issue is that I can't ever get to the "else if" and "else" blocks.

private void MainDataGridOnSorting(object sender, GridViewSortingEventArgs e)
 {
     RadGridView radGridView = e.Source as RadGridView;
 
     if (radGridView == null)
     {
         e.Cancel = true;
         return;
     }
 
     DataView dataView = radGridView.DataContext as DataView;
 
     if (dataView == null)
     {
         e.Cancel = true;
         return;
     }
 
     IEnumerable<DataRowView> dataRows = dataView.Cast<DataRowView>();
 
     //If the sorting state is none, sort the items ascending.
     if (e.OldSortingState == SortingState.None)
     {
         e.NewSortingState = SortingState.Ascending;
         e.Column.SortingState = SortingState.Ascending;
 
         dataRows =
             dataRows
                 .OrderBy(row => row.Field<string>(e.Column.UniqueName));
     }
     //If the sorting state is none, sort the items descending.
     else if (e.OldSortingState == SortingState.Ascending)
     {
        // Cannot reach this block
         e.NewSortingState = SortingState.Descending;
         e.Column.SortingState = SortingState.Descending;
 
         dataRows =
             dataRows.OrderByDescending(row => row.Field<string>(e.Column.UniqueName));
     }
     //If the sorting state is descending, apply default sorting to the items.
     else
     {
        // Cannot reach this block
         e.NewSortingState = SortingState.None;
         e.Column.SortingState = SortingState.None;
 
         dataRows =
             dataRows.OrderBy(row => row.Field<int>("PrimaryRow"));
     }
 
     radGridView.ItemsSource = dataRows;
     e.Handled = true;
     e.Cancel = true;
 }
Dilyan Traykov
Telerik team
 answered on 09 May 2018
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?