Telerik Forums
UI for WPF Forum
3 answers
666 views
Hello

I'm using a details template for a row as follows:
<DataTemplate x:Key="DiscussionDetailsTemplate"
            <Grid> 
                <Grid.ColumnDefinitions> 
                    <ColumnDefinition Width="Auto" /> 
                    <ColumnDefinition Width="*" /> 
                </Grid.ColumnDefinitions> 
                <Grid.RowDefinitions> 
                    <RowDefinition Height="Auto"/> 
                </Grid.RowDefinitions> 
                <TextBlock Grid.Row="0" Grid.Column="0" Text="Discussion Text: " Margin="12,0,0,0" FontSize="13" FontWeight="Bold" /> 
                <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding mNotes}" TextWrapping="Wrap" FontSize="13" Margin="12,0,0,0" HorizontalAlignment="Left" /> 
            </Grid> 
        </DataTemplate> 

Basically, the details template shows a potentially long message in a discussion.  Here's the code for the grid using the template:

<telerik:RadGridView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Name="DiscussionListGridView" Style="{DynamicResource DefaultGrid}"  
                                 ItemsSource="{Binding DiscussionList}" SelectedItem="{Binding SelectedDiscussion}" AutoGenerateColumns="False"  
                                 ScrollMode="RealTime" DataLoadMode="Synchronous" CanUserSortColumns="True"  
                                 RowDetailsVisibilityMode="VisibleWhenSelected" RowDetailsTemplate="{StaticResource DiscussionDetailsTemplate}" 
                                 > 
                <telerik:RadGridView.Resources> 
                    <Style TargetType="telerik:RadGridView"
                        <Setter Property="ShowGroupPanel" Value="False"/> 
                    </Style> 
                </telerik:RadGridView.Resources> 
 
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewDataColumn Width="Auto" Header="From" Name="AuthorName" IsReadOnly="True" DataMemberPath="sgAuthorName"  
                                                TextWrapping="Wrap"  /> 
                    <telerik:GridViewDataColumn Width="*" Header="Subject" Name="Subject" IsReadOnly="True" DataMemberPath="sgDescription"  
                                                TextWrapping="Wrap" /> 
                    <telerik:GridViewDataColumn Width="Auto" DataFormatString="{}{0:dd/MM/yyyy}" Header="Date" Name="StatusDateDue"  
                                                IsReadOnly="True" DataMemberPath="dtDateCreated" TextWrapping="Wrap"  /> 
                </telerik:RadGridView.Columns> 
            </telerik:RadGridView> 

The problem that I'm having is that if the text is particularly long in the row details view, it won't wrap automatically.  Instead it forces a scrollbar at the bottom of the grid and makes the user manually scoll - this isn't my desired behaviour.

Any tips on how to cause the text to wrap correctly?



James
Top achievements
Rank 1
 answered on 11 Nov 2009
4 answers
129 views
Hi

I'm trying to get a custom hierarchy going in the new Q3 Gridview.  The examples don't explain how to do this properly (the example under Custom Hierarchy is actually a Property Hierarchy).

