Telerik Forums
UI for WPF Forum
2 answers
60 views
 Urgent.... My client has a bug in production enviroment and he can
not do his work. This feature is important and I do not have any
workarround

 I am trying to draw something with splecialslot  style . But the
DataContext of highlightitem is changing incorrectly, and I can not
control the correct positioning of specific images with  databinding

<ctr:SpecialSlotStyleSelector x:Key="
SpecialSlotStyleSelector">
       <ctr:SpecialSlotStyleSelector.MarcaStyle>
           <Style TargetType="telerik:HighlightItem">
               <Setter Property="Panel.ZIndex" Value="20" />
               <Setter
Property="bv:HackIsHitTestVisible.IsHitTestVisible" Value="true"/>
               <Setter Property="Template">
                   <Setter.Value>
                       <ControlTemplate>
                           <Grid >
                               <Border  IsHitTestVisible="False"
Background="White" Opacity="0.25" >

                               </Border>
                               <Grid IsHitTestVisible="True"
telerik:RadDragAndDropManager.AllowDrag="True"
Background="Transparent" x:Name="root" HorizontalAlignment="Center">
                                   <Grid.InputBindings>
                                       <MouseBinding
MouseAction="LeftDoubleClick" CommandParameter="{Binding
Path=Marcador}" Command="app:AppCommands.ShowMarkEditVw"/>
                                   </Grid.InputBindings>
                                   <Grid.ColumnDefinitions>
                                       <ColumnDefinition
Width="auto"></ColumnDefinition>
                                   </Grid.ColumnDefinitions>
                                   <Image Margin="0,0,0,0"
Source="{Binding Imagem, Converter={StaticResource imageConverter}}"/>

                                   <telerik:RadButton Grid.Column="1"
x:Name="DeleteButton" Opacity="1" Visibility="Collapsed"
                                                                               CommandParameter="{Binding Path=Marcador.ID_ViaturasMarcadores}"
                                                                               Command="local:AppCommands.RemoveMark"
                                                                               HorizontalAlignment="Right" Height="11" Margin="1,1,-11,1" Padding="0"
                                                                               VerticalAlignment="Top" Width="11">
                                       <telerik:StyleManager.Theme>
                                           <telerik:Expression_DarkTheme />
                                       </telerik:StyleManager.Theme>
                                       <Path Data="M0,0L5,5 M5,0L0,5"
Stroke="#FFDDDDDD" />
                                   </telerik:RadButton>


                               </Grid>
                           </Grid>

                           <ControlTemplate.Triggers>
                               <Trigger Property="IsMouseOver"
Value="true" SourceName="root">
                                   <Setter Property="Visibility"
Value="Visible" TargetName="DeleteButton" />

                               </Trigger>
                           </ControlTemplate.Triggers>
                       </ControlTemplate>
                   </Setter.Value>
               </Setter>
           </Style>
       </ctr:SpecialSlotStyleSelector.MarcaStyle>
   </ctr:SpecialSlotStyleSelector>
Mário
Top achievements
Rank 1
 answered on 05 Apr 2011
2 answers
203 views
Hi,telerik.
    Here is a problem of the Docking Loadlayout.
    First, click the "Add New Item" button add some panel.
    Second,click the "Save Layout".At this time,click "Add New Item" button can add a panel to Docking.
    Now, click the "Load Layout" button,then click the "Add New Panel" button,there is no panel added to the Docking...
    Oh,the Title should be:"Can't Add a new RadPane to Docking After LoadLayout"

