Telerik Forums
UI for WPF Forum
5 answers
227 views
I have a problem where using a multi-binding to format axis labels correctly updates the labels, but does not resize correctly when the size of the labels change.

You can see the problem with this small example:
<Window x:Class="LabelTemplate_MultiBinding.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                xmlns:local="clr-namespace:LabelTemplate_MultiBinding"
                Title="MainWindow" Height="768" Width="1024">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <telerik:RadCartesianChart x:Name="PropertyChart">
            <telerik:RadCartesianChart.Resources>
                <local:ChartNumberFormatter x:Key="NumberFormatter"/>
                <DataTemplate x:Key="FormattedNumericAxisTemplate">
                    <TextBlock>
                        <TextBlock.Text>
                            <MultiBinding Converter="{StaticResource NumberFormatter}">
                                <Binding />
                                <Binding ElementName="PropertyChart"
                                         Path="DataContext.NumericFormat"/>
                            </MultiBinding>
                        </TextBlock.Text>
                    </TextBlock>
                </DataTemplate>
            </telerik:RadCartesianChart.Resources>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis LabelTemplate="{StaticResource FormattedNumericAxisTemplate}" />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Series>
                <telerik:LineSeries
                       CategoryBinding="Date"
                       ValueBinding="Value"
                       ItemsSource="{Binding Path=Series1}">
                </telerik:LineSeries>
            </telerik:RadCartesianChart.Series>
        </telerik:RadCartesianChart>
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Label>Y Axis Format:</Label>
            <TextBox Text="{Binding NumericFormat}" Width="200" />
        </StackPanel>
    </Grid>
</Window>

Code Behind:
public class MyPoint
{
    public DateTime Date { get; set; }
    public Double Value { get; set; }
}
public partial class MainWindow : Window, INotifyPropertyChanged
{
    public List<MyPoint> Series1 { get; private set; }
 
    private string _NumericFormat;
    public string NumericFormat
    {
        get { return _NumericFormat; }
        set
        {
            if (_NumericFormat != value)
            {
                _NumericFormat = value;
                OnPropertyChanged("NumericFormat");
            }
        }
    }
 
    public MainWindow()
    {
        Series1 = new List<MyPoint>();
        for (int i = 0; i < 5; i++)
        {
            DateTime date = DateTime.Today.AddDays(i);
            Series1.Add(new MyPoint() { Date = date, Value = i * 1000 });
        }
        InitializeComponent();
        DataContext = this;
    }
 
    #region INotifyPropertyChanged
    public event PropertyChangedEventHandler PropertyChanged;
    protected virtual void OnPropertyChanged(string propertyName = "")
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
    #endregion
}
public class ChartNumberFormatter : IMultiValueConverter
{
    public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        double number = System.Convert.ToDouble(values[0]);
        string format = values[1] as string;
        if (string.IsNullOrEmpty(format))
        {
            return number.ToString();
        }
        return number.ToString(format);
    }
    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

If you run this example, and in the Y-axis format box enter "e" then press tab to activate, you can see the numbers correctly change to scientific notation, but now they overlap the chart!

Can you recommend something to trigger the axis to be redrawn correctly?

Thanks,
Louis
Martin Ivanov
Telerik team
 answered on 26 Jun 2014
1 answer
230 views
Hi,
In my application, I open a modal window in a separate thread with following method:

public static void ShowInSeparateThread(Type windContent, string windowTitle, int width = 900, int height = 700)
        {
            var _viewerThread = new Thread(delegate()
            {
                var _eventAggregg = ServiceLocator.Current.GetInstance<IEventAggregator>();
 
                _eventAggregg.GetEvent<ShowModalPopUp>().Publish(true);
 
                var _win = new Window
                {
                    Title = windowTitle,
                    DataContext = new WindowDataContext(),
                    WindowStartupLocation = WindowStartupLocation.CenterScreen,
                    WindowStyle = WindowStyle.None,
                    Style = Application.Current.FindResource("PopUpWindowStyle") as Style,
                    Padding = new Thickness(0),
                    Margin = new Thickness(0),
                    ResizeMode = ResizeMode.NoResize,
                    Content = ServiceLocator.Current.GetInstance(windContent),
                    Width = width,
                    Height = height,
                    ShowInTaskbar = false
                };
 
               typeof(Window)
                    .InvokeMember("_ownerHandle",
                        BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetField,
                        null, _win, new object[] { Process.GetCurrentProcess().MainWindowHandle });
 
                _win.ShowDialog();
                _eventAggregg.GetEvent<ShowModalPopUp>().Publish(false);
            })
            {               
                IsBackground = true
            };
            _viewerThread.SetApartmentState(ApartmentState.STA);
            _viewerThread.Start();
        }
    }



