Telerik Forums
UI for WPF Forum
1 answer
335 views
How do I add a custom column to my grid that contains a delete button?

I've found only one example of this but it's for the older version of the grid where the new one contains a data template in the grid column and/or a visual tree. I cannot figure out how to add a button into the data template.

grdCol =

new Telerik.Windows.Controls.GridViewColumn() { Name = "grdColDelete" };

 

DataTemplate dt =

new DataTemplate();

 

Button

 

btnDel = new Button(){Content = "Del", Width = 18, Height = 18, CommandParameter = new Binding("ApplicationCommands.Delete")};

 


//How do I get the btn into the data template??????????????????????????????

grdCol.CellTemplate = dt;

Rossen Hristov
Telerik team
 answered on 15 Oct 2009
3 answers
212 views
Hi,

First let me tell you I find the TileView control awesome and I am planning wide use of it for our next iteration. I have a problem though. I need to "inject" UserControls into the Content, SmallContent and LargeContent at runtime because my UserControls are created by Unity (the dependency Injection framework used in PRISM). 

I inject the controls in the contructor of the window and it works but when I show the control the app becomes unresponsive and when I pause in the debigger this is where it stops:

Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadFluidContentControl.MeasureOverride(System.Windows.Size availableSize = {System.Windows.Size}) Line 345 + 0x19 bytes.

I tried doing it all in code:

var viewItem = new RadTileViewItem(); 
var content = new RadFluidContentControl(); 
content.SmallToNormalThreshold = new Size(235, 35); 
content.NormalToSmallThreshold = new Size(305, 149); 
content.NormalToLargeThreshold = new Size(315, 155); 
content.LargeToNormalThreshold = new Size(725, 345); 
content.SmallContent = new TextBlock {Text = "Original Data"}; 
content.Content = ResolveControl<OriginalData, UDataTable>(); 
 
viewItem.Content = content; 
projectData.Items.Add(viewItem); 


And the xaml is:

<telerikNavigation:RadTileView x:Name="projectData" Margin="3"></telerikNavigation:RadTileView>

I also tried a combination of xaml and code using the xaml from your demo app:

The code was something like:

var s = (((projectData.Items[0] as ContentControl).Content) as RadFluidContentControl); 
s.Content = _unityContainer.Resolve&lt;MyUserControl&gt;(); 
I am using the exact xaml from your demo except for the contents which are replaced by this since then cannot be empty:

<telerikNavigation:RadFluidContentControl.Content>
         <Data:OriginalData></Data:OriginalData>
</telerikNavigation:RadFluidContentControl.Content>

Finally I tried using a Panel inside the contents and added my usecontrol to the panel but the results were the same.

I must be missing something critical and any help is appreciated,
Jose

Tihomir Petkov
Telerik team
 answered on 14 Oct 2009
4 answers
491 views
I have an bar chart with a series of bar columns and under each bar column on the x-axis is a label. The label text has been rotated 90 degrees counter-clockwise (appears to be default). I want the label text to be rotated 45 degress clockwise, so it will read better. how can I do that?
Giuseppe
Telerik team
 answered on 14 Oct 2009
3 answers
49 views
Hi,

May I know are we going to get PageNavigation for WPF?

Please advice.
Valentin.Stoychev
Telerik team
 answered on 14 Oct 2009
1 answer
122 views
I'm try to use IsGreaterThanOrEqualTo and and IsLessThanOrEqualTo filter but i have error using int value???
I have found nothing about this filter usage.
Please, tell me what data type are usable with.
Stefan Dobrev
Telerik team
 answered on 14 Oct 2009
1 answer
132 views
 <Style x:Key="RadTabControlStyle">
             
                <Setter Property="telerikNavigation:RadTabControl.ItemContainerStyle">
                    <Setter.Value>
                        <Style TargetType="telerikNavigation:RadTabItem">
                            
                            <Setter Property="FontFamily" Value="Tahoma"/>
                            <Setter Property="Foreground" Value="White"/>
                         
                            <!--Setting the template for the headers.-->
                            <Setter Property="HeaderTemplate">
                                <Setter.Value>
                                    <DataTemplate>
                                        <WrapPanel Margin="3">
                                            <Image Source="{Binding}" Height="25" />
                                            <TextBlock Text="{Binding}" FontSize="15" TextAlignment="Center"   VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="110" >
                                            </TextBlock>
                                        </WrapPanel>
                                
                                    
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="False">
                                 
                                    <Setter Property="BorderThickness" Value="0.5" />
                                    <Setter Property="BorderBrush" Value="LightGray" />
                                </Trigger>
                                                          
                            
                            </Style.Triggers>
                        </Style>
                    </Setter.Value>
                </Setter>
                
            </Style>


