Telerik Forums
UI for WPF Forum
1 answer
130 views
I have a simple gridview as follows:

<telerikgridview:RadGridView ScrollViewer.HorizontalScrollBarVisibility="Disabled" x:Name="ActivitiesGrid" IsReadOnly="True" AutoGenerateColumns="False" SelectionMode="Extended" ItemsSource="{Binding SelectedPatient.Activities}" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" ShowColumnHeaders="False" SelectionChanged="ActivitiesGrid_SelectionChanged">
  <telerikgridview:RadGridView.Columns>
      <telerikgridview:GridViewDataColumn DataMemberBinding="{Binding ActivityDate}" Header="{lex:LocText S3.ParametersUE.PatientManagement:UIStrings:PatientDetailsView_GridActivityHeaderDate}" DataFormatString="{}{0:dd/MM/yyyy}" MinWidth="100"/>
      <telerikgridview:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="{lex:LocText S3.ParametersUE.PatientManagement:UIStrings:PatientDetailsView_GridActivityHeaderDescription}" />                                                
  </telerikgridview:RadGridView.Columns> </telerikgridview:RadGridView>

If the text of Description is long, a horizontal scrollbar appears. How can I make sure that no horizontal scrollbar appears, but that the text is wrapped so that it is full visible in the column?
Ludwig
Top achievements
Rank 1
 answered on 12 May 2011
