Telerik Forums
UI for WPF Forum
1 answer
1.2K+ views

I have a tab control with two tab items in it.It works perfectly in normal style .But when i applied some styles in XAML the tabs are not swtiching and i couldn't select an tab item too why its so?? Below is the style which i applied to tabcontrol

 

<Style TargetType="{x:Type telerik:RadTabItem}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:RadTabItem}">
                <Grid>
                    <Border Name="Border" Margin="0,0,2,0" Background="#828282" BorderBrush="#828282" BorderThickness="1"  >
                        <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center"
                            HorizontalAlignment="Center" ContentSource="Header"  RecognizesAccessKey="True"/>
                    </Border>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsSelected" Value="True">
                        <Setter Property="Panel.ZIndex" Value="100" />
                        <Setter TargetName="Border" Property="Background" Value="#CDCDCD" />
                        <Setter TargetName="Border" Property="BorderBrush" Value="#CDCDCD" />
                        <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

and here is the tabcontrol code

 

<Grid>
    <telerik:RadTabControl Margin="36,10,64,37">
        <telerik:RadTabItem x:Name="RadTabItem" Header="RadTab 1" Height="23" Width="59">
            <Grid Background="Transparent">
                <Label>RadTabItem1</Label>
            </Grid>
        </telerik:RadTabItem>
        <telerik:RadTabItem x:Name="RadTabItem2" Header="RadTab 2" Height="23" Width="59">
            <Grid Background="Transparent">
                <Label>RadTabItem2</Label>
            </Grid>
        </telerik:RadTabItem>
    </telerik:RadTabControl>
</Grid>

What am i doing wrongly ???
Martin
Telerik team
 answered on 22 Apr 2016
2 answers
98 views

Hello,

I'm facing a strange behaviour. PdfViewer prints nothing. Prints only when page is selected as 1 in Print Dialog, if i try the same thing with selecting page 2 (or giving a range) it does nothing. I am binding DocumentSource of pdfviewer to a property  on my viewmodel which returns PdfDocumentSource. Pdf is rendered normally.

01.public Telerik.Windows.Documents.Fixed.PdfDocumentSource PdfReport
02.{
03.    get
04.    {
05.        Telerik.Windows.Documents.Fixed.PdfDocumentSource docSource;
06.        var array = Reporting.Pdf.PdfReportHelper.GetReport(); //Dynamically creates the pdf
07.        var output = new MemoryStream(array);
08.        docSource = new Telerik.Windows.Documents.Fixed.PdfDocumentSource(output);
09.        docSource.Loaded += (sender, args) => { if (output != null) output.Dispose();};
10.        return docSource;
11.    }
12.}

There is a similar thread like this about winforms wihch suggests to set ReadingMode to 0. I found a reading mode property in formatProviderSettings class but it didn't do the trick. Am i doing something wrong?

Boby
Telerik team
 answered on 22 Apr 2016
2 answers
642 views
Hi,

Is there a way to remove/restrict the default selection (first row) of the RadGridview?

Note:After pressing the row, it should display as selected.

Thanks,
Gord
Top achievements
Rank 1
 answered on 21 Apr 2016
4 answers
586 views

Hello,

I have a RadGridView with child RadGridView . Both grids have a GridViewColumn whose visibility I would like to bind to a Property in my Model. This is working for the parent grid, but the child grid isn't in the right DataContext to access the property in my model.

The tables, stripped down for brevity:

 <telerik:RadGridView  AutoGenerateColumns="False" ItemsSource="{Binding ProductTypes.View}">
                        <telerik:RadGridView.ChildTableDefinitions>
                            <telerik:GridViewTableDefinition>
                                <telerik:GridViewTableDefinition.Relation>
                                    <telerik:PropertyRelation ParentPropertyName="kcc_IncentiveProductTypeChildren" />
                                </telerik:GridViewTableDefinition.Relation>
                            </telerik:GridViewTableDefinition>
                        </telerik:RadGridView.ChildTableDefinitions>

                        <telerik:RadGridView.Columns>
                           
                            <telerik:GridViewColumn  IsVisible="{Binding DataContext.CanView, ElementName=LayoutRoot}" >
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button Content="Delete"/>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewColumn>
                        </telerik:RadGridView.Columns>
                        <telerik:RadGridView.HierarchyChildTemplate>
                            <DataTemplate>
                                <telerik:RadGridView  ItemsSource="{Binding kcc_IncentiveProductTypeChildren}" AutoGenerateColumns="False"  >
                                  
                                    <telerik:RadGridView.Columns>
                                       
                                        <telerik:GridViewColumn  IsVisible="{Binding DataContext.CanView, ElementName=LayoutRoot}" >
                                            <telerik:GridViewColumn.CellTemplate>
                                                <DataTemplate>
                                                    <Button Content="Delete"/>
                                                </DataTemplate>
                                            </telerik:GridViewColumn.CellTemplate>
                                        </telerik:GridViewColumn>

                                    </telerik:RadGridView.Columns>
                                </telerik:RadGridView>
                            </DataTemplate>
                        </telerik:RadGridView.HierarchyChildTemplate>
                    </telerik:RadGridView>

 