This is the style I am applying to radTabcontrol and Binding tabItem in xaml
<telerikNavigation:RadTabItem x:Name="tbAddress" Header="Address" Foreground="Black" TabIndex="2"   HorizontalAlignment="Left">
                                <ctrl:AddressControl x:Name="ctrlAddress"  ></ctrl:AddressControl>
                            </telerikNavigation:RadTabItem>

I am not assigning any ItemSource to tabControl,It works great it show header text with centerd align.
But problem is that I want to bind different image with this header text in tabHeader and I have mentined Image sOurce={Binding} so that I can provide image at run time

DataTemplate template = tbIdentification.HeaderTemplate as DataTemplate;
            if (template == null) return;
            WrapPanel pnl = template.LoadContent() as WrapPanel;
Image ImgButton = pnl.Children[0] as Image;
           ImgButton.BeginInit();
ImgButton.Source = (ImageSource)new ImageSourceConverter().ConvertFrom(new Uri("pack://application:,,,/SafetyAuditUserControl;component/Images/truck.png",UriKind.RelativeOrAbsolute ));
            ImgButton.EndInit();


It not showing Image.Please help me out for this ASAP.
Miroslav
Telerik team
 answered on 13 Oct 2009
2 answers
116 views
I have to place two GridViews
in the same place
one is visible and the other id hidden
I can change the visibilty of each one
but only one can be visible

I tried to use DockPanel
but they are placed one beside the other
and not one "over" the other