Here is the xaml
<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="ISSUE.MainWindow"
        Title="MainWindow" Height="526" Width="762">
  
    <Grid Background="{Binding Background,ElementName=Docking}">
        <Grid.RowDefinitions>
            <RowDefinition Height="90" />
            <RowDefinition Height="288*" />
        </Grid.RowDefinitions>
        <telerik:RadDocking HasDocumentHost="True" Name="Docking" Grid.Row="2" >
            <!--DocumentHost-->
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup x:Name="GroupDocument">
  
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
  
            <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="260,260" MaxWidth="400" 
                    Name="LeftContainer" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup x:Name="GroupLeft">
                    <telerik:RadPane Header="Test" telerik:RadDocking.SerializationTag="MENU"  CanUserClose="False" />
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="200,200" MaxWidth="400"
                    x:Name="RightContainer" InitialPosition="DockedRight">
                <telerik:RadPaneGroup x:Name="GroupRight">
  
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="200,200"
                    x:Name="BottomContainer" InitialPosition="DockedBottom">
                <telerik:RadPaneGroup x:Name="GroupBottom">
                    <telerik:RadPane Header="Output" telerik:RadDocking.SerializationTag="OUTPUT"  CanUserClose="False" />
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
        </telerik:RadDocking>
        <Button Content="Load Layout" Height="64" HorizontalAlignment="Left" Margin="196,12,0,0" Name="button1" VerticalAlignment="Top" Width="178" Click="button1_Click" />
        <telerik:RadButton Content="Add New Panel" Grid.Row="1" Height="49" HorizontalAlignment="Left" Margin="12,33,0,0" Name="radButton1" VerticalAlignment="Top" Width="107" Click="radButton1_Click" />
        <Button Content="Save Layout" Height="64" HorizontalAlignment="Left" Margin="12,12,0,0" Name="button2" VerticalAlignment="Top" Width="178" Click="button2_Click" />
    </Grid>
</Window>




And here is the cs code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using System.IO;
  
namespace ISSUE
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
  
        private void radButton1_Click(object sender, RoutedEventArgs e)
        {
            RadPane rp = new RadPane();
            rp.Header = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            rp.Title = rp.Header;
  
            RadDocking.SetSerializationTag(rp, rp.Header.ToString());
            this.GroupDocument.Items.Add(rp);
        }
  
        string layout = string.Empty;
  
        private string SaveLayoutAsString()
        {
            MemoryStream stream = new MemoryStream();
            this.Docking.SaveLayout(stream);
  
            stream.Seek(0, SeekOrigin.Begin);
  
            StreamReader reader = new StreamReader(stream);
            return reader.ReadToEnd();
        }
  
        private void LoadLayoutFromString(string xml)
        {
            using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
            {
                stream.Seek(0, SeekOrigin.Begin);
                this.Docking.LoadLayout(stream);
            }
        }
  
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            LoadLayoutFromString(layout);
        }
  
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            layout = SaveLayoutAsString();
        }
    }
}

George
Telerik team
 answered on 05 Apr 2011
1 answer
63 views
Is it possible to use BingGeocodeProvider without setting the .MapControl property? I'm using Prism with WPF and I want to be able to create the location for the map in the view model, and databind the RadMap control 'Centre' property to my view model 'MapLocation' property. Currently I get the following error.