Here's how I did it in the previous version:

        public FailedMessagesView() 
        { 
            InitializeComponent(); 
            FailedFaxGrid.TableDefinition.PreviewDataRecordCreate += FailedFaxTableDefinition_PreviewDataRowCreate; 
        } 
 
        private void FailedFaxTableDefinition_PreviewDataRowCreate(object sender, DataRecordCreateEventArgs e) 
        { 
            FailedMessagesViewModel fmVM = (FailedMessagesViewModel)DataContext; 
            SuppliersEntity theSupplier = (SuppliersEntity)e.Data; 
            ObservableCollection<MessagesCheckedEntity> theMessages = new ObservableCollection<MessagesCheckedEntity>
                fmVM.FailedFaxes.Where(m => m.fkidSupplier == theSupplier.idSupplier).ToList()); 
            if (theMessages.Count > 0) 
            { 
                e.IsExpandableRecord = true
                GridViewTableDefinition ffDefs = new GridViewTableDefinition(); 
                ffDefs.AutoGenerateFieldDescriptors = false
                ffDefs.DataSource = theMessages
 
                GridViewDataColumn checkBox = new GridViewDataColumn(); 
                checkBox.Name = "FailedFaxCheckValName"
                checkBox.Header = " "
                checkBox.IsFilterable = false
                checkBox.IsGroupable = false
                checkBox.IsReadOnly = true
                checkBox.CellStyle = (Style)FailedFaxGrid.FindResource("checkValueStyle"); 
                checkBox.Width = GridViewLength.Auto; 
                ffDefs.FieldDescriptors.Add(checkBox); 
 
                GridViewDataColumn JobNo = new GridViewDataColumn(); 
                JobNo.Name = "FailedFaxJobNoName"
                JobNo.Header = "Job"
                JobNo.IsFilterable = false
                JobNo.IsGroupable = false
                JobNo.IsReadOnly = true
                JobNo.DataMemberBinding = new Binding("DataRow[sgCommonName]"); 
                JobNo.Width = GridViewLength.Auto; 
                ffDefs.FieldDescriptors.Add(JobNo); 
 
                GridViewDataColumn task = new GridViewDataColumn(); 
                task.Name = "FailedFaxTaskName"
                task.Header = "Task"
                task.IsFilterable = false
                task.IsGroupable = false
                task.IsReadOnly = true
                task.DataMemberBinding = new Binding("DataRow[sgItemName]"); 
                task.Width = GridViewLength.Auto; 
                ffDefs.FieldDescriptors.Add(task); 
 
                GridViewDataColumn TaskNotes = new GridViewDataColumn(); 
                TaskNotes.Name = "TaskNotes"
                TaskNotes.Header = "Task Notes"
                TaskNotes.IsFilterable = false
                TaskNotes.IsGroupable = false
                TaskNotes.IsReadOnly = true
                TaskNotes.DataMemberBinding = new Binding("DataRow[mNotes]"); 
                TaskNotes.Width = new GridViewLength(1, GridViewLengthUnitType.Star); 
                TaskNotes.TextWrapping = TextWrapping.Wrap; 
                ffDefs.FieldDescriptors.Add(TaskNotes); 
 
                GridViewDataColumn ReceiptDetails = new GridViewDataColumn(); 
                ReceiptDetails.Name = "ReceiptDetails"
                ReceiptDetails.Header = "Failure Reason"
                ReceiptDetails.IsFilterable = false
                ReceiptDetails.IsGroupable = false
                ReceiptDetails.IsReadOnly = true
                ReceiptDetails.DataMemberBinding = new Binding("sgReciptDetails"); 
                ReceiptDetails.Width = new GridViewLength(1, GridViewLengthUnitType.Star); 
                ReceiptDetails.TextWrapping = TextWrapping.Wrap; 
                ffDefs.FieldDescriptors.Add(ReceiptDetails); 
                e.ChildTableDefinitions.Add(ffDefs); 
            } 
        } 

A warning pops up telling me that this method is obsolete, and doing it this way no longer works.
James
Top achievements
Rank 1
 answered on 11 Nov 2009
1 answer
116 views
I am trying to change the chart type used in the Grouping and Aggregation demo from a Bar to a Line and recieve the following error. 'SelfDrawingSeries' TargetType does not match type of element 'Line' when I try to run it.

The only change I have made to the example code is on this line:
mapping1.SeriesDefinition = new BarSeriesDefinition(); 
 
Changed to 
 
mapping1.SeriesDefinition = new LineSeriesDefinition(); 

This also happens with the SplineSeries as well.

Am I missing something or is this a bug?

Thanks

Edit: I should have mentioned I am using the 10/23 Beta 2 build
David
Top achievements
Rank 1
 answered on 11 Nov 2009
1 answer
102 views
I have two grid's where I can dragdrop from "grid 1" to "grid2", I can drop and insert anywere in the grid (all works fine) but I can only drop in the rows I see.

I need the grid to scroll down if I try to drop at the bottom of the rows, and scroll up if I drop at the top row.

How do I code that in C# (I'm using "RadDragAndDropManager")

Kennet
Top achievements
Rank 2
 answered on 10 Nov 2009
1 answer
93 views
hello,

i am using your grid and i need to set the style of the cells dynamically based on the dataitem i have.
How should i do it?

I thought about inherit from GridViewDataColumn, but didn't know how to do it correctly (i.e. apply the data binding etc)


Thanks,
ofer
Vlad
Telerik team
 answered on 10 Nov 2009
4 answers
184 views
Hi,