I need a way to bind to the IsVisible property of the GridViewColumn in the child Grid.

I considered applying a style from my static resources to the GridViewColumn to set the IsVisible property, but GridViewColumn does not have a Style property! I am not sure, but I don't think the other styles (header/footer/cell) will work on this property of the GridViewColumn.

        <Style TargetType="telerik:GridViewColumn" x:Key="ViewPermissionColumn">
            <Setter Property="IsVisible"  Value="{Binding DataContext.CanView, ElementName=LayoutRoot}" />
        </Style>

 

As a last option, I assume I'll need to handle an event on the main grid in order to set this value manually in the code behind. What event would I need?

 

 

 

 

 

jen
Top achievements
Rank 1
 answered on 21 Apr 2016
0 answers
99 views

My use case requires programmatically detecting when a NumericUpDown control is currently being edited, so that we can disallow the user from clicking a button before they've committed their value.

Currently I'm using the Got/LostKeyboardFocus events as well as the setter of the value that the NUD is bound to, but there are many cases in which this approach is insufficient. Ideally, the NUD would have a property I could bind to that would indicate when the NUD is being edited but I haven't found any such thing.

Thanks in advance!

Jules
Top achievements
Rank 1
 asked on 21 Apr 2016
1 answer
102 views

Hello,

 

I'm having a bit of trouble connecting my mobile device to TestStudio for testing via USB.  I can get the machine to read that the device is connected but I'm afraid I'm not able to find the port number of the device hooked up via USB.  I'm stuck at this point, I've tried every port number  that I could possibly think of... perhaps I'm looking in the wrong place for a port number reference.  Any help would be appreciated. 

 

(Device is a Samsung mobile phone)

Nikolay Petrov
Telerik team
 answered on 21 Apr 2016
6 answers
822 views

Hello,

I have a RadComboBox that uses an ItemTemplate to style the content within the dropdown.  The ComboBox binds to a "lookup" object that has "Id", "Value", "FG" and "BG" properties.  "FG" is the foreground color (string) and "BG" is the background color (string).  Value is the display text, and Id is the underlying ID value of the object from the database.

I have the combobox bound to the actual Lookup object, rather than to a primitive, the ItemsSource is bound to another object which is a list of Lookup objects, and I have an item template:

<DataTemplate x:Key="lookupColor">
    <Label x:Name="lbl"
           Background="{Binding BG}"
           Content="{Binding Value}"
           Foreground="{Binding FG}"
           Margin="0">
    </Label>
</DataTemplate>

This works great for a standard combobox.  The background is filled in and text color is set properly in both the dropdown, and the items list.  But when I try to make the combobox editable, so the user can type the text to quickly select an item, the result shows the <bound class name string> in the textbox for the selected item, instead of the content value binding.  I even tried setting the "DisplayMemberPath" to "Value", but still nothing. 

I extracted the ComboBox template through expression blend, but there doesn't appear to be any binding on the textbox to control the content, leaving me to think the text is controlled by code.

Any ideas on this?

Gord
Top achievements
Rank 1
 answered on 21 Apr 2016
11 answers
209 views
Can this be done? 

See example in this thread:
http://www.telerik.com/community/forums/wpf/docking/savelayout-when-ishidden-is-binding.aspx

Using the example 317519_Docking-DataContext-SL-2.zip (though converted to WPF), I find IsHidden does not get restored from LoadLayout.  If I remove the binding it works fine.  But I need the binding.

Any ideas?
Kalin
Telerik team
 answered on 21 Apr 2016
4 answers
133 views
Hello, 
How can I set foreground property for cells of GridViewHyperlinkColumn in xaml ?
Thank you in advance,
Maya
Maya
Top achievements
Rank 1
 answered on 21 Apr 2016
1 answer
140 views

In my application , i use ShapeStyleSelector  to show diference  style,  the styles is differentiated by  the binding object's property,  the property may change in  app run time, so i need to change the node style dynamic.   at present,   when  user change the property,  i remove the node and add one with another style, This is not a good solution

Is any resolution to resole the problem ?

Petar Mladenov
Telerik team
 answered on 21 Apr 2016
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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?