Telerik Forums
UI for WPF Forum
4 answers
129 views
I'm facing problems with TileList, I want to allow the user to change the tile size at runtime. When you change the tile size (tiletype) pragmatically, in a random manner the tile size and UI got corrupted.

To reproduce the problem:

XAML CODE:


<Window x:Class="MainWindow"
        Title="MainWindow" Height="625" Width="1300" WindowState="Maximized">
    <Grid>
        <Grid.Resources>
            <Style TargetType="TextBlock" x:Key="TileLabelStyle">
                <Setter Property="FontSize" Value="14" />
                <Setter Property="FontFamily" Value="Segoe UI" />
                <Setter Property="Margin" Value="0" />
                <Setter Property="VerticalAlignment" Value="Top"/>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="35"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Button Content="All Small" Grid.Row="0" Click="Button_Click" HorizontalAlignment="Left" Width="96" />
        <Button Content="All Double" Grid.Row="0" Margin="101,0,0,0" Click="Button_Click_1" HorizontalAlignment="Left" Width="96" />
        <Button Content="All Quadruple" Grid.Row="0" Margin="202,0,0,0" Click="Button_Click_2" HorizontalAlignment="Left" Width="96" />
        <telerik:RadTileList IsManipulationEnabled="True" TilePlaceHolderSide="150" ScrollViewer.HorizontalScrollBarVisibility="Visible" CanUserSelect="False" x:Name="MainTileList" Grid.Row ="1">
            <telerik:Tile TileType="Single" Background="Bisque">
                <Grid >
                    <TextBlock Text="Single" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Single">
                <Grid >
                    <TextBlock Text="Single" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Single">
                <Grid >
                    <TextBlock Text="Single" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Double"  Background="DarkRed">
                <Grid >
                    <TextBlock Text="Double" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Double">
                <Grid >
                    <TextBlock Text="Double" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Quadruple">
                <Grid >
                    <TextBlock Text="Quadruple" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Double"  Background="Coral">
                <Grid >
                    <TextBlock Text="Double" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Double">
                <Grid >
                    <TextBlock Text="Double" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Single">
                <Grid >
                    <TextBlock Text="Single" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Double"  Background="DeepPink">
                <Grid >
                    <TextBlock Text="Double" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Double">
                <Grid >
                    <TextBlock Text="Double" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Single"  Background="DarkViolet">
                <Grid >
                    <TextBlock Text="Single" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Quadruple" Background="Green">
                <Grid >
                    <TextBlock Text="Quadruple" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Single"   Background="DarkSalmon">
                <Grid >
                    <TextBlock Text="Single" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
 
            <telerik:Tile TileType="Quadruple"  Background="MidnightBlue">
                <Grid >
                    <TextBlock Text="Quadruple" Style="{StaticResource TileLabelStyle}"/>
                </Grid>
            </telerik:Tile>
        </telerik:RadTileList>
    </Grid>
</Window>

VB Code:

Imports Telerik.Windows.Controls
 
Class MainWindow
 
    Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
 
        Dim MainContextMenu As New ContextMenu
 
        Dim smallMenuItem As New MenuItem With {.Header = "Small"}
        Dim wideMenuItem As New MenuItem With {.Header = "Wide"}
        Dim largeMenuItem As New MenuItem With {.Header = "Large"}
 
        MainContextMenu.Items.Add(smallMenuItem)
        MainContextMenu.Items.Add(wideMenuItem)
        MainContextMenu.Items.Add(largeMenuItem)
 
        AddHandler smallMenuItem.Click, AddressOf SmallSizeClick
        AddHandler wideMenuItem.Click, AddressOf WideSizeClick
        AddHandler largeMenuItem.Click, AddressOf LargeSizeClick
 
        For Each c As Tile In MainTileList.Items
            c.ContextMenu = MainContextMenu
        Next
    End Sub
 
    Private Sub SmallSizeClick(sender As Object, e As RoutedEventArgs)
        Dim tile = DirectCast(DirectCast(DirectCast(sender, MenuItem).Parent, ContextMenu).PlacementTarget, Tile)
        tile.TileType = TileType.Single
    End Sub
 
    Private Sub WideSizeClick(sender As Object, e As RoutedEventArgs)
        Dim tile = DirectCast(DirectCast(DirectCast(sender, MenuItem).Parent, ContextMenu).PlacementTarget, Tile)
        tile.TileType = TileType.Double
    End Sub
 
    Private Sub LargeSizeClick(sender As Object, e As RoutedEventArgs)
        Dim tile = DirectCast(DirectCast(DirectCast(sender, MenuItem).Parent, ContextMenu).PlacementTarget, Tile)
        tile.TileType = TileType.Quadruple
    End Sub
 
    Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
        For Each t As Tile In MainTileList.Items
            t.TileType = TileType.Single
        Next
    End Sub
 
    Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
        For Each t As Tile In MainTileList.Items
            t.TileType = TileType.Double
        Next
    End Sub
 
    Private Sub Button_Click_2(sender As Object, e As RoutedEventArgs)
        For Each t As Tile In MainTileList.Items
            t.TileType = TileType.Quadruple
        Next
    End Sub
