Telerik Forums
UI for WPF Forum
5 answers
186 views
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="auto"/>
    </Grid.RowDefinitions>
 
    <Button Content="test1" />
     
    <GroupBox Grid.Row="1" Header="test2"/>
     
    <Button Grid.Row="2" Content="test3"/>
</Grid>
When you use the code above, you have a nice header, footer, middle structure (the middle is stretched).
When you place this inside the DataTemplate of a RadDataForm, the middle doesn't get stretched.
How is it possible to stretch the middle inside a RadDataForm?

Thank you!
Vanya Pavlova
Telerik team
 answered on 16 Jan 2014
3 answers
287 views
Hello,

I have a view with x RadRichTextBoxes (x is dynamic) and want to access the content of each from my viewmodel. I know the DataProviders but I need more then binding just a string. E.g. I want to copy the selection from one RadRichTextBox to another one; including all the styles.
I tried a way via code-behind and it worked as expected:

            var editor1 = new RadDocumentEditor(radRichTextBox.Document);
            var editor2 = new RadDocumentEditor(radRichTextBox1.Document);

            editor1.Cut();
            editor2.Paste();

But I want to do all this in my viewmodel without code-behind.

Do you have any suggestions how I can do this?

Kind regards,
Philipp
Petya
Telerik team
 answered on 16 Jan 2014
4 answers
1.9K+ views
I switched to the NuGet RadControls for WPF package and now non of the Telerik controls render at all. They simply don't appear. White spaces where they should be. Not sure what additional info to give you. There's no output messages that appear to be in error. Simply, none of the controls appear.

Any idea? I tried disabling the Theme I was using in case that was it, and still nothing.
Petar
Telerik team
 answered on 16 Jan 2014
11 answers
391 views
at Telerik.Windows.Controls.GridView.AggregatesToGroupFooterAggregatesConverter.<>c__DisplayClass4.<Convert>b__1(AggregateResult f)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at MS.Internal.Data.EnumerableCollectionView.LoadSnapshotCore(IEnumerable source)
   at MS.Internal.Data.EnumerableCollectionView.LoadSnapshot(IEnumerable source)
   at MS.Internal.Data.EnumerableCollectionView.RefreshOverride()
   at System.Windows.Data.CollectionView.Refresh()
   at Telerik.Windows.Controls.GridView.GridViewFooterCell.AggregateResults_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.CreateAggregateResults()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.CalculateAggregates()

I have two GridViews both host in a DockPane and with sumfuction aggregation footers, the itemsource is ObservableCollection, Everything works well until I dragged one of the panes and docked somewhere in the RadDocking, the NullReferenceException occrured. the stacktrace (as above shown) is my subscription method on propertychanged called the GridView's CalculateAggregates. I also tried the refresh method and rebind method, both got the same exception.
This only happened after I updated to 2011 Q2 SP1.
Christian
Top achievements
Rank 1
 answered on 16 Jan 2014
1 answer
58 views
Hi,

We have to Print RadTreeListView. Please suggest me the best solution. 

We have tried with some samples using creating FixedDocument and using Document Viewer. I am able to see the content in Document Viewer, while printing only Header content alone printed. 

Please suggest the best appraoch to print TreeListView

Thanks
Dimitrina
Telerik team
 answered on 16 Jan 2014
1 answer
152 views
Hi,

We have to Print RadTreeListView. Please suggest me the best solution. 

I have tried with some samples using creating FixedDocument and using Document Viewer. I am able to see the content in Document Viewer, while printing only Header content alone printed. 

Please suggest the best appraoch to print TreeListView

Thanks
Dimitrina
Telerik team
 answered on 16 Jan 2014
1 answer
70 views

Hello,



We are using the RichTextBox to display emails and the emails coming from one of the servers shows the embedded image as 10 x 10 pixels.  If I take the temporary image that was downloaded (and linked to the ImageInline) and send it in another email or open it with an image viewer, it shows up with the proper dimensions.



Thanks,

Wil

Wil
Top achievements
Rank 1
 answered on 15 Jan 2014
1 answer
179 views
Hi,

my need is to store and restore Filter settings.
The scenario - a grid with Names is in a dialog.
The user (for an example) chooses "Joe" in the Firstname Column and "Doe" in the FamilyName column.