In this window i navigate some user controls. One of that user controls contains a RadGridView binded to an ObservableCollection. When I add an item to ObservableCollection the grid items are properly notified, but when I try to remove an item from ObservableCollection i receive

The calling thread cannot access this object because a different thread owns it.

If try to change the RadGridView with native DataGrid and all works correctly. I tried also with Dispatcher.Invoke but this approach not solve my problem.

Thanks in advance for Help.
Nick
Telerik team
 answered on 26 Jun 2014
7 answers
80 views
We have two TreeListViews that we display one above the other (with some other UI bits in the middle).  We desire to have the widths of the columns in these two tree views match.  We do use footers in the columns, and the footer widths would need to be taken into account.  Something like SharedSizeDefinition as used on Grid ColumnDefinition and RowDefinition would be ideal, if possible.  How can we do this, please?


example (not intended to build; cut down from the real application code):

<telerik:RadTreeListView ItemsSource="{Binding Path=MyFirstList}"  >
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding ChildVMs}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
 
    <telerik:RadTreeListView.Columns>
 
        <telerik:GridViewDataColumn Header="Name" UniqueName="Name" IsSortable="True" SortingState="Ascending"
                                IsReadOnly="True"  DataMemberBinding="{Binding Name}" />
 
        <telerik:GridViewDataColumn Header="Value" TextAlignment="Right"
                                DataMemberBinding="{Binding CurrentValue, Mode=TwoWay}" >
            <telerik:GridViewDataColumn.Footer>
                <TextBlock FontSize="12" VerticalAlignment="Top" HorizontalAlignment="Right"
                    Text="{Binding  Path=SomeOtherNumber, Mode=OneWay}" />
            </telerik:GridViewDataColumn.Footer>
        </telerik:GridViewDataColumn>
                     
        <telerik:GridViewDataColumn Header="Timeline" Width="*" IsReadOnly="True"
                            CellTemplateSelector="{StaticResource TimelineTemplateSelector}"
                            CellStyle="{StaticResource TimelineCellStyle}"
                            FooterCellStyle="{StaticResource TimelineFooterStyle}" >
            <telerik:GridViewDataColumn.Footer>
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
 
                    <telerik:RadHorizontalDataAxis  Stroke="DarkRed" Foreground="Gray" ...  />
 
            </telerik:GridViewDataColumn.Footer>
        </telerik:GridViewDataColumn>
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>
 
<!-- some other content -->
 
<telerik:RadTreeListView ItemsSource="{Binding Path=MySecondList}"  >
    <!-- similar to the first list -->
</telerik:RadTreeListView>


David
Top achievements
Rank 1
Iron
Iron
 answered on 26 Jun 2014
4 answers
1.6K+ views
Hello,

I have tried binding a TextBlock in a DataTemplate to a member in the ViewModel to change it's visibility but it is not working.  This is for a custom control that contains a RadCarousel where it's ItemTemplate property is set to a StaticResource in the control, the DataTemplate.

Can someone offer a suggestion for the easiest way to change the visibility of a control in a DataTemplate?

Thanks,
Reid
Reid
Top achievements
Rank 2
 answered on 25 Jun 2014
9 answers
304 views
We are using the RadTreeView extensively in our product and building the nodes through binding (our application follows the MVVM pattern)? I don't know if that last detail matters but when we handed off an alpha release to our QA department, they are reporting that the AutomationId property is blank when using the Microsoft Coded UI Test Builder. Is this something we need code for or is it something the Telerik control should be providing out of the box? 
Claudio
Top achievements
Rank 1
 answered on 25 Jun 2014
4 answers
93 views
Hi,

I have created a database for the RadScheduleView following Telerik
tutorials. I am able to create the database, save appointments with their
categories, time markers etc.

When I load the app, I have few appointments displayed
correctly, I can double click to edit them, I can drag them around, and expand
or shrink them. However there is one problem, if I load the app and the first
thing I do is try to expand or shrink an appointment I get this:

 

System.NullReferenceException was unhandled
  HResult=-2147467261
  Message=Object
reference not set to an instance of an object.
Source=Telerik.Windows.Controls.ScheduleView
  StackTrace:
       at
Telerik.Windows.Controls.ScheduleViewBase.<>c__DisplayClass23.<GetDecorationBlocksForSlot>b__1f(IGroupItemInfo
info)
       at
System.Linq.Enumerable.WhereListIterator`1.MoveNext()
       at
System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
       at
System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
       at
Telerik.Windows.Controls.CollectionExtensions.ForEach[T](IEnumerable`1 source,
Action`1 action)
       at
Telerik.Windows.Controls.HighlightPanel.MeasureOverride(Size availableSize)
       at
System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at
System.Windows.UIElement.Measure(Size availableSize)
       at
System.Windows.ContextLayoutManager.UpdateLayout()
       at
System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at
System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at
System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at
System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at
System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback,Object args, Int32 numArgs)
       at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at
System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at
System.Windows.Threading.Dispatcher.ProcessQueue()
       at
System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at
MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at
MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at
System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at
MS.Win32.UnsafeNativeMethods.DoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
       at
System.Windows.OleServicesContext.OleDoDragDrop(IDataObject dataObject,IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
       at
System.Windows.DragDrop.OleDoDragDrop(DependencyObject dragSource, DataObjectdataObject, DragDropEffects allowedEffects)
       at System.Windows.DragDrop.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects)
       at
Telerik.Windows.DragDrop.DragDropManager.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects, DragDropKeyStates
initialKeyState, Object dragVisual, Point relativeStartPoint, Point dragVisualOffset)
       at
Telerik.Windows.DragDrop.DragInitializer.StartDrag()
       at
Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(UIElement sender)
       at Telerik.Windows.DragDrop.DragInitializer.DragSourceOnMouseMove(Object
sender, MouseEventArgs e)
       at
System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at
System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at
System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs
       at
System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       at
System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at
System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
       at
System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs
args)
       at
System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at
System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at
System.Windows.Input.InputManager.ProcessStagingArea()
       at
System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at
System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at
System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y,
Int32 wheel)
       at
System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at
System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at
MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at
MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at
System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at
System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at
MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at
System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
       at
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at
System.Windows.Threading.Dispatcher.Run()
       at
System.Windows.Application.RunDispatcher(Object ignore)
       at
System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at
System.Windows.Application.Run()
       at
ScheduleViewTest.App.Main() in c:\Apps\TelerikDatabase\TelerikScheduleViewDatabase\ScheduleViewTest\obj\x86\Debug\App.g.cs:line
0
       at System.AppDomain._nExecuteAssembly(RuntimeAssemblyassembly, String[] args)
       at
System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at
System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at
System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback, Object state)
       at
System.Threading.ThreadHelper.ThreadStart()
  InnerException:

This only happens if I try to extend or shrink First, if I drag
and drop and then try to extend or shrink then its working properly, what
settings are need to make it work properly?

Kind Regards

Yana
Telerik team
 answered on 25 Jun 2014
4 answers
371 views
Hi all,

I'm having an issue where I can't get an object to bind to my backstage view. I've used the code from the website to try and implement a recent file list from a class within another project.

A cut-down version of my BackstageViewModel to demonstrate what I'm calling:
public class BackstageViewModel : IViewModel {
 
    public RecentFileList RecentFiles { get; set; } // the property I want to point to
 
    public BackstageViewModel(ApplicationCommandProxy commandProxy, DataHolder data)
    {
        //random setup stuff
    }
 
    //and so on...
}

The RecentFileList class is a class from the WpfApplicationFramework library. You can obtain the library here. In summary, it's a holder class for a ReadOnlyObservableCollection of RecentFile called RecentFiles.

This is the portion of the code where I'm creating my items control in my backstage where ssm points to the project namespace.
<ItemsControl Name="RecentItem" DataContext="{Binding ssm:BackstageViewModel}" ItemsSource="{Binding RecentFiles.RecentFiles}" Focusable="True" DisplayMemberPath="RecentFiles">
         <ItemsControl.Template>
                    <ControlTemplate>
                           <telerik:RadRibbonButton Width="285" Command="{x:Static commands:ApplicationCommands.RecentDocumentCommand}">
                                    <StackPanel Orientation="Horizontal">
                                            <Image Source="Resources/Open_16.png" />
                                            <StackPanel Margin="3 0 0 0" HorizontalAlignment="Left">
                                                   <TextBlock Margin="0 0 0 2" Text="Example Study" />
                                                   <TextBlock Foreground="DimGray" Text="{Binding Path}" />
                                            </StackPanel>
                                     </StackPanel>
                            </telerik:RadRibbonButton>
                    </ControlTemplate>
          </ItemsControl.Template>
</ItemsControl>

All I need to do is have the ItemsControl populate using the ReadOnlyObservableCollection<RecentFile> from within the RecentFileList object. I'm struggling to get it to bind correctly so any help would be greatly appreciated!
Lance | Senior Manager Technical Support
Telerik team
 answered on 25 Jun 2014
2 answers
109 views
Hi,

I am trying to  use the DatePicker control but I've not found a way yet to fix the following problem

1.  I need to show a calendar control that only shows months (this bits easy)
2.  I have a collection of dates.  I wish to highlight the month on the datepicker if that month appears in the collection of dates I have.

So it should be fairly straightforward.  A calendar that only shows months and bound to a list of dates.  If I have 01/01/14 in the list then Jan should be highlighted along with any other months that appear in the list (so maybe Jan, Mar, May would all be highlighted for 2014).

Thanks

Craig
Top achievements
Rank 1
 answered on 24 Jun 2014
7 answers
793 views
Hi,

I am comparing Telerik RadGridView with Standard dataGrid. My requirement is to create grid with custom columns. Columns cellTemplate is a View itself and column sortmemberPath is set to property to display. This property is an object which could be anything (string/int/double/list etc. ) . With DataGrid sort was working but with Telerik RadGridView it's not working (the binding etc. is still the same.). Following is an example of one of the coulmn which is being templated as per the item.

Telerik.Windows.Controls.GridViewDataColumn columnTemplate = new Telerik.Windows.Controls.GridViewDataColumn();
columnTemplate.IsSortable = true;
columnTemplate.IsCustomSortingEnabled = true;
columnTemplate.MinWidth = (item as INode).Builder.Header.Width;

columnTemplate.Header = item;

columnTemplate.Width = (item as INode).Builder.Header.Width + 10;
if (!columnGroup.Equals(string.Empty))
{
columnTemplate.ColumnGroupName = columnGroup;
}

if (item is IntegerPropertyNodeViewModel)
{
var headerName = (item as IntegerPropertyNodeViewModel).PropertyName.Substring((item as IntegerPropertyNodeViewModel).PropertyName.LastIndexOf(' ') + 1);
columnTemplate.Header = headerName;
columnTemplate.UniqueName = headerName;

var text = new FrameworkElementFactory(typeof(IntegerPropertyNodeView));

if (0 != path.Length)
{
System.Windows.Data.Binding bind = new System.Windows.Data.Binding(path);
text.SetBinding(IntegerPropertyNodeView.DataContextProperty, bind);

columnTemplate.SortMemberPath = path + ".Target";
}
SdmGridControlViewColumnGenerator.SetName(columnTemplate, "IntegerProperty");
columnTemplate.CellTemplate = new DataTemplate();
columnTemplate.CellTemplate.VisualTree = text;
columnTemplate.CellTemplate.Seal();
dataGrid.Columns.Add(columnTemplate);
}

Could you please help me in sorting issue with Telerik RadGridView.

Thanks and Regards,
Sonia
Dimitrina
Telerik team
 answered on 24 Jun 2014
4 answers
160 views
Hello,
I want to print/export the contents of a RadGridView. However, I want to retain the cell styles (or at least format it somewhat similar), especially for user-defined columns. For example, the number of decimal digits or the localized enum value should be retained.

When I use the ElementExporting event and check for e.Element == ExportElement.Cell,
the e.Context value points to the Column, not to the concrete cell. Is there any way to get the concrete GridViewCell? Or at least get the bound item?

Alex

 
Dimitrina
Telerik team
 answered on 24 Jun 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
PersistenceFramework
DataPager
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
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
SplashScreen
Rating
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?