this is my code
<DockPanel> 
                    <StackPanel DockPanel.Dock="Top" Background="CornflowerBlue" Orientation="Horizontal">  
                        <Button Margin="2,1,2,1">הפק דוח</Button> 
                        <Button Name="btnCancelSystemTables" Margin="2,1,2,1" Click="btnCancelSystemTables_Click">בטל</Button> 
                        <Button Name="btnNewSystemTables" Margin="2,1,2,1" Click="btnNewSystemTables_Click">חדש</Button> 
                        <Button Name="btnDeleteSystemTables" Margin="2,1,2,1" Click="btnDeleteSystemTables_Click">מחק</Button> 
                        <Button Name="btnSaveSystemTables" Margin="2,1,2,1" Click="btnSaveSystemTables_Click">שמור</Button> 
                    </StackPanel> 
                    <StackPanel DockPanel.Dock="Top" Margin="10,10,10,10" Orientation="Horizontal">  
                        <TextBlock Margin="5,5,5,5">שם טבלה</TextBlock> 
                        <ComboBox Name="cmbTableName" DisplayMemberPath="Name" Margin="5,5,5,5" Width="120" SelectionChanged="cmbTableName_SelectionChanged"></ComboBox> 
                        <Button Name="btnMoveUp" Click="btnMoveUp_Click">+</Button> 
                        <Button Name="btnMoveDown" Click="btnMoveDown_Click">-</Button> 
                    </StackPanel> 
                    <telerik:RadGridView DockPanel.Dock="Left" Visibility="Hidden"  Name="gvSystemTables" Margin="5,5,5,5" Height="520" Width="350" AutoGenerateColumns="False" 
                                 IsFilteringAllowed="False" FlowDirection="RightToLeft" ShowGroupPanel="False" CellEditEnded="gvSystemTables_CellEditEnded">  
                           <telerik:RadGridView.Columns> 
                                <telerik:GridViewDataColumn IsReadOnly="True" UniqueName="ID" Header="קוד" Width="50"/>  
                                <telerik:GridViewDataColumn IsReadOnly="False" UniqueName="Name" Header="ערך" Width="250"/>                                 
                            </telerik:RadGridView.Columns> 
                        </telerik:RadGridView> 
                    <telerik:RadGridView DockPanel.Dock="Left" Visibility="Hidden"  Name="gvLoadingUnitFrame" Margin="5,5,5,5" Height="520" Width="350" AutoGenerateColumns="False" 
                                 IsFilteringAllowed="False" FlowDirection="RightToLeft" ShowGroupPanel="False" CellEditEnded="gvLoadingUnitFrame_CellEditEnded">  
                       <telerik:RadGridView.Columns> 
                            <telerik:GridViewComboBoxColumn UniqueName="LoadingUnit" DataMemberBinding="{Binding LoadingUnit}" DisplayMemberPath="Name" SelectedValueMemberPath="Id" Header="לקוח להעמסה" Width="110"  /> 
                            <telerik:GridViewDataColumn IsReadOnly="False" UniqueName="LoadingFrame" Header="מסגרת" Width="110"/>  
                           <telerik:GridViewComboBoxColumn UniqueName="OBSID" DataMemberBinding="{Binding OBSID}" DisplayMemberPath="Name" SelectedValueMemberPath="Id" Header="ענף" Width="110"  /> 
                       </telerik:RadGridView.Columns> 
                    </telerik:RadGridView> 
                    <TreeView DockPanel.Dock="Left" Visibility="Hidden" Margin="10,10,0,13" Name="tvOBS" HorizontalAlignment="Left" VerticalAlignment="Top" Width="350" Height="520" KeyDown="tvOBS_KeyDown"></TreeView> 
                    <StackPanel DockPanel.Dock="Top">  
                        <Popup x:Name="PopupEditTv" AllowsTransparency="True" Width="250" Height="150">  
                            <Border Background="White" BorderBrush="Gray" BorderThickness="2">  
                                <StackPanel Margin="10,10,10,10">  
                                    <TextBlock Margin="5,5,5,5">הכנס שם יחידה</TextBlock> 
                                    <TextBox DockPanel.Dock="Top" Name="txtbEditTv" Width="80" Height="20"></TextBox> 
                                    <StackPanel Orientation="Horizontal">  
                                        <Button Margin="5,5,5,5" Name="btnSaveTvText" Width="auto" Click="btnSaveTvText_Click">שמור</Button> 
                                        <Button Margin="5,5,5,5" Name="btnCancelTvText" Width="auto" Click="btnCancelTvText_Click">בטל</Button> 
                                    </StackPanel> 
                                </StackPanel> 
                            </Border> 
                        </Popup> 
                    </StackPanel> 
                    <StackPanel DockPanel.Dock="Top">  
                        <Popup x:Name="PopupTest" AllowsTransparency="True" Width="250" Height="150">  
                            <Border Background="White" BorderBrush="Gray" BorderThickness="2">  
                            <StackPanel Margin="10,10,10,10">  
                                <TextBlock Margin="5,5,5,5">בחר סוג פעילות להוספה</TextBlock> 
                                <RadioButton Margin="5,5,5,5" Name="rbInv" IsChecked="True" GroupName="rbActType">השקעות</RadioButton> 
                                <RadioButton Margin="5,5,5,5" Name="rbCon" GroupName="rbActType">שוטף</RadioButton> 
                                <StackPanel Orientation="Horizontal">  
                                    <Button Margin="5,5,5,5" Name="btnAddActType" Click="btnAddActType_Click" Width="auto">בחר</Button> 
                                    <Button Margin="5,5,5,5" Name="btnCancelActType" Width="auto" Click="btnCancelActType_Click">בטל</Button> 
                                </StackPanel>                                          
                            </StackPanel> 
                            </Border> 
                        </Popup> 
                    </StackPanel> 
                </DockPanel> 

Thanks!!
Orit
Top achievements
Rank 1
 answered on 13 Oct 2009
3 answers
240 views
  • WPF version Q2 Service Pack 1 Nightly Build on 8/13/2009
  • OS - Windows 7 64-bit and Windows Vista 64-bit
  • exact version of the Telerik product - 2009.2.911.35
  • preferred programming language C#

1. I have several different styles of grids. I have a Heirarchical Grid and the arrow down selection it works only if you collapse the parent and then click somewhere near the + expander column with out expanding it. You can witness this wierd behavior on the First Look Sample.