Prior closing the Dialog I store the FilterDescriptors like this:
//pFilterDescriptors is the FilterDescriptors collection from RadGridView
//_FilterStore is a local CompositeFilterDescriptorCollection
public void StoreFilter(Telerik.Windows.Data.CompositeFilterDescriptorCollection pFilterDescriptors) {
    if(_FilterStore != null) {
        _FilterStore.Clear();
        foreach(IFilterDescriptor o in pFilterDescriptors) {
            _FilterStore.Add(o);
        }
    }
}

The next time I open the dialog I restore these stored Values like this:
//pFilterDescriptors is the FilterDescriptors collection from RadGridView
//_FilterStore is a local CompositeFilterDescriptorCollection
public void RestoreFilter(Telerik.Windows.Data.CompositeFilterDescriptorCollection pFilterDescriptors) {
    if(pFilterDescriptors != null) {
        pFilterDescriptors.Clear();
        foreach(IFilterDescriptor o in _FilterStore) {
            pFilterDescriptors.Add(o);
        }
    }
}

This works - but when I open the filter box only "Joe" can be found in the distinct values.
"Clear Filter" on the column is also not working since the column nows nothing about filtering.

What I need (expected) is:
   a.) Highlighted Filter Symbols in the filtered columns
   b.) Filtered Values available in the Filter Selector (also those not visible at the moment)

Or in simple Words - the RadGridView should look / work like it did when I closed the dialog.

Manfred
ManniAT
Top achievements
Rank 2
 answered on 15 Jan 2014
1 answer
190 views
Hello,

We have implemented custom insert logic in our grids via the context menu.
However, when there are no items in the grid, the user can't use the context menu so we show the "Click here to insert new row".

Once there's an item in the collection, the "Click here to insert new row" is no longer shown.

We are having problems pinpointing the best location at which to handle this.

We check if the grid doesn't have any items and if the "CanUserInsertRows" property is set to true.
If these conditions both are true, we show the insert new row area, otherwise we hide it:

public void HandleNewRowPosition()
{
    var showNewRow = !GridTreeListHasItems() && Grid.CanUserInsertRows;
    Grid.NewRowPosition = GetInsertNewRowPosition(showNewRow);
}
 
private bool GridTreeListHasItems()
{
    var anyValue = false;
    var x = Grid.ItemsSource as IEnumerable;
    if (x != null)
    {
        anyValue = x.GetEnumerator().MoveNext();
    }
 
    return anyValue;
}
 
private GridViewNewRowPosition GetInsertNewRowPosition(bool show)
{
    var converter = new BooleanToGridViewNewRowPositionConverter();
 
    return (GridViewNewRowPosition)converter.Convert(show, typeof(GridViewNewRowPosition), null, CultureInfo.CurrentUICulture);
}
 
 /// <summary>
/// Converts a boolean to the position of new rows. True corresponds with the top.
/// </summary>
[ValueConversion(typeof(bool), typeof(GridViewNewRowPosition))]
public class BooleanToGridViewNewRowPositionConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return (bool) value ? GridViewNewRowPosition.Top : GridViewNewRowPosition.None;
    }
 
    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return (GridViewNewRowPosition) value == GridViewNewRowPosition.Top;
    }
}


I tried adding a value changed callback to the "CanUserInsertRows" dependency property, but it doesn't seem to trigger the callback when I do a Notify property changed on the property which is bound to the "CanUserInsertRows" property of the grid:

_canUserInserRowsPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(GridViewDataControl.CanUserInsertRowsProperty, typeof(GridViewDataControl));
 
if (_canUserInserRowsPropertyDescriptor != null)
{
    _canUserInserRowsPropertyDescriptor.AddValueChanged(this.AssociatedObject, CanUserInserRowsChanged_Handler);
}
 
private void CanUserInserRowsChanged_Handler(object sender, EventArgs e)
{
    HandleNewRowPosition();
}

We used to call the "HandleNewRowPosition" method at several places (eg "OnItemsChanged", "OnLoaded", ...) but we noticed that it got called way to many times when we only expected it once, maybe twice.

Anyone have an idea on how to do this properly?

Hristo
Telerik team
 answered on 15 Jan 2014
3 answers
532 views
The save load layout example is not mvvm. The example uses code behind to call the SaveLayout and LoadLayout on the docking control and it does not use a view model. Where is an example of radDocking save and load layout using no code behind. ?
Vladi
Telerik team
 answered on 15 Jan 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
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?