Telerik Forums
UI for WPF Forum
3 answers
179 views
Greetings-
I seem to be having a problem with the RadRichTextBox with regard to the MaxWidth and MinWidth properties. We have created a re-usable control callled HTMLEditor.xaml that has the RadRichTextBox contained in a grid. See the code below

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="500" />
        </Grid.ColumnDefinitions>
        <Grid Grid.Row="0" Grid.Column="0" MinWidth="500" HorizontalAlignment="Stretch">
            <telerik:RadRichTextBox LayoutMode="Flow" x:Name="editor" AllowDrop="True" Drop="editor_Drop" ShowComments="False" MinHeight="50" MaxHeight="100" BorderBrush="#FFADADAD"
                                   MinWidth="500" BorderThickness="1" IsSelectionMiniToolBarEnabled="False" IsContextMenuEnabled="True" IsInHeaderFooterEditMode="False">
            </telerik:RadRichTextBox>
        </Grid>
    </Grid>

This control gets re-used in a few instances and has varying MaxWidth and MinWidth properties in 3 different cases. I seem to having a problem with each instance of the RadRichTextBox control...they do not re-size to the resolution.

<GroupBox Margin="5" Padding="5" MinWidth="614" Header="Stem and/or Stimulus" Foreground="#FF000000">
           <common:HtmlEditor Name="htmlStem" GotFocus="htmlEditor_GotFocus" MinHeight="100" Margin="0" Padding="0" />
           </GroupBox>

Can you provide some help with this?
Thanks,
Strasz
Iva Toteva
Telerik team
 answered on 05 Oct 2011
4 answers
188 views
An app I'm working on needs several mutually-exclusive User Controls; each of which has a child RadGridView.   To make the User Control's child controls scroll properly horizontally, I had to wrap all of each User Control's child controls in a ScrollViewer.   (I tried various horizontal scroll settings on each grid itself, but never found one that worked well and also consistently stretched the grid to match the parent UserControl's width dimension).

Before adding the ScrollViewer containers, I had already implemented "Find/FindNext" logic which positioned the resulting row within the appropriate RadGridView's viewport by calculating the desired new top row for the RadGridView, using the Grid's ScrollIntoViewAsync() method to get the right row visible on top, and setting the Grid's CurrentItem and Selecteditem properties to that row item.

But with the enclosing ScrollViewer, the GridView thinks more rows are visible than really are.  So the selected rows remain outside of the ScrollViewer's viewport.

 I realize this is a virtualization issue, but am not sure of the best way to address it.   (The GridView may contain thousands of rows.   I'd rather not have them all load at once as I'd expect if I tried to disable virtualization for the grid as a whole).

Since the ScrollViewer is needed only to accommodate horizontal width, there may be a way to limit the outer ScrollViewer's behavior to the horizontal dimension.

Does anyone have ideas about the best way to address this?
Thanks!
-Bob
BRiddle
Top achievements
Rank 1
 answered on 05 Oct 2011
3 answers
103 views
Hi I am trying to apply custom Bubble Series Style through BubbleSeriesDefinition, using ItemStyle property. However, when I apply default (Blend generated) bubble template, bubble data points are not visible at all. The visual tree contains the series and the Bubble with my custom style however the bubble points are not visible on the chart area. I tried to apply the template declarative (XAML) as well as in code behind - no success.
My team and I are using WPF Telerik Controls Versioin 2011.1.419.35

XAML
<UserControl
   <UserControl.Resources>
     <Style x:Key="CustomBubbleStyle" TargetType="{x:Type telerik:Bubble}">
          <Setter Property="Diameter" Value="80"/>
          <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type telerik:Bubble}">
            <Canvas x:Name="PART_MainContainer" RenderTransformOrigin="{TemplateBinding RelativeCenterPoint}">
                              <Canvas.RenderTransform>
                   <ScaleTransform ScaleY="0" ScaleX="0"/>
                </Canvas.RenderTransform>
                <Path x:Name="PART_BubbleElement" Fill="Green" Data="{TemplateBinding ItemGeometry}" />
                 
                                <Path Data="M108.5,54.25C108.5,84.211448 84.211448,108.5 54.25,108.5 24.288552,108.5 0,84.211448 0,54.25 0,24.288552 24.288552,0 54.25,0 84.211448,0 108.5,24.288552 108.5,54.25z" Height="{TemplateBinding Diameter}" Canvas.Left="{TemplateBinding Left}" Stretch="Fill" SnapsToDevicePixels="True" Stroke="Transparent" StrokeThickness="0" Canvas.Top="{TemplateBinding Top}" Width="{TemplateBinding Diameter}">
                                             <Path.Fill>
                                                   <RadialGradientBrush GradientOrigin="0.5,0.5">
                                                         <GradientStop Color="#66FFFFFF" Offset="0.86"/>
                             <GradientStop Color="Transparent" Offset="0.85"/>
                             <GradientStop Color="#26FFFFFF"/>
                            </RadialGradientBrush>
                                </Path.Fill>
                 </Path>
            </Canvas>
        </ControlTemplate>
    </Setter.Value>
    </Setter>
</Style>
</UserControl.Resources>
 
<telerik:RadChart SnapsToDevicePixels="True" FontSize="9" Height="200" Width="400"
     ItemsSource="{Binding Source={StaticResource SampleDataSource}, Path=Collection}">
<telerik:RadChart.DefaultView>
       <telerik:ChartDefaultView>
           <telerik:ChartDefaultView.ChartArea>
                        <telerik:ChartArea NoDataString="Isufficient Information" Style="{StaticResource ChartAreaStyle}">
                   <telerik:ChartArea.AxisY>
                       <telerik:AxisY TextBlock.Foreground="LightGray"  MinorTickPointMultiplier="5" ExtendDirection="Up" MajorGridLinesVisibility="Visible"
                           MinorTicksVisibility="Hidden" DefaultLabelFormat="0">
                       </telerik:AxisY>
                   </telerik:ChartArea.AxisY>
                       <telerik:ChartArea.AxisX>
                                <telerik:AxisX MinValue="0" TextBlock.Foreground="LightGray" IsZeroBased="True" LayoutMode="Auto" TextBlock.FontSize="5" MajorGridLinesVisibility="Visible"
                           MinorTicksVisibility="Hidden">
                       </telerik:AxisX>
                   </telerik:ChartArea.AxisX>
               </telerik:ChartArea>
           </telerik:ChartDefaultView.ChartArea>
       </telerik:ChartDefaultView>
   </telerik:RadChart.DefaultView>
             <telerik:RadChart.SeriesMappings>
                <telerik:SeriesMapping>
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:BubbleSeriesDefinition BubbleSizeRelative="False" ItemStyle="{StaticResource CustomBubbleStyle}"/>
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:SeriesMapping.ItemMappings>
                        <telerik:ItemMapping DataPointMember="XValue" FieldName="XValue"/>
                        <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue"/>
                        <telerik:ItemMapping DataPointMember="Label" FieldName="ID"/>
                    </telerik:SeriesMapping.ItemMappings>
                </telerik:SeriesMapping>
                 
                <!-- Regression Line -->
                <telerik:SeriesMapping ItemsSource="{Binding Source={StaticResource RegressionLine}, Path=Collection}">
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:LineSeriesDefinition />
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:ItemMapping DataPointMember="XValue" FieldName="Property1"/>
                    <telerik:ItemMapping DataPointMember="YValue" FieldName="Property2"/>
                </telerik:SeriesMapping>
                </telerik:RadChart.SeriesMappings>
                </telerik:RadChart>
 
</UserControl>
Evgenia
Telerik team
 answered on 05 Oct 2011
1 answer
91 views
For some reason I can't seem to get a hierarchical layout using my datatables. My dataset already contains the correct relation between  my two tables. Do you have an example of how to do this. I have tried both the DataLoading method and HierachicalDataTemplate method and neither one seems to work. I can get the RowLoaded event to show the expander because DataRow.GetChildRows returns records.
Thanks,
Rod
Vlad
Telerik team
 answered on 05 Oct 2011
1 answer
172 views
GeographicToLogical gives us value from 0 to 1. I am using this method to project the points using Mercator projection but I want the result in meters. How can we convert the 0-1 value to meters?
Andrey
Telerik team
 answered on 05 Oct 2011
1 answer
128 views
How to calculate area enclosed by MapPolygon?
Andrey
Telerik team
 answered on 05 Oct 2011
0 answers
172 views
Hello,

   I'm using the telerik Radgrid in our project, which is used to display search result of data having more than 20000 rows and the data rebind to the grid every time the user change the search criteria and click on search button.

As the data binded to the grid is too much, I have implemented VirtualQueryableCollectionView, to overcome the performance issues while loading.

Everything works fine, when the grid get loaded for the first time, but after loading if I scroll down to some far point let's say in middle
and never move the scroller again and search again by changing the search criteria (which will return the less no. of rows for eg. 5 or 6)
then in that case the ItemsLoading event of VirtualQueryableCollectionView fires and even the data loads to the grid but the rows are not visible to the user, it seems as if no data has been loaded in the grid.

But actually the data got binded, and if I use my mouse cursor to scroll (though their is no scroll bar) the rows become visible and which seems to be abnormal behavior of the grid.

The similar issue is already posted in the forum, but in that thread their is no response from the Telerik Team for solution. ( Link for Ref. http://www.telerik.com/community/forums/wpf/gridview/radgridview-with-virtualqueryablecollectionview-loaded-via-wcf-problem.aspx )

I have added code snippets for your reference, showing how I am defining the grid and binding it.

Please revert back as soon as possible.

Thanks
Ramnadh
///This is the xaml code for defining the grid columns and style for List View
 
<telerik:RadBusyIndicator DisplayAfter="0"  x:Name="radBusyIndicator" Background="Transparent" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
                    <telerik:RadGridView Name="grid" IsReadOnly="True" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserSortColumns="False" ColumnWidth="*" Height="Auto" Width="Auto" ItemsSource="{Binding}" >
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Name="agentCodeCol"  DataMemberBinding="{Binding AgentCode}" HeaderTextAlignment="Right" TextAlignment="Right" Header="Agent Code" />
                            <telerik:GridViewDataColumn Name="lastNameCol" DataMemberBinding="{Binding LastName}" Header="Last Name" />
                            <telerik:GridViewDataColumn Name="firstNameCol" DataMemberBinding="{Binding FirstName}" Header="First Name" />
                            <telerik:GridViewDataColumn Name="cityCol" DataMemberBinding="{Binding city}" Header="City" />
                            <telerik:GridViewDataColumn Name="stateCol" DataMemberBinding="{Binding StateCode}" Header="State" />
                            <telerik:GridViewDataColumn Name="zipCol" DataMemberBinding="{Binding Zip}" Header="ZIP" TextAlignment="Right" HeaderTextAlignment="Right" />
                            
                            <telerik:GridViewDataColumn Name="editProfileCol" Header="Edit Profile" HeaderTextAlignment="Center" >
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button x:Name="editProfileBtn" Content="Edit"  Click="OnEditProfileBtnClick" Width="70" Height="16" />
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
                            <telerik:GridViewDataColumn Name="swapInCol" Header="Swap In" >
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button Content="Swap In" Style="{StaticResource buttonStyle}" Click="OnSwapInBtnClick" Width="70" Height="16"/>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </telerik:RadBusyIndicator>
 
 
<Style x:Key="lvStyle" TargetType="{x:Type ListView}">
            <Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="True"/>
            <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Recycling"/>
            <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="True"/>
            <Setter Property="ListView.ItemsSource" Value="{Binding}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsLoading}" Value="True">
                    <Setter Property="ListView.Cursor" Value="Wait"/>
                    <Setter Property="ListView.Background" Value="LightGray"/>
                </DataTrigger>
            </Style.Triggers>
 </Style>
 
 
//Code for binding the grid using VirtualQueryableCollectionView
 
DataTable totalRowCountDT = searchResDS.Tables[0];   //Getting the table from Database
                    if (totalRowCountDT != null && totalRowCountDT.Rows.Count > 0 && totalRowCountDT.Rows[0][0] != DBNull.Value) {
                        int numItems = Convert.ToInt32(totalRowCountDT.Rows[0][0]);
                        AgentProvider agentProvider = new AgentProvider(numItems, 0);
                        var view = new VirtualQueryableCollectionView<Agent>() { LoadSize = 500, VirtualItemCount = agentProvider.FetchCount() };
                        view.ItemsLoading += (s, args) => {
                            ShowOrHideProgressBar(true);
                            view.Load(args.StartIndex, agentProvider.FetchRange(args.StartIndex, args.ItemCount));
                            ShowOrHideProgressBar(false);
 
                                                                                
                        };
                        
                        grid.DataContext = view;
 
 
//Method to show and hide the RadBusyIndicator
 public void ShowOrHideProgressBar(bool showOrHide) {
            this.radBusyIndicator.IsBusy = showOrHide;
        }
 
 
//Class to provide data for Grid to while scrolling
   
 public class AgentProvider : IItemsProvider<Agent> {
        private readonly int _count;
        private readonly int _fetchDelay;
 
        /// <summary>
        /// Initializes a new instance of the <see cref="DemoCustomerProvider"/> class.
        /// </summary>
        /// <param name="count">The count.</param>
        /// <param name="fetchDelay">The fetch delay.</param>
        public AgentProvider(int count, int fetchDelay) {
            _count = count;
            _fetchDelay = fetchDelay;
        }
 
        /// <summary>
        /// Fetches the total number of items available.
        /// </summary>
        /// <returns></returns>
        public int FetchCount() {
            Trace.WriteLine("FetchCount");          
            return _count;
        }
 
        /// <summary>
        /// Fetches a range of items.
        /// </summary>
        /// <param name="startIndex">The start index.</param>
        /// <param name="count">The number of items to fetch.</param>
        /// <returns></returns>
        public IList<Agent> FetchRange(int startIndex, int count) {
            Trace.WriteLine("FetchRange: " + startIndex + "," + count);
            AgentEntity agentEntity = new AgentEntity();
            DataSet searchResDS = agentEntity.GetAllAgentDetails(
                                                                        VirtualizationHelper.AgetStruct.LastName
                                                                   ,    VirtualizationHelper.AgetStruct.FirstName
                                                                   ,    VirtualizationHelper.AgetStruct.AgentCode
                                                                   ,    VirtualizationHelper.AgetStruct.Email
                                                                   ,    VirtualizationHelper.AgetStruct.Phone
                                                                   ,    VirtualizationHelper.AgetStruct.Zip
                                                                   ,    VirtualizationHelper.AgetStruct.StateId
                                                                   ,    VirtualizationHelper.AgetStruct.UserId
                                                                   ,    VirtualizationHelper.AgetStruct.IsCurrentUsrHomeOffUsr
                                                                   ,    startIndex
                                                                   ,    startIndex+count
                                                                   , UserInfo.IsCurrentUserLoggedInUser);
            DataTable agenttDT = searchResDS.Tables[1];
            List<Agent> list = new List<Agent>();
            foreach (DataRow row in agenttDT.Rows) {
                Agent agent = new Agent {
                        AgentCode = Convert.ToString(row["AgentCode"])
                    ,   LastName = Convert.ToString(row["LastName"])
                    ,   FirstName = Convert.ToString(row["FirstName"])
                    ,   city = Convert.ToString(row["city"])
                    ,   StateCode = Convert.ToString(row["StateCode"])
                    ,   Zip = Convert.ToString(row["Zip"])
                    ,   GACode = Convert.ToString(row["GACode"])
                    ,   AgentGuid = Convert.ToString(row["AgentGuid"])
                };
                list.Add(agent);
            }
            return list;
        }
    }


 
Ram
Top achievements
Rank 1
 asked on 05 Oct 2011
2 answers
163 views
<telerik:RadWindow x:Class="RadToolBar.View"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="550">
    <Grid>
        <StackPanel>
                <telerik:RadToolBar>
                    <telerik:RadComboBox Name="graphModes" Width="250" Height="22" Margin="3">
                        <ComboBoxItem>One</ComboBoxItem>
                        <ComboBoxItem>Two</ComboBoxItem>
                        <ComboBoxItem>Three</ComboBoxItem>
                     </telerik:RadComboBox>
                </telerik:RadToolBar>
        </StackPanel>
    </Grid>
</telerik:RadWindow>

If using normal Window - all working nice. But i want use RadWindow!
Sergey
Top achievements
Rank 1
 answered on 05 Oct 2011
4 answers
791 views
I have implemented a "Property Editor" style control for our application that utilizes a RadGridView.  By utilizing standard and custom .NET attributes, we allow for custom editing of properties from any user-configurable object within our product.  The user is also able to display properties alphabetically or by category.  I implement editing by creating a custom column type that inherits from GridViewDataColumn and overrides the CreateCellEditElement method.

The RadGridView has really served us nicely in this respect.  Recently, a request was made to support "Password" class properties.  Implementing the editor was trivial using the PasswordBox control.  However, I'm running into issues when trying to mask the password's value when not in edit mode.

Currently, I have defined a style that sets the Foreground font color to "Transparent" if the editor type is "Password":

<Style TargetType="telerik1:GridViewCell"
       x:Key="ValueCellStyle">
    <Style.Triggers>
        <DataTrigger Binding="{Binding Path=Editor}"
                     Value="Password">
            <Setter Property="Foreground"
                    Value="Transparent" />
        </DataTrigger>
    </Style.Triggers>
</Style>

This style is then utilized by the custom column class (inherited from GridViewDataColumn):

<my
:ConfigDataColumn Header="Value"
                      DataMemberBinding="{Binding Value, Mode=TwoWay}"
                      Width="300"
                      IsReadOnly="False"
                      CellStyle="{StaticResource ValueCellStyle}" />

This works well, but it's not was I would like to do.  By setting the foreground font color, it gives the impression to the user that their entry was not accepted by the program.  I would really like to mask the password with a character in the cell similar to what the PasswordBox control does.  When I attempt to set the ContentTemplate with a control (TextBlock or PasswordBox), I loose the ability to edit the cell's contents.  The row will go into edit mode, but the edit control is not displayed even though the CreateCellEditElement method is being executed.

What's the best way to implement such a method of data masking?

...Glenn
Glenn
Top achievements
Rank 2
 answered on 05 Oct 2011
1 answer
90 views
Hello everyone,

There has to be a way to do this.
Problems

1. What I am trying to do it bind a list<Objects> to a series to have multiple series on the chart show. But there will be an unknown amount of Series each time so I can't hard code everything series mapping. Is there a way to have one series mapping definition set and bind a collections of objects to it?

2. After I have the series mapping done I am looking to do some simple filtering through the chart legend. Would there be a way to do this with the none hard-coded series mappings?

Please help

Thank you 
Evgenia
Telerik team
 answered on 05 Oct 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
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
VirtualKeyboard
HighlightTextBlock
Security
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?