1 answer
390 views
Hi! I am testind yours RadTreeView Control and i have a big problem. I want to use TriState tree and i have my global checkbox style.
Global style for checkbox is:
<RadialGradientBrush x:Key="HoverBrush">
       <RadialGradientBrush.RelativeTransform>
           <TransformGroup>
               <ScaleTransform CenterX="0.5"
                       CenterY="0.3"
                       ScaleX="1.804"
                       ScaleY="0.743" />
               <SkewTransform CenterX="0.5"
                      CenterY="0.5" />
               <RotateTransform CenterX="0.5"
                        CenterY="0.5" />
               <TranslateTransform Y="0.47999998927116394" />
           </TransformGroup>
       </RadialGradientBrush.RelativeTransform>
       <GradientStop Color="#FFFCE312"
                 Offset="0.209" />
       <GradientStop Color="#00FFFF00"
                 Offset="1" />
       <GradientStop Color="#FFFFFFFF"
                 Offset="0" />
   </RadialGradientBrush>
   <LinearGradientBrush x:Key="CheckIconBrush"
                      EndPoint="0.5,1"
                      StartPoint="0.5,0">
       <GradientStop Color="White" />
       <GradientStop Color="White"
                 Offset="1" />
   </LinearGradientBrush>
   <Style TargetType="{x:Type CheckBox}">
       <Setter Property="SnapsToDevicePixels" Value="true"/>
       <Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}"/>
       <Setter Property="Background" Value="{DynamicResource ElementBackground}"/>
       <Setter Property="BorderBrush" Value="{DynamicResource ElementBorder}"/>
       <Setter Property="Template" Value="{DynamicResource CheckBoxTemplate}" />
       <Setter Property="Foreground" Value="{DynamicResource TextBrush}"/>
       <Style.Triggers>
           <Trigger Property="IsEnabled" Value="False">
               <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
           </Trigger>
       </Style.Triggers>
   </Style>
   <ControlTemplate x:Key="CheckBoxTemplate" TargetType="{x:Type CheckBox}">
       <ControlTemplate.Resources>
           <Storyboard x:Key="CheckedFalse">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="CheckedTrue">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="ThreeStateOn">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="IndeterminateIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="ThreeStateOff">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="IndeterminateIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="HoverOn">
               <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="HoverOff">
               <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="PressedOn">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0.6"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
           <Storyboard x:Key="PressedOff">
               <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
                   <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
               </DoubleAnimationUsingKeyFrames>
           </Storyboard>
       </ControlTemplate.Resources>
       <BulletDecorator Background="Transparent">
           <BulletDecorator.Bullet>
               <Grid Width="16" Height="16">
                   <Rectangle Height="14" Margin="0" x:Name="Background" Width="14" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="2" RadiusX="1" RadiusY="1"/>
                   <Rectangle Height="12" x:Name="BackgroundOverlay" Width="12" Opacity="0" Fill="{DynamicResource ElementBackgroundWhenMouseOver}" Stroke="{x:Null}" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
                   <Path x:Name="CheckIcon" Opacity="0" Stretch="Fill" Data="M102.03442,598.79645 L105.22962,597.78918 L106.95686,599.19977 C106.95686,599.19977 113.77958,590.53656 113.77958,590.53656 C113.77958,590.53656 107.40649,603.79431 107.40649,603.79431 z" Fill="#FF000000"
                   Height="10"
                   Width="10"
                   Stroke="{StaticResource CheckIconBrush}"
                   StrokeThickness="0"/>
                   <Rectangle Margin="0,0,0,0" Height="4" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="IndeterminateIcon" Width="8" Opacity="0" Fill="{DynamicResource ElementBorder}"  RadiusX="1" RadiusY="1"/>
                   <Rectangle Height="14" x:Name="DisabledVisualElement" Width="14" Opacity="0" Fill="{StaticResource DisabledBackgroundBrush}" RadiusX="1" RadiusY="1"/>
                   <Rectangle Height="16" x:Name="ContentFocusVisualElement" Width="16" IsHitTestVisible="false" Opacity="0" Stroke="{StaticResource HoverBrush}" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
               </Grid>
           </BulletDecorator.Bullet>
           <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
       </BulletDecorator>
       <ControlTemplate.Triggers>
           <MultiTrigger>
               <MultiTrigger.Conditions>
                   <Condition Property="IsChecked" Value="True" />
                   <Condition Property="IsThreeState" Value="True" />
               </MultiTrigger.Conditions>
               <MultiTrigger.EnterActions>
                   <BeginStoryboard x:Name="ThreeStateOn_BeginStoryboard" Storyboard="{StaticResource CheckedFalse}" />
               </MultiTrigger.EnterActions>
               <MultiTrigger.ExitActions>
                   <BeginStoryboard x:Name="ThreeStateOff_BeginStoryboard" Storyboard="{StaticResource CheckedTrue}" />
               </MultiTrigger.ExitActions>
           </MultiTrigger>
           <MultiTrigger>
               <MultiTrigger.Conditions>
                   <Condition Property="IsChecked" Value="{x:Null}" />
                   <Condition Property="IsThreeState" Value="True" />
               </MultiTrigger.Conditions>
               <MultiTrigger.EnterActions>
                   <BeginStoryboard x:Name="ThreeStateOn1_BeginStoryboard" Storyboard="{StaticResource ThreeStateOn}" />
               </MultiTrigger.EnterActions>
               <MultiTrigger.ExitActions>
                   <BeginStoryboard x:Name="ThreeStateOff1_BeginStoryboard" Storyboard="{StaticResource ThreeStateOff}" />
               </MultiTrigger.ExitActions>
                
               <Setter Property="Visibility" TargetName="CheckIcon" Value="Hidden"/>
           </MultiTrigger>
           <Trigger Property="IsChecked" Value="True">
               <Trigger.ExitActions>
                   <BeginStoryboard Storyboard="{StaticResource CheckedFalse}" x:Name="CheckedTrue_BeginStoryboard"/>
               </Trigger.ExitActions>
               <Trigger.EnterActions>
                   <BeginStoryboard x:Name="CheckedTrue_BeginStoryboard1" Storyboard="{StaticResource CheckedTrue}"/>
               </Trigger.EnterActions>
           </Trigger>
           <Trigger Property="IsMouseOver" Value="true">
               <Trigger.EnterActions>
                   <BeginStoryboard Storyboard="{StaticResource HoverOn}"/>
               </Trigger.EnterActions>
               <Trigger.ExitActions>
                   <BeginStoryboard Storyboard="{StaticResource HoverOff}"/>
               </Trigger.ExitActions>
           </Trigger>
           <Trigger Property="IsPressed" Value="true">
               <Trigger.EnterActions>
                   <BeginStoryboard Storyboard="{StaticResource PressedOn}"/>
               </Trigger.EnterActions>
               <Trigger.ExitActions>
                   <BeginStoryboard Storyboard="{StaticResource PressedOff}"/>
               </Trigger.ExitActions>
           </Trigger>
           <Trigger Property="IsEnabled" Value="false">
               <Setter Property="Fill" TargetName="Background" Value="{DynamicResource DisabledBackgroundBrush}"/>
               <Setter Property="Stroke" TargetName="Background" Value="{DynamicResource DisabledBorderBrush}"/>
           </Trigger>
       </ControlTemplate.Triggers>
   </ControlTemplate>