System.Exception was unhandled
  Message=Routing Service Exception: Route Service Exception: Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.DataVisualization
  StackTrace:
       at Telerik.Windows.Controls.Map.BingGeocodeProvider.GeocodeAsync(GeocodeRequest request) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Map\Providers\Geocode\BingGeocodeProvider.cs:line 88
       at DataAggregator.Modules.Cube.ViewModels.MapViewModel.RequestPersonalDataEvent(Person person)
       at Microsoft.Practices.Prism.Events.BackgroundEventSubscription`1.<>c__DisplayClass5.<InvokeAction>b__4(Object o)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
  InnerException:

Example XAML (with some bits removed to keep it simple)

 

 

 

 

<Grid>
    <telerik:RadMap x:Name="mapControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Provider="{Binding MapProvider}" Center="{Binding MapLocation}"/>
</Grid>

 

public class MapViewModel : ViewModelBase
   {
       const string _apiKey = "{key}";
       private readonly IEventAggregator _eventAggregator;
       private BingGeocodeProvider _geocodeProvider;
       private MapProviderBase _mapProvider;
       public MapProviderBase MapProvider
       {
           get { return _mapProvider; }
           set { _mapProvider = value; }
       }
       private Location _mapLocation;
       public Location MapLocation
       {
           get { return _mapLocation; }
           set { _mapLocation = value; this.RaisePropertyChanged(() => this.MapLocation); }
       }
         
       public MapViewModel(IEventAggregator eventAggregator)
       {
           _eventAggregator = eventAggregator;
           _eventAggregator.GetEvent<Infrastructure.RequestPersonalDataEvent>().Subscribe(this.RequestPersonalDataEvent, ThreadOption.BackgroundThread);
           _mapProvider = new BingMapProvider(MapMode.Aerial, true, _apiKey);
       }
       public void RequestPersonalDataEvent(Infrastructure.Models.Person person)
       {
           this.Working = true;
           _geocodeProvider = new BingGeocodeProvider(_apiKey);
           _geocodeProvider.GeocodeCompleted += this.geocodeProvider_GeocodeCompleted;
           GeocodeRequest request = new GeocodeRequest();
           request.Query = "Postcode";
           _geocodeProvider.GeocodeAsync(request);
       }
       private void geocodeProvider_GeocodeCompleted(object sender, GeocodeCompletedEventArgs e)
       {
           MapLocation = e.Response.Results[0].Locations[0]; 
           Working = false;
       }
   }
Andrey
Telerik team
 answered on 05 Apr 2011
1 answer
251 views
I want to Export All data from a RadGridView in a XML file but HOW TO ??????????
Please Help Me..
Vanya Pavlova
Telerik team
 answered on 05 Apr 2011
1 answer
124 views

Hi All!

 

I've created a DataGrid in "regular" WPF that supports groups and the items within a group are shown in a wrappanel. For this I could use the code below:

 

<DataGrid.ItemsPanel>
        <ItemsPanelTemplate>
               <WrapPanel IsItemsHost="True"/>
        </ItemsPanelTemplate>
</DataGrid.ItemsPanel>
Unfortunately it is way too slow for us. We would like to handle about a 1000 items and we are evaluating Telerik grid for that but I could not find a way to reproduce what I need. Each item should be represented with an image on the left, three lines of text on the right and a progress bar in the background. Grouping, sorting and filtering of items should be available (or at least not too complex to implement), hence the items source is a ListCollectionView. I did this in the original approach with a cell template and this works fine in both the "regular" DataGrid and in Telerik's GridView, but in the Telerik version I can't make the cell items appear next to each other.

 

 

The result should look something like this:

 

Group one:

  Item1 Item2 Item3 Item4

  Item5 Item6

Group two:

  Item7 Item8 Item9 Item10

Group three:

  Item11

 

So my questions:

Is there a way to access the gridview's ItemsPanel to do something similar, or are there any alternativse in the gridview?

 - OR -

Is there a more suitable control for this that can handle this many items and the result can look like the same?

 

Thanks in advance,

Istvan

Vlad
Telerik team
 answered on 05 Apr 2011
2 answers
140 views
I want to be able to create a button that when pressed will scroll the grid down to the next set of rows that were not visible. e.g. if the grid is showing 10 rows, pressing the button will scroll the grid down till row 11 is the top row.

I've tried using selecteditem but the grid doesn't focus on the row. Also is there a way to iterate through the rows to get their heights so I know which ones are visible or not?
Joshua
Top achievements
Rank 1
 answered on 04 Apr 2011
0 answers
95 views
I want to Extract all Data From RadGridView And Store into a DataTable.
Please Helppppppp
Md.Hasanuzzaman
Top achievements
Rank 1
 asked on 04 Apr 2011
1 answer
139 views
We have a user control which displays a NumericUpDown.  The maximum value of the control is set to 100.  When the user enters 200, the value automatically changes to 100.  When the user control is closed, the value of the NumericUpDown is reset to 200 which is an invalid value.  When the user control is reopened, an error appears next to the NumericUpDown control because it's value is really 200 even though 100 is displayed in the control.

We debugged the application.  The value of the NumericUpDown stays at 100 until [ExternalCode] is executed at which point the value of the control changes back to 200.
Valeri Hristov
Telerik team
 answered on 04 Apr 2011
1 answer
129 views
How can I make a set of RadRadioButtons such that their borders do not show until selected or moused over?

For example, see this image from the Word 2010 BackStage. The first item is selected. and when the user hovers the mouse over any item, its hover state is activated. Until then, no border or state is shown.
Petar Mladenov
Telerik team
 answered on 04 Apr 2011
14 answers
893 views
Is there a way to make the GridViewComboBox column update its backing property on change instead of on lost focus?  This is the default property for the combo box but does not appear to be the default in the grid view and setting the UpdateSourceTrigger in the DataMemberBInding to PropertyChanged does not appear to work.
Yavor Georgiev
Telerik team
 answered on 04 Apr 2011
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?