Telerik Forums
UI for WPF Forum
12 answers
306 views
Hi!

I have a TileView and TileConfigView UserControls and I would like to show pre-designed TileView (TileView.xaml) as RadFluidContentControl.Content and pre-designed TileConfigView (TileConfigView.xaml) as RadFluidContentControl.LargeContent.

I Was able to bind TileView to .Content using {Binding TileContent} but for some reason the tile's size is not the same as the TileView UserControl's size. In addition I needed to make property to TileView's codebehind for it to work because I don't know how to get the view from the viewmodel:

// in TileView.xaml.cs
public TileView TileContent
{
    get { return this; }
}

But if I want to have different view for .LargeContent this seems like not the way to do it.

This is my contentTemplate for RadTileView (Width="Auto" and Height="Auto" didn't help with getting the tile's size match that of the actual view):

<DataTemplate x:Key="contentTemplate">
            <telerik:RadFluidContentControl ContentChangeMode="Manual"
                                            State="Normal"
                                            TransitionDuration="0:0:.5"
                                            DataContext="{Binding}">
                <telerik:RadFluidContentControl.Content>
                    <ContentControl Content="{Binding TileContent}"
                                    Width="Auto"
                                    Height="Auto"
                                    HorizontalContentAlignment="Center"
                                    />
                </telerik:RadFluidContentControl.Content>
                <telerik:RadFluidContentControl.LargeContent>
                    <ContentControl Content="{Binding ConfigContent}"
                     HorizontalAlignment="Stretch"
                     HorizontalContentAlignment="Stretch"
                     VerticalAlignment="Stretch"
                     VerticalContentAlignment="Stretch" />
                </telerik:RadFluidContentControl.LargeContent>
            </telerik:RadFluidContentControl>
        </DataTemplate>

Is there a proper way to do this so that I can have pre-designed TileView and TileConfigView per Tile and have those used as .Content and .LargeContent?

Br,

Kalle
Pavel R. Pavlov
Telerik team
 answered on 15 Apr 2013
2 answers
98 views
Hey Telerik,

The ZIndex of the Special Slots is set to 1 hard coded instead of using the Canvas.ZIndex property of the style of the special slot. This way it's hard to do the correct layering of the slots (in the case there are multiple types). I resolved the issue by one way binding and letting it reevaluate ontargetupdated. The binding result always returns the correct ZIndex property of the type of slot. Just a small bug, however due to the recycling of slots it has some perfomance penalties.

Cheers,
Nico
Shawn Shaddock
Top achievements
Rank 1
 answered on 15 Apr 2013
1 answer
591 views
I thought the Loaded event should only fire when the control is just about to render?

When I programmatically add a tab to the TabControl with a UserControl on it, the Loaded event of the UserControl fires although the tab isn't selected and thus the UserControl shouldn't be rendered.

I'm also asking because I then have the problem that when I set the SelectedItem of the TabControl to be the newly added Tab, the Loaded event of the UserControl gets fired yet again.

So in the process of adding and selecting the tab, the Loaded event of the UserControl gets fired twice which isn't desirable.

Edit: It does only seem to happen if the first tab is added to the TabControl for the first time.

Why is that, and is there a better way to prevent this from happening without resorting to some sort of boolean flag testing solution in the Loaded event handler?
Pavel R. Pavlov
Telerik team
 answered on 15 Apr 2013
1 answer
59 views
Hi,

I have a user control that is used in a listbox. This UC is drag and drop enabled to move it from one list to another. This works. I have list boxes in the UC that are DND enabled to drag data into. I have this working as well. My next step is to be able to drag the item in the UC child list to another list. Right now the whole UC wants to move as part of it's normal process but I only want to move the child list item. Can this be done? Example please.

Thanks.
George
Telerik team
 answered on 15 Apr 2013
1 answer
144 views
Hello,

I am using version 2012.3 and am trying to export a RadGridView to excel. The data table is very large, over 1bil cells, and when I try to export to excel I get an out of memory exception.

The project can only be deployed as an x86 platform application. I included the code below, how can I export a large table in this application?


Thank you,
Eli

SaveFileDialog dialog = new SaveFileDialog();
string extension = "xml";
dialog.DefaultExt = extension;
dialog.Filter = string.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", extension, "ExcelML");
dialog.FilterIndex = 1;
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string exportString = radGridView.ToExcelML();

using (Stream stream = dialog.OpenFile())
{
byte[] bytes = Encoding.UTF8.GetBytes(exportString);
stream.Write(bytes, 0, bytes.Length);
}
}
Dimitrina
Telerik team
 answered on 15 Apr 2013
5 answers
190 views
Consider my ConnectionManipulationCompleted event handler:

private void diagram_ConnectionManipulationCompleted(object sender, ManipulationRoutedEventArgs e)
{
    if (e.ManipulationStatus == ManipulationStatus.Attaching)
    {
        var source = e.Connection.Source as MyChartShape;
        ...
    }
}

In some cases e.Connection.Source is null. E.g.
1) From a node's connector, drag a new connection.
2) Detach the connection so you end up with a floating one.
3a) Re-attach the tail of the connection to the node's connector. Source is null, target is valid!
3b) Re-attach the head of the connection to the node's connector. Source is null, target is valid!