The problem is that on default my checkboxes dont have IsThreeState property set to true. When i add simple RadTreeView i can see my style in checkboxes BUT indetermine state doesnt work. I can see onl;y checked or unchecked checkboxes If i hardcode property
<Setter Property="IsThreeState" Value="True">
All works fine but in this case i have problem with RadGridView because in filter i have tri state checkboxes.
Sample Rad tree:
<telerik:RadTreeView Grid.Row="1" SelectionMode="Single" IsLineEnabled="True"
                IsEditable="True" IsDragDropEnabled="True"
                ItemsOptionListType="CheckList" IsOptionElementsEnabled="True"
                IsRootLinesEnabled="True"  VerticalAlignment="Top" Margin="10" 
                x:Name="TicketClassRadTreeView" IsTriStateMode="True" ContextMenu="{StaticResource ContextMenuTicketClass}"
                             >
            <telerik:RadTreeViewItem DropPosition="Inside" Header="Root" >
                <telerik:RadTreeViewItem DropPosition="Inside" Header="Oprogramowanie" >
                    <telerik:RadTreeViewItem DropPosition="Inside" Header="Obszar funkcjonalny"/>
                    <telerik:RadTreeViewItem DropPosition="Inside" Header="Obszar funkcjonalny1">
                        <telerik:RadTreeViewItem DropPosition="Inside" Header="Abc"/>
                    </telerik:RadTreeViewItem>
                </telerik:RadTreeViewItem>
                <telerik:RadTreeViewItem DropPosition="Inside" Header="SprzÄ™t" >
                </telerik:RadTreeViewItem>
            </telerik:RadTreeViewItem>
        </telerik:RadTreeView>

Thanks for help
Petar Mladenov
Telerik team
 answered on 12 May 2011
2 answers
82 views
I just downloaded the latest production version and upgraded my project and have run into manu issues within 2 min of running my application. On the tabcontrol, the selected item is behaving differently.  If you run your databinding example for the tab control and use the "x" to close the tabs you'll notice there is no selected item afterwards.  If you run the 2010 demo it works fine.  I am using Prism and MVVM and have a solution that works with the 2010 Q3 release but now does not work now that I have upraded (similar to how I explained it worked in your demo).
Vladislav
Telerik team
 answered on 12 May 2011
1 answer
149 views
Hi,

I am using GridViewBoundColumnBase.GetValueForItem() to get the content of the cell in my RadGridView.
When I create the columns like the following:
new GridViewDataColumn()
{
        DataMemberBinding = new Binding("xy")
        {
                Converter = new XYConverter()
        }
}

everything works fine.

When I omit  the "xy" in new Binding("xy") to bind to the DataItem itself, GetValueForItem(..) returns the bound dataitem instead of the result of the used converter.

This behavior is quite unexpected. When I don't omit the "xy" I get the result of the converter as expected.

Is this a bug or am I doing something wrong?

Best Regards,
 Matthias
Vlad
Telerik team
 answered on 12 May 2011
2 answers
530 views
Hi there,

I'm busy evaluating the RadRichTextBox for our purposes and I've noticed that the InsertTable() method does not exist in the WPF version of the RadRichTextBox (vs SilverLight, which has the only documentation for this control).

I also noticed, regardless of it's existence in the API, that there is no way to specify a position for the table, regardless of where you might want to actually insert it in the document.

Could you please explain how, for example, I might programmatically insert a table into a RadDocument at a position which is in the middle of a paragraph?

The functionality I'm after is similar to how you would in a FlowDocument call InsertParagraphBreak() on a TextPointer and then insert the table in the Blocks section after the now preceeding Paragraph object.
Paul
Top achievements
Rank 1
 answered on 12 May 2011
4 answers
147 views
Hello,

I'm using RadGridView with ComboBoxColumns and RowDetailsTemplate like this :
<telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn></telerik:GridViewToggleRowDetailsColumn>
                <telerik:GridViewComboBoxColumn Name="PositionCombo" Header="Position"         
                    DataMemberBinding="{Binding Path=PositionID , Mode=TwoWay}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" />
                <telerik:GridViewComboBoxColumn Name="StatesCombo" Header="State"  
                    DataMemberBinding="{Binding Path=StateID , Mode=TwoWay}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>
                </DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>

Everything works great including editing rows with ComboBoxColumns, but there is a little problem - after I expand specific row, I'm not able to edit that row with ComboBoxColumn anymore (even If I've collapsed it) - there's a red rectangle around - seems like a validation that stops me.

I'm using 2010 Q2 SP2 and LINQ datasources as listed below:

DataClassesDataContext db = new DataClassesDataContext();
this.CandidatesGrid.ItemsSource = new QueryableCollectionView(db.Candidates);
((GridViewComboBoxColumn)this.CandidatesGrid.Columns[1]).ItemsSource = db.Positions;
((GridViewComboBoxColumn)this.CandidatesGrid.Columns[2]).ItemsSource = db.States;

Thanks for any help
Martin
Top achievements
Rank 1
 answered on 12 May 2011
2 answers
113 views
I want to show data from a RadGridView to a TextBlock. I wrote C# and XAML code fine but i can`t understand why it dos`t show any data
Here is Code:
C# Code :

   private void button1_Click(object sender, RoutedEventArgs e)
        {
            DataTable myDataTable = new DataTable();
            DataColumn myDataColumn = new DataColumn();
            myDataColumn.ColumnName = "Name";
            myDataTable.Columns.Add(myDataColumn);
            myDataTable.Rows.Add("1");
            myDataTable.Rows.Add("2");
            myDataTable.Rows.Add("3");
            radGridView1.ItemsSource = myDataTable;
          
        }

And XMAL CODE:

        <telerik:RadGridView HorizontalAlignment="Left" Margin="38,12,0,0" Name="radGridView1" VerticalAlignment="Top" AutoGenerateColumns="False" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="394,12,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
        <TextBlock Text="{Binding SelectedItem.Name, ElementName=radGridView1}" Margin="12,239,233,8" />


Here i was wrong. Please Help Me. 
Md.Hasanuzzaman
Top achievements
Rank 1
 answered on 12 May 2011
3 answers
166 views
Today I stumbled on a strange behavior using the the telerik GridView. While editing  some cells of a column using the keyboard, suddenly the current cell ignores keyboard input. The effect is repeatable. Always after editing 5-10 celles using every time the same keyboard sequence, the cell ignores normal keyboard input. Only command keys like Del, Backspace or  Home are working. This behavior applies for all cells in the grid. Other input fields are working normally. After closing and re-opening the input window, it starts from scratch until the next occurence of the effect.

A short look with Spy++ shows that the WM_CHAR message will not be sent to the control while the effect occurs. WM_KEYDOWN and WM_KEYUP are sent normally.all the time.

The grid column is defined as:
    <telerik:GridViewDataColumn Header="Translation" DataMemberBinding="{Binding Path=OriginalTranslation}" Width="150*" MinWidth="100" TextWrapping="Wrap" Background="#1EFFFFFF" ShowDistinctFilters="False">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Translation}" TextWrapping="Wrap" Background="#1EFFFFFF" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Path=Translation}" TextWrapping="Wrap" BorderThickness="0" GotFocus="TextBox_GotFocus" Background="#1EFFFFFF" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>


Any idea what ist going wrong?

Regards Reimund
Yordanka
Telerik team
 answered on 12 May 2011
1 answer
113 views
When I use SelectionMode="Extended" and select rows (it doesn't seem to matter whether selecting a range or one at a time via Ctrl+click) and then copy/paste, the last row is always omitted.  Has anyone else had this issue, and has anyone come up with a solution?  Thanks!
Yordanka
Telerik team
 answered on 12 May 2011
5 answers
130 views
Hi
I need to place next radtabmenu partially on top of the previous one
May I ask what needs to be done to achieve this effect? thanks

 <telerik:RadTabItem Padding="4 3" x:Name="test" HeaderTemplate="{DynamicResource radTabItemTemplate}" Height="70" />

    <DataTemplate x:Key="radTabItemTemplate">
        <Grid>
            <Image Grid.Column="0" Source="pack://application:,,,/Images;component/images/greenarrow.gif"/>   
            <TextBlock Text="Security" Width="60" VerticalAlignment="Center" />
        </Grid>
    </DataTemplate>

thanks
george
Top achievements
Rank 1
 answered on 12 May 2011
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
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?