It seems I can never get ScrollIntoView work. I got an error when I do:

if (grid.SelectedItem !=null)
    grid.ScrollIntoView(grid.SelectedItem);

Did I miss anything?

Thanks,
Milan
Telerik team
 answered on 10 Nov 2009
1 answer
178 views
i heard that you can do it with ChildTableDefinition

can someone show me how to do it?

i currently have 2 levels (parent->child)
i want to have 3 levels (parent->child->child of child)

how can i do it?

this is the xaml:

<Window x:Class="SimaClient.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    Title="Sima Client" Height="300" Width="400" WindowStyle="ToolWindow">  
    <Grid> 
        <telerik:RadGridView Name="RadGridView1" ShowGroupPanel="False" IsReadOnly="True" AutoGenerateColumns="False" ColumnsWidthMode="Fill">  
 
            <telerik:RadGridView.ChildTableDefinitions> 
                <telerik:GridViewTableDefinition /> 
            </telerik:RadGridView.ChildTableDefinitions> 
 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="ID" Width="100" /> 
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name"  Width="200"/>  
            </telerik:RadGridView.Columns> 
 
            <telerik:RadGridView.HierarchyChildTemplate> 
                <DataTemplate> 
                    <telerik:RadGridView x:Name="RadGridView1" AutoGenerateColumns="False" ItemsSource="{Binding Routes}" ShowGroupPanel="False" IsReadOnly="True">  
                        <telerik:RadGridView.Columns> 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="Route ID" /> 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Route Name" /> 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding WayPointsNum , Mode=OneWay }" Header="Number of WP" /> 
                        </telerik:RadGridView.Columns> 
                    </telerik:RadGridView> 
                </DataTemplate> 
            </telerik:RadGridView.HierarchyChildTemplate> 
 
        </telerik:RadGridView> 
    </Grid> 
</Window> 
 
Vlad
Telerik team
 answered on 10 Nov 2009
1 answer
96 views

i tried using the GridViewColumn.CellTemplate but i can't change it at runtime,

what i want to do is on the RowLoaded event change the cell visual tree(ComboBox, CheckBox)
based on the type of the object in the Cell.Content

i want to be able to change it for each individual cell
not a whole row/Column


i know that somewhere inside the cell there is a:

{System.Windows.Controls.Border}
and inside of it there is

{Telerik.Windows.Controls.GridView.AlignmentContentPresenter}
and inside of it there is the CellTemplate
but i can't access it from c#

 

i also tried to put in the resources of the GridView, couple of DataTemplates for different types (int,brush,enum)
but it ignors the resources

Vlad
Telerik team
 answered on 10 Nov 2009
2 answers
107 views
I setup a simple TileView test application (WPF 2009 Q3 Release).  The tile item does not follow the mouse drag point, especially if mouse acceleration is enabled and the mouse is moved faster.  It happens with multiple rows/columsn but seems most pronounced with a single column such as the code below:    (screenshot attached)  (grabbed first tile item header, moved mouse to bottom, then to top, ended up with blank area at top, mouse pointer at top, tile item 1/2 way up the list.)

Any ideas for fixing this?

 

<Window x:Class="TileViewTest2.Window2" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Window2" Height="800" Width="200 " xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">  
    <Grid> 
            <telerik:RadTileView MaxColumns="1" Height="auto" Name="radTileView1" Width="auto" MaximizeMode="Zero">  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem1" Width="auto"/>  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem2" Width="auto"/>  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem3" Width="auto"/>  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem4" Width="auto"/>  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem5" Width="auto"/>  
            </telerik:RadTileView> 
    </Grid> 
</Window> 
Tihomir Petkov
Telerik team
 answered on 09 Nov 2009
3 answers
135 views
Hello,

In testing your q3 beta of RadControls for WPF, I believe I have run into a bug with the new TileView control when using it in a WinForm. The TileView control displays properly, however the ability to drag and drop the individual tiles does not work.  This functionality is present when the WPF UserControl containing the TileView is hosted in a WPF Application, however I cannot get it to work when hosting in a WinForm.

Is there something special that I need to do to get the Tileview to function properly in a Windows Form?

Thanks,

Ben
Tihomir Petkov
Telerik team
 answered on 09 Nov 2009
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
Security
VirtualKeyboard
HighlightTextBlock
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?