2. Take a look at the Template and Unbound Sample. If you scroll to the bottom using the arrow keys and navigate 1 past the last row you can no longer move back up. This is a problem in several of the samples.

3. I have a grid with custom columns using Templated Columns and I cannot scroll through these at all with the arrow keys.

<telerik:RadGridView ColumnsWidthMode="Fill" AutoGenerateColumns="False" ItemsSource="{Binding Birth.MedicalInstrumentList_}" Height="200" HorizontalAlignment="Left" Margin="-492,0,0,-305" VerticalAlignment="Bottom" Width="465.117">  
                                    <telerik:RadGridView.Columns> 
                                        <telerik:GridViewColumn Width="25">  
                                            <telerik:GridViewColumn.CellTemplate> 
                                                <DataTemplate> 
                                                    <CheckBox Style="{StaticResource DeleteCheckBoxStyle}" HorizontalAlignment="Center" IsChecked="{Binding IsSelected, Mode=TwoWay}" /> 
                                                </DataTemplate> 
                                            </telerik:GridViewColumn.CellTemplate> 
                                        </telerik:GridViewColumn> 
                                        <telerik:GridViewDataColumn Header="Name" Width="2*" DataMemberBinding="{Binding Path=Equipment.Name}" /> 
                                        <telerik:GridViewDataColumn Header="Description" Width="3*" DataMemberBinding="{Binding Path=Equipment.Description}" /> 
                                        <telerik:GridViewColumn Width="175" Header="Comments">  
                                            <telerik:GridViewColumn.CellTemplate> 
                                                <DataTemplate> 
                                                    <usercontrol:TextExpander ExpanderText="{Binding Comment, Mode=TwoWay}" /> 
                                                </DataTemplate> 
                                            </telerik:GridViewColumn.CellTemplate> 
                                        </telerik:GridViewColumn> 
                                    </telerik:RadGridView.Columns> 
                                </telerik:RadGridView> 

Thanks,

Billy Jacobs

Milan
Telerik team
 answered on 12 Oct 2009
1 answer
100 views
I try to run my project with a telerik control and i get the following error:

could not load file or assembly 'Telerik.Windows.Controls,' or one of it dependencies.
The module was expected to contain an assembly manifest. Error at object system.windows.controls.canvas.

Thanks.
Vlad
Telerik team
 answered on 12 Oct 2009
3 answers
197 views
Hello,

I've searched the forum but without success! Apparently, I am the only one trying to bind a GridViewComboBoxColumn to a class (instead of simple a int or a string).

All the binding is working fine, the ComboBox is filled in correctly, changing and saving data is working but the GridView doesn't display the value on start (strangely, it is displaying correctly after I choose a value in the ComboBox...)!

I guess there is something missing to make the match between the original value and the values in the ComboBox... but what?

Here is a sample of my faulty code:

The main class of the GridView (note that here we have a Currency class and not a CurrencyID)
public class Fund  
{  
   public virtual string Name { getset; }  
   public virtual Currency Currency { getset; }  

The Currency class
public class Currency : AbstractLinkedClass  
{          
   public virtual string IsoCode { getset; }  

The grid's XAML code
<telerik:RadGridView Grid.Row="3" Margin="0,5,0,5" Name="rgvFund" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" AutoGenerateColumns="False" RowEditEnded="rgvFund_RowEditEnded" ValidationMode="Row">  
    <telerik:RadGridView.Columns> 
        <telerik:GridViewDataColumn Header="Name" DataMemberPath="Name" /> 
        <telerik:GridViewComboBoxColumn Header="Currency" ItemsSource="{Binding}" UniqueName="Currency.IsoCode" DataMemberBinding="{Binding Currency}" DisplayMemberPath="IsoCode" SelectedValueMemberPath="." /> 
    </telerik:RadGridView.Columns> 
</telerik:RadGridView> 

The .cs code behind where currencies are taken from the DB.
rgvFund.Columns[1].DataContext = currencies; 

Any idea why with this code, the Currency column appears empty on load (while Fund.Currency is correctly filled in on start)?

Thank you,

Daniel
Pavel Pavlov
Telerik team
 answered on 12 Oct 2009
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
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?