Telerik Forums
UI for WPF Forum
0 answers
68 views
Hello !

When i drag RadChart control on the window and then rebuild project and run, window is opening and closing automatically.

can someone help me please ?
D B
Top achievements
Rank 1
 asked on 28 Jul 2010
1 answer
98 views
Hello,
    Do you have a control or sample to bring this effect?


Thanks
Sathish
Miroslav Nedyalkov
Telerik team
 answered on 28 Jul 2010
1 answer
101 views
Hi,

I am going through replacing any RadDatePicker's I have with the RadDateTimePicker and have come across a couple of things.

Can I suggest that when the InputMode is set to DatePicker only, that when a selection is made, the calendar drop down automatically closes. I know this wouldn't work for DataTimePicker mode, but perhaps a property could be exposed to switch it on for DataPicker and TimePickers? I have created an attached property to create the desired behaviour so it's working well for me in that sense.

The other issue I have is when the RadDatePicker has focus by a mouse click. I have noticed that the SelectAll and Select methods have been deprecated, and that the DatePicker automatically selects all when it receives keyboard focus.

This is the desired behaviour I have, however, if the mouse is used to give the control focus, the text is selected briefly but then immediatly is deselected and the cursor is placed at the mouse click.

Normally to overcome this, I would handle the PreviewMouseLeftButtonDown event by checking the RadDateTimePicker.IsKeyboardFocusWithin property. This still works, however it basically stops the Calendar from being opened when the DatePicker does not have focus and the RadButton is clicked.

My question, can the DatePicker SelectAll behaviour be modified so when it is focused via a mouse click, the text stays focused and does not immediatly de-select all?

Thanks,

Adam Marshall
Miroslav Nedyalkov
Telerik team
 answered on 28 Jul 2010
4 answers
192 views
hi,
i have a class that i'm binding to the grid.
this class contain several properties, one of them is value.
property value is of type string.
when all the data in column value is of type int,
sorting it looks something like this:
1
100
150
2
4
...
is there any way that i can numeric string sort it?
1
2
4
100
150
....

thanks!
Rachel
Rachel
Top achievements
Rank 1
 answered on 28 Jul 2010
2 answers
159 views

HI,

I am fairly new to WPF and I am trying to print preview a grid having more than 10 columns . All the columns do not fit on a page for printing. So I would like to continue printing rest of the columns on page 2 . Or if anyother approach , so that the user can see the data for all the columns of the grid.. Here is the sample code. Please let me know.

public static void PrintPreview(Telerik.Windows.Controls.RadGridView grid)
       {
           if (grid != null)
           {
               var dialog = new PrintDialog();
               var capabilities = dialog.PrintQueue.GetPrintCapabilities(dialog.PrintTicket);
               var pageSize = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight);
               var extentSize = new Size(capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight);
               FixedDocument fixedDoc = (PaginateGridInToFixedDocument(ToPrintFriendlyGrid(grid, extentSize), dialog));
               BusinessObjectGridPrintPreviewView previewWindow = new BusinessObjectGridPrintPreviewView();
               previewWindow.RadGridView = grid;
               previewWindow.Document = fixedDoc;
               previewWindow.ShowDialog();
           }
       }
       public static FixedDocument PaginateGridInToFixedDocument(GridViewDataControl element, PrintDialog dialog)
       {
           //var capabilities = dialog.PrintQueue.GetPrintCapabilities(dialog.PrintTicket);
           //var pageSize = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight);
           //var extentSize = new Size(capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight);
           var capabilities = dialog.PrintQueue.GetPrintCapabilities(dialog.PrintTicket);
           Size pageSize = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight);
           Size extentSize = new Size(capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight);
           var fixedDocument = new FixedDocument();
           var totalHeight = 0.0;
           var totalWidth = 0.0;
           element.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
           element.Arrange(new Rect(new Point(0, 0), element.DesiredSize));
           totalHeight = element.DesiredSize.Height;
           //totalWidth = element.DesiredSize.Width;
           List<double> widthBreakList = new List<double>();
           double widthBreakTotal = 0;
           if (element.GroupDescriptors.Count > 0)
           {
               widthBreakTotal = widthBreakTotal + (25 * element.GroupDescriptors.Count);
           }
           double lastBreakLocation = 0;
           widthBreakList.Add(0);
           foreach (Telerik.Windows.Controls.GridViewColumn column in element.Columns)
           {
               if (widthBreakTotal + column.ActualWidth >= (lastBreakLocation + extentSize.Width))
               {
                   widthBreakList.Add(widthBreakTotal);
                   lastBreakLocation = widthBreakTotal;
               }
               else
               {
                   widthBreakTotal += column.ActualWidth;
               }
           }
           totalWidth = widthBreakTotal;
           widthBreakList.Add(totalWidth);
           var yOffset = 0d;
           var xOffset = 0d;
           var xOffsetNext = 0d;
           for (int i = 0; i < (widthBreakList.Count - 1); i++)
           {
               xOffset = widthBreakList[i];
               xOffsetNext = widthBreakList[i + 1];
               yOffset = 0d;
               while (yOffset < totalHeight)
               {
                   var brush = new VisualBrush(element)
                   {
                       Stretch = Stretch.None,
                       AlignmentX = AlignmentX.Left,
                       AlignmentY = AlignmentY.Top,
                       ViewboxUnits = BrushMappingMode.Absolute,
                       TileMode = TileMode.None,
                       Viewbox = new Rect(xOffset, yOffset, xOffsetNext, (extentSize.Height - (extentSize.Height % element.RowHeight)))
                   };
                   var pageContent = new PageContent();
                   var page = new FixedPage();
                   ((IAddChild)pageContent).AddChild(page);
                   fixedDocument.Pages.Add(pageContent);
                   page.Width = pageSize.Width;
                   page.Height = pageSize.Height;
                   var canvas = new Canvas();
                   FixedPage.SetLeft(canvas, capabilities.PageImageableArea.OriginWidth);
                   FixedPage.SetTop(canvas, capabilities.PageImageableArea.OriginHeight);
                   canvas.Width = xOffsetNext - xOffset;
                   canvas.Height = (extentSize.Height - (extentSize.Height % element.RowHeight));
                   canvas.Background = brush;
                   page.Children.Add(canvas);
                   yOffset += extentSize.Height - (extentSize.Height % element.RowHeight);
               }
           }
           return fixedDocument;
       }
       /// <summary>
       /// Convert(Re-create) RadGridView into a print-friendly format
       /// </summary>
       /// <param name="source"></param>
       /// <returns></returns>
       public static GridViewDataControl ToPrintFriendlyGrid(GridViewDataControl source, Size extentSize)
       {
           var grid = new RadGridView()
           {
               ItemsSource = source.ItemsSource,
               RowIndicatorVisibility = Visibility.Collapsed,
               ShowGroupPanel = false,
               CanUserFreezeColumns = false,
               IsFilteringAllowed = false,
               AutoExpandGroups = true,
               AutoGenerateColumns = false,
               ColumnWidth = GridViewLength.SizeToHeader
           };
           grid.ShowColumnFooters = source.ShowColumnFooters;
           grid.ShowGroupFooters = source.ShowGroupFooters;
           grid.ShowColumnHeaders = source.ShowColumnHeaders;
           grid.Width = source.ActualWidth;
           if (source.DataContext is BusinessObjectGridViewModel)
           {
               GridColumnCreator columnCreator = new GridColumnCreator(source.DataContext as BusinessObjectGridViewModel, grid);
               columnCreator.CreateColumns();
               grid.ColumnWidth = GridViewLength.Auto;
               foreach (Telerik.Windows.Controls.GridViewColumn column in grid.Columns)
               {
                   column.Width = GridViewLength.Auto;
                   column.MaxWidth = extentSize.Width;
               }
           }
           else
           {
               foreach (var column in source.Columns.OfType<GridViewDataColumn>())
               {
                   var newColumn = new GridViewDataColumn();
                   newColumn.Header = column.Header;
                   newColumn.DataMemberBinding = new System.Windows.Data.Binding(column.UniqueName);
                   newColumn.Width = column.Width;
                   grid.Columns.Add(newColumn);
               }
               grid.SortDescriptors.AddRange(source.SortDescriptors);
               grid.GroupDescriptors.AddRange(source.GroupDescriptors);
               grid.FilterDescriptors.AddRange(source.FilterDescriptors);
           }
           grid.DataContext = source.DataContext;
           StyleManager.SetTheme(grid, StyleManager.GetTheme(grid));
           return grid;
       }

 

frdotnet
Top achievements
Rank 1
 answered on 28 Jul 2010
2 answers
103 views
Hello,

previously everything worked as expected with RadTabs. Even trying the latest internal builds gave me the same error.
Doing simple things like :

<telerikNavigation:RadTabControl>
            <telerikNavigation:RadTabItem  Padding="4 1" DropDownContent="Slider" IsSelected="True">
                <telerikNavigation:RadTabItem.Header>
                    <Image Source="/Dashboard;component/Resources/test.png" Margin="3" />
                </telerikNavigation:RadTabItem.Header>
                <telerikNavigation:RadTabItem.Content >
   <Image Source="/Dashboard;component/Resources/test.png" Margin="3" />
                </telerikNavigation:RadTabItem.Content>
            </telerikNavigation:RadTabItem>

</telerikNavigation:RadTabControl>

crashes the application. Do you know about this issue or shall I come back with a quick test project to reproduce it?

Thanks,
Emanuel

emi
Top achievements
Rank 1
 answered on 27 Jul 2010
3 answers
155 views
i tried changing the
MainPaletteOrientation="Vertical"

and also
MainPaletteColumnsCount="1"

but it only works when in design mode, not on runtime
Viktor Tsvetkov
Telerik team
 answered on 27 Jul 2010
1 answer
84 views
Hello, I was using the WPF controls, Q1 2010 version in my project and after moving to the new release, I couldn't use several controls, for example NumericElementsPresenter (cannot find a public reference). Can someone tell me how should look the definition and where can I see all the changes made in this new release, what have become obsolete or removed. Thank you i
Rossen Hristov
Telerik team
 answered on 27 Jul 2010
1 answer
89 views
When the DTP is set to not be enabled then the entered values do not show.
The watermark content does, but the entered values do not.

George
Telerik team
 answered on 27 Jul 2010
2 answers
140 views
In a Wpf UserControl , Use a RadDatePicker

As a 
 <telerik:RadDatePicker Name="raddpFrom"  Margin="120,0,186,13"  VerticalAlignment="Bottom" />

After i Show it in a <telerik:RadWindow>

But Not show RadDatePicker other Controlls are Show Correctly

Xaml File

<UserControl x:Class="ZeagReports.Reports.Item.ItemSales"
    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"                   
     Height="110" Width="400" xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
    
        <Grid Height="110" Width="400">
        <Border BorderThickness="3" CornerRadius="10" >
            <Border.BorderBrush>
                <LinearGradientBrush EndPoint=".5,1" StartPoint="0.5,0">
                    <GradientStop Color="#0f7496"  Offset=".1"/>
                    <GradientStop Color="#0f7496" Offset=".5"/>
                    <GradientStop Color="#0f7496"  Offset="1"/>
                </LinearGradientBrush>
            </Border.BorderBrush>            
        </Border>
        <RadioButton HorizontalAlignment="Left" Margin="100,38,0,0" Name="rbtnFixedItem" Width="80" Height="16" VerticalAlignment="Top">Fixed Items</RadioButton>
            <RadioButton HorizontalAlignment="Left" Margin="16,38,0,56" Name="rbtnValidation" Width="80">Validations</RadioButton>

            <Label Height="28" HorizontalAlignment="Left" Margin="12,16,0,0" Name="label1" VerticalAlignment="Top" Width="120">Item Category</Label>
            <Label Height="28" Margin="0,16,116,0" Name="label2" VerticalAlignment="Top" HorizontalAlignment="Right" Width="75">From</Label>
            <Label Height="28" HorizontalAlignment="Right" Margin="0,16,57,0" Name="label3" VerticalAlignment="Top" Width="53">To</Label>
          
            <telerik:RadDatePicker Name="raddpFrom" Height="22" Margin="16,0,0,13" Width="94" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
            <telerik:RadDatePicker Name="raddpTo"  Height="22" Margin="120,0,186,13"  Width="94" VerticalAlignment="Bottom" />
           
            
            
            <telerik:RadButton Margin="0,0,93,12" Name="radBtnPrint" Click="radBtnPrint_Click" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75">Print</telerik:RadButton>
            <telerik:RadButton Margin="0,0,12,12" Name="radBtnReset" HorizontalAlignment="Right" Width="75" Click="radBtnReset_Click" Height="23" VerticalAlignment="Bottom">Reset</telerik:RadButton>
            
            
    </Grid>
   
</UserControl>

George
Telerik team
 answered on 27 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?