In 3a the target is in fact the source. In 3b the target is indeed the target. How can I distinguish these two scenarios?
Obviously, in 3a I want a way to see that the target is the source so that I can successfully update our underlying data where the direction of the connection is critical!
Tina Stancheva
Telerik team
 answered on 15 Apr 2013
13 answers
228 views
Seems like a bug. Now I have to re-assign the GraphSource instance in order to see changes in the view. Adding/removing items has no effect.
Tina Stancheva
Telerik team
 answered on 15 Apr 2013
9 answers
104 views
Hi,

How would you modify this program so that when dragging it shows the contents of the ID or UserName column.  Ideally this might be done when calling RowOrderBehaviorSetIsEnable(Grid1, true).  This would allow the code to handle more than 1 data format.

Thanks
Rich
Richard Harrigan
Top achievements
Rank 1
 answered on 15 Apr 2013
1 answer
257 views
Hello, 
I'm running into a problem involving focus not being lost on an editable RadComboBox (in a property grid) when I click on a RadRibbonButton (in a RadRibbonGroup).  If I type some text into the combo box text area, it is not stored to the dependency property that it is bound to until the control loses focus.

<telerik:RadComboBox
   IsMouseWheelEnabled="False"
   ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
   IsEditable="True"
   Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=LostFocus}">
   <telerik:RadComboBox.ItemsSource>
      <Binding Converter="{StaticResource AssetToListConverter}">
         <Binding.Path>Value</Binding.Path>
      </Binding>
   </telerik:RadComboBox.ItemsSource>
</telerik:RadComboBox>

This is required because the Value property is coerced to a valid string before being accepted, and without UpdateSourceTrigger=LostFocus the text box fails to take on the coerced value, something broken in the binding there.

public Object Value
{
   get
   {
      return _property.GetValue(_asset, null);   //using reflection
   }
   set
   {
      //SetValue ends up calling a coerce function which leaves the property untouched if value is invalid
      _property.SetValue(_asset, value, null);
      RaisePropertyChanged(() => Value);
   }
}

If UpdateSourceTrigger was set to PropertyChanged, this setter would be called every time the user types any characters.  If they type an invalid character the coerce function leaves the property unchanged but the text box displays the incorrect string, even though Value is different.

If the user starts typing something into the combo box and then clicks the button (which does a save or export), the Value is not set because the combo box does not lose focus.

<telerik:RadRibbonGroup x:Name="root" Header="Destructible" DialogLauncherVisibility="Collapsed">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <telerik:RadRibbonButton Grid.Row="0"
                                     Grid.Column="0"
                                     Text="New"
                                     IsAutoSize="True"
                                     Command="{Binding NewCommand}" />
        <telerik:RadRibbonButton Grid.Row="1"
                                     Grid.Column="0"
                                     Text="Save"
                                     IsAutoSize="True"
                                     Command="{Binding SaveCommand}" />
        <telerik:RadRibbonButton Grid.Row="2"
                                     Grid.Column="0"
                                     Text="Export"
                                     IsAutoSize="True"
                                     Command="{Binding ExportCommand}" />
    </Grid>
</telerik:RadRibbonGroup>

These two controls are in different assemblies.  I tried clearing focus for the scope in the button command code-behind but at that time Keyboard.FocusedElement is the button.  I can't find any way to force all focus scopes to clear their FocusedElement fields either.  I tried playing with the button's IsTabStop property.  I tried hooking up to a focus changed event on the button (can't find one that gives me the previously focused element, and it probably wouldn't be what I want thanks to focus scopes).  

I might be able to cache off the element every time something changes focus in the property grid and clear its focus scope on button clicks, but this doesn't seem very scaleable.

So I need to fix one of two problems.  Either figure out how to clear focus on the combo box when the button is clicked but before the command is executed, or figure out how to fix the binding issue of the text in the combo box.  Do you have any advice on either fronts?

TIA, Jay
Zarko
Telerik team
 answered on 15 Apr 2013
1 answer
137 views

Requirement:
Set the font, the foreground and background color of the grid (headerrow and and "datarow) at runtime over a context menu. Save it and reload theses on restart.

Actual situation:
- We have implemented a contextmenu for the grid with an attached property. On attaching it "taps" the grid and it is possible to enable and disable single columns over this context menu which opens on right mouse click on header.
- Additional to that, we implemented an additional attached property which also "taps" to the grid OnAttaching, which allows to save the grid settings (columns width, enable columns, filter...) to a file. Add restart the grid takes this settings add set the saved values.
- The grid is styles are in different resource dictionaries which will be added to Application.Current.Resources.MergedDictionaries

Problem:
Now, I would like to add some additional context menu (this works) with color pickers and a font picker (does telerik have a font picker in future for wpf?).
If an new color is selected I created a new style (in code behind) an added it to the resources of the grid. This runs, but now I can't find a solution to save this style like the over values. 

How can I save this lokal style? Is this solution wrong? Do you have an better simpler solution?

Thanks & Regards

 

Dimitrina
Telerik team
 answered on 15 Apr 2013
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?