End Class

Run the application:

1- Click on "All SMALL" button to set all tile to single
2- Try to reorder some tiles
3- Click on "All Quadruple"

You may notice that some tiles size looks like single while it is Quadruple. (see the attached images)

Also another problem, I'm not able to figure out how the tile reorder is working, sometime I drag drop a tile it does not move, sometime it works! if I drag over another tile sometimes work some time not, Very inconsistent not similar to the windows 8 tiles, I don't think I can use it with production environment. Please advise.

Maya
Telerik team
 answered on 20 Nov 2014
4 answers
210 views
Hello,
I'm creating datagrid with dynamically created columns. The ViewModel looks like:
public string this[Guid column]
 {     
    get { ....}
    
set { ... }
}

And I create columns this way:
GridViewDataColumn col = new GridViewDataColumn();<br>
col.Header = c.Column.Name;<br>
col.DataMemberBinding = new Binding(String.Format("[{0}]", c.Column.Id)) { FallbackValue = null };
col.ColumnGroupName = g.Header;
 
this.Columns.Add(col);


I had some problems - sorting (fixed by custom ICollectionView link) but now I have issue with filtering. When i try to filter, grid becomes empty. And also I cannot see list with checkboxes to select desired values (like for normal column bound to string property).

Is there anything I can do with that? ICollectionView  has filter property, but it's not used in Telerik Datagrid (?).
Przemysław
Top achievements
Rank 1
 answered on 20 Nov 2014
3 answers
157 views
Hello,

I have no explicit style on my DataPager

<telerik:RadDataPager x:Name="radDataPager" Source="{Binding Items, ElementName=customersBox}" />

but the previous and next buttons are empty, why? They are clickable but I need a hint what happens when the button is clicked.

Regards,
Ylva
Vanya Pavlova
Telerik team
 answered on 20 Nov 2014
1 answer
130 views
Hi, 

I'm using the RadMap component with the OpenStreetMapProvider.
I wanted to know if it is possibile to know the name of the street given a point on the map.

Thx in advance

Davide
Petar Mladenov
Telerik team
 answered on 20 Nov 2014
14 answers
380 views
When a RadGridView's ItemSource is bound to a VirtualQueryableCollectionView, user navigation in the RadGridView causes the VirtualQueryableCollectionView to accumulate loaded objects.  From a memory management perspective we would like to be able to unload objects from the VirtualQueryableCollectionView - for example, we may want to unload anything outside the range of current row index +- 500 on an ongoing basis to limit our memory footprint.

The use case for this is any application where the user operates iteratively on a large set of large objects.  When moving down the list in the RadGridView, processed rows are never viewed again yet their associated objects remain in memory unavailable to the Garbage Collector. 

Unloading these objects from the collection should result in the objects being re-fetched by the ItemsLoading event handler if they are required for subsequent display in the RadGridView.

There appears to be no mechanism for identifying which items should and should not be unloaded.  ResetAll does as its name implies  - unloads all items - which is far too heavy handed for our desired behavior.

Setting an item to null (via RemoveAt(index), Insert(index, null) produces undesired behavior - the item is not refetched when its row is redisplayed, RadGridview displays an "=" in the row, and the item cannot be removed from the VirtualQueryableCollectionView (RemoveAt fails silently). 

QUESTION:  Is there a mechanism by which ranges of items can be reset in (unloaded from) a VirtualQueryableCollectionView?

I've accomplished this using reflection to remove items from the the private "loadedIndexes" collection but obviously would NOTdo that in production code.


Thanks,
tim
MarkInTexas
Top achievements
Rank 1
 answered on 19 Nov 2014
3 answers
297 views
How to Extend Dynamically Nested Properties in Rad PropertyGrid  using search box 
Ivan Ivanov
Telerik team
 answered on 19 Nov 2014
1 answer
153 views
Hi,

When there is an exception thrown during cell validation in RadGridView edit mode, the keyboard is disabled.

Added the sample code below. Please let me know if this issue can be fixed.

// App.xaml
 
<Application x:Class="SampleAppWithRadGridView.App"
    StartupUri="MainWindow.xaml"
    DispatcherUnhandledException="Application_DispatcherUnhandledException" />
 
 
// App.xaml.cs
 
 
        private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            e.Handled = true;
            MessageBox.Show(e.Exception.Message);
        }
 
// MainWindow.xaml
 
<telerik:RadGridView Name="gridView" IsReadOnly="False" EditTriggers="F2" Width="200"></telerik:RadGridView>
 
// MainWindow.xaml.cs
 
public partial class MainWindow : Window
    {
        IList<Student> studentList = new List<Student>();
         
        public MainWindow()
        {
            InitializeComponent();
            InitializeStudentList();
            LoadGrid();
        }
 
        void InitializeStudentList()
        {
            studentList.Add(new Student { FirstName = "Robert", LastName = "Williams" });
            studentList.Add(new Student { FirstName = "Eric", LastName = "James" });
            studentList.Add(new Student { FirstName = "Randy", LastName = "Spencer" });
            gridView.ItemsSource = studentList;
        }
 
        void LoadGrid()
        {
            gridView.CellValidating += HandleCellValidating;
        }
 
        void HandleCellValidating(object sender, GridViewCellValidatingEventArgs e)
        {
            if (studentList.Any(s => s.FirstName == e.NewValue.ToString()))
            {
                e.Handled = true;
                throw new Exception();
            }
        }
    }
Dimitrina
Telerik team
 answered on 19 Nov 2014
1 answer
145 views
Hello,

I am using scrollindexintoviewasync  to keep my record in the screen after an edit. I have the below code. It reloads the grid and then calls the ScrollIndexIntoView to display the record. But it is displaying at the bottom of the grid. Could someone please give me an idea why please?

private void EditItem(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
        {
            GridViewRow row = e.Row;
            int index = this.RadGridView.Items.IndexOf(this.RadGridView.SelectedItem);
            GridData recordChanged = (GridData)e.NewData;
            dataService.EditRecord(recordChanged);
            this.RadGridView.ItemsSource = dataService.GetGridData();
            this.RadGridView.ScrollIndexIntoViewAsync(index, null, new Action<FrameworkElement>((f) => { (f as GridViewRow).IsSelected = true; }), null);

            LoadTablesAndGrid();
        }

Thank you,
Aryn


Dimitrina
Telerik team
 answered on 19 Nov 2014
5 answers
257 views
So, when using RadDataFilter in unbound mode, how does the actual filtering get done? I've subscribed to the FilterDescriptor events so I know *when* to do it, but not *how*. Do I need to iterate over the FilterDescriptors and write filtering code myself? I don't see how I can do that, since the only function available on those descriptors is CreateFilterExpression(Expression instance), but I can't find any documentation in the Telerik help on it. What is the instance parameter? Is there a sample that actually demonstrates this?

- Lutz
Dimitrina
Telerik team
 answered on 19 Nov 2014
7 answers
3.1K+ views
Hi,
I want my date picker to show only months and year in the calender. and on selection the date picker should show only the selected month and year(mm/yy). This kind of date picker is required in case of getting expiry date for credit card.
I tried to set some formatting string in my xaml page but it didn work.
Any help in this regard will be appreciating.

Thanks,
Anil
Nasko
Telerik team
 answered on 19 Nov 2014
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?