Telerik Forums
UI for WPF Forum
3 answers
138 views

Hello,

I'd like to restrict the size of my POI'S Datatemplate to be only shown in an explicit area so it won't get any bigger than this area.
Maybe a LocationRect would be given and my DataTemplate automatically expands and fills this Rect.

Can you tell me if there is a way to achieve anything similar to my requirements?

 See a simplified version of my DataTemplate below:

<DataTemplate x:Key="ResizableTemplate">
    <Grid x:Name="ParentRoot"
               Background="Transparent"
               telerik:MapLayer.Location="{Binding Path=Location}">
        <StackPanel Orientation="Vertical" >
              <TextBlock Text="{Binding Path=Title}" />
              <TextBlock Text="{Binding Path=Description}" />
        </StackPanel>
    </Grid>
</DataTemplate>

 VisualizationLayer:

<telerik:VisualizationLayer x:Name="POILayer" ItemsSource="{Binding POICollection}" ItemTemplate="{StaticResource ResizableTemplate}" />

Pavel R. Pavlov
Telerik team
 answered on 29 Apr 2015
2 answers
666 views

Is there a way to print the file from the code behind, but specify the printer to use? I know there is a default printer, but that doesn't work for me. I am using it to print labels. The label printer is rarely the default printer on client machines.

 

Thanks

Randy

TheGramix
Top achievements
Rank 2
 answered on 29 Apr 2015
2 answers
162 views

Okay, I am pulling my hair out and would like some help with this code.  I took some code from this site to do cell validation.  I don't have the current spreadsheet control  and work will not pay for an upgrade, so I am trying to make due.  Here is the code that does the validation I got to work (from another post):

 

 

private void ValidateCellValue(ICellValue cellValue)
       {
           bool isValid = false;
 
           string stringValue = cellValue.GetResultValueAsString(CellValueFormat.GeneralFormat);
 
           int intValue;
           if (int.TryParse(stringValue, out intValue))
           {
               if (intValue >= MinIntValue && intValue <= MaxIntValue)
               {
                   isValid = true;
               }
                                             
           }
 
           if (!isValid)
           {
               MessageBox.Show("Not valid!");
               Workbook workbook = new Workbook();
                
               CellIndex activeCellIndex = this.worksheetEditor.Selection.ActiveCellIndex;
                
               // Be carefull: SetValue() raises the CellPropertyChanged event.
               this.worksheetEditor.Worksheet.Cells[activeCellIndex].SetValue(stringValue);
               this.worksheetEditor.Worksheet.Cells[activeCellIndex].SetIsBold(true);
               GradientFill greenGradientFill = new GradientFill(GradientType.FromCenter, Color.FromRgb(255, 255, 255), Color.FromRgb(252, 231, 0));
               this.worksheetEditor.Worksheet.Cells[activeCellIndex].SetFill(greenGradientFill);
               this.worksheetEditor.Focus();
           }
       }

As you can see, I can put a gradient fill behind the cell if the value is invalid.  However, when I showed this to the users, they indicated it was to distracting and they just want the outline of the cell to be colored.  So I found this code on the this site and have been trying to implement it:

 

private void InitializeRectangle(Rectangle rectangle, CellLayoutBox cellBox)
       {
           //rectangle.Fill = new SolidColorBrush(Colors.Red);
           rectangle.Stroke = new SolidColorBrush(Colors.Red);
           rectangle.StrokeThickness = 1;
           rectangle.Width = cellBox.Width;
           rectangle.Height = cellBox.Height;
           Canvas.SetLeft(rectangle, cellBox.Left);
           Canvas.SetRight(rectangle, cellBox.Top);
 
            
       }

I have tried to pull this code in and replace the current gradient fill but keep running into problems.  I would prefer to pass the cell to the InitializeRectangle method and have it paint the border red.  Right now the method takes in a rectangle which isn't a problem, it is passing in the cellBox, how do I get the cell box in the validation method when the value is not valid?

 

Any help at all on this would be much appreciated.

John
Top achievements
Rank 1
 answered on 28 Apr 2015
6 answers
296 views

Hi,

 I'm using the lastest version of Telerik and I also use the Office2013 theme. Actually, I create a custom UserControl which contain a RadScheduleView and I have some properties for different purpose. With the Office2013 theme, the highlighted items are not clearly visible on a laptop that's why I would like to know if it's possible to have a border of different color?!? At the same time, I would like to offer a property like "BorderSelectionColor".

 I would like to cover the following situation:

     - During a drag and drop operation, I would like to highligh + change the border color of the targeted appointments or slots cover by the source appointments

     - I actually implemented a keyboard navigation pattern, the user can use the arrow keys to navigate through the slots or the appointements so I would like to highlight + change the border color of the slot or the appoinment where I am. The navigation mechanisim was already implemented but the highlight mechanisim not.

 

Thank's

Alain

Masha
Telerik team
 answered on 28 Apr 2015
6 answers
291 views

I downloaded wpf example for RadCartesian from telerik.com site and since we are already using no xaml version of dlls, I need help generating Styles for this example, I want something to start with so that I can see the chart, right now I can see anything:

 

<local:ChannelsControlBase.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Segoe UI" />
        </Style>
        <SolidColorBrush x:Key="AccentBrush" Color="#FF8EC441" />
    </local:ChannelsControlBase.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="3*" />
            <RowDefinition Height="2*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid Grid.ColumnSpan="2" Margin="0,0,0,15">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBlock Text="Messages Sent / Received" FontSize="16" Margin="5,0,0,0" />
            <!--<telerik:RadButton Content="hello" Width="100" Height="100" Background="Black" BorderBrush="Red" Visibility="Visible"></telerik:RadButton>-->
            <telerik:RadCartesianChart Grid.Row="1" >
                <telerik:LineSeries CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding Data}"  />
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeContinuousAxis MajorStepUnit="Second"
                                                LabelInterval="5"
                                                LabelFormat="HH:mm:ss.f" FontFamily="Segoe UI"
                                                PlotMode="OnTicks" />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis Minimum="500" 
                                    MajorStep="500"
                                    Maximum="2000" FontFamily="Segoe UI" />
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid MajorLinesVisibility="Y" MajorYLineDashArray="3,4" />
                </telerik:RadCartesianChart.Grid>
            </telerik:RadCartesianChart>
        </Grid>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBlock Text="Site Activity by Time of Day" FontSize="16" Margin="5,0,0,0" />
            <telerik:RadCartesianChart Grid.Row="1" Palette="Windows8" Margin="0,0,40,0">
                <telerik:RadCartesianChart.Behaviors>
                    <telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" />
                </telerik:RadCartesianChart.Behaviors>
                <telerik:AreaSeries CategoryBinding="Category" Fill="#7F8EC441" Stroke="#FF8EC441" StrokeThickness="2" ValueBinding="Value" ItemsSource="{Binding Data2}">
                    <telerik:AreaSeries.TrackBallInfoTemplate>
                        <DataTemplate>
                            <StackPanel Margin="3" Orientation="Horizontal">
                                <TextBlock Text="{Binding DataPoint.Category, StringFormat='Online users at {0:HH}h:'}" Margin="0,0,3,0" />
                                <TextBlock Text="{Binding DataPoint.Value}" FontWeight="Bold" />
                            </StackPanel>
                        </DataTemplate>
                    </telerik:AreaSeries.TrackBallInfoTemplate>
                </telerik:AreaSeries>
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeContinuousAxis MajorStepUnit="Hour"
                                                LabelFormat="H\h" 
                                                LabelInterval="2" FontFamily="Segoe UI"
                                                PlotMode="OnTicks" />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis Minimum="3000" 
                                    MajorStep="200"
                                    Maximum="4200" FontFamily="Segoe UI">
                    </telerik:LinearAxis>
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid MajorLinesVisibility="Y" MajorYLineDashArray="3,4" />
                </telerik:RadCartesianChart.Grid>
            </telerik:RadCartesianChart>
        </Grid>
        <Grid Grid.Row="1" Grid.Column="1" Width="300">
            <Grid Margin="0,28,0,25" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="100" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Path Stretch="Fill" Data="M608.5,187 L351.5,187 L331.5,238 L608.49994,238 z" Fill="{StaticResource AccentBrush}" Grid.ColumnSpan="2" Margin="40,3,-6,3" />
                <TextBlock FontSize="36" Margin="0,0,6,0" Foreground="White" FontFamily="Segoe UI" Text="{Binding MessagesPerSecond}" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <TextBlock Grid.Column="1" Margin="0,2,6,0" FontSize="12" FontFamily="Segoe UI" Text="AVG Messages per second" TextWrapping="Wrap" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <Path Grid.Row="1" Stretch="Fill" Data="M608.5,187 L337.55035,187 L317.55035,238 L608.49994,238 z" Fill="{StaticResource AccentBrush}" Grid.ColumnSpan="2" Margin="25,3,-6,3"/>
                <TextBlock Grid.Row="1" Margin="0,0,6,0" FontSize="36" FontFamily="Segoe UI" Foreground="White" Text="{Binding MessagesPerMinute}" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <TextBlock Grid.Row="1" Margin="0,2,6,0" Grid.Column="1" FontSize="12"  FontFamily="Segoe UI" Text="AVG Messages per minute" TextWrapping="Wrap" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <Path Grid.Row="2" Stretch="Fill" Data="M608.5,187 L323.60071,187 L303.60071,238 L608.49994,238 z" Fill="{StaticResource AccentBrush}" Grid.ColumnSpan="2" Margin="10,3,-6,3"/>
                <TextBlock Grid.Row="2" Margin="0,0,6,0" FontSize="36" FontFamily="Segoe UI" Foreground="White" Text="3,729,600" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <TextBlock Grid.Row="2" Margin="0,2,6,0" Grid.Column="1" FontSize="12" FontFamily="Segoe UI" Text="AVG Messages per hour" TextWrapping="Wrap" HorizontalAlignment="Right" VerticalAlignment="Center" />
            </Grid>
        </Grid>
    </Grid>

Pavel R. Pavlov
Telerik team
 answered on 28 Apr 2015
6 answers
1.7K+ views
Hello,
I'm looking for radGridView code for "specific column" Single or Multiple grid row selection;  Looking for similar functionality in radGriedView.
-------------------------------------------------------------------------------
GridViewRow row = GridView1.SelectedItem;
textboxCount.Text = row.Cells[2].Text + ".";
-----------------------------------------------------------------------------------

Thanks,
Raj

 

Dimitrina
Telerik team
 answered on 28 Apr 2015
1 answer
223 views

I have NewRowposition at the top which is working fine.

 My Issue is when I click on that the Row ID# always shows '0'. I want it to show the next available ID on the Grid. How Can I do this ?

Dimitrina
Telerik team
 answered on 28 Apr 2015
2 answers
320 views

Hi,

I am using RadPivotGrid with my dyynamic selection of data and each time i get the datatable, i add appropriate values in LocalDataSourceProvider.RowGroupDescriptions, LocalDataSourceProvider.ColumnGroupDescriptions, LocalDataSourceProvider.AggregateDescriptions. I am using the following sample code to add values in these collection as example

var property = new PropertyGroupDescription();
property.PropertyName = item.DisplayName;
property.CustomName = item.DisplayName;
LocalDataSourceProvider.RowGroupDescriptions.Add(property);

All works fine. But in case of "RowGroupDescriptions", i want to display header values to let user know what they are. I have attached an image to describe the requirement.

here you can see that i have added "ID", "Status" and "TrackingNumber" in  RowGroupDescriptions. "Priority" in ColumnGroupDescriptions and "Value" in ColumnGroupDescriptions. All looks good but i am unable to get header values for RowGroupDescriptions fields as mentioned in screenshot.

Please note that these fields are dynamic that is they can be changed according to the selection.

Any kind of help or suggestion is really appreciated.

Thanks

Waqas Habib

 

 

Polya
Telerik team
 answered on 28 Apr 2015
3 answers
222 views
How can I inspect the SQL query that is generated by a Telerik RadAutoCompleteBox using the visual studio debugger?
Vladi
Telerik team
 answered on 28 Apr 2015
1 answer
105 views

In the implicit styles inside Office2013 theme you will notice that the Padding is not used correctly in the control template and is completely ignored (see PART_DateTimeInput).

 Can you fix this guys, or is this by design, and there is a workaround to set the padding of the control?

Masha
Telerik team
 answered on 28 Apr 2015
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?