Telerik Forums
UI for WPF Forum
0 answers
157 views
Hi,

I have a gridview in my View which displays the vertical scrollbar when required. But the grid is not scrolling on Up/Down arrow button click of the scrollbar niether when i click on the grid and scroll using mouse wheel. I have used a custom control in my gridview column's cell template.Hers is my code in XAML

<framework:RTPOGridView x:Name="NotesGrid" MinWidth="600" HorizontalAlignment="Stretch"  ItemsSource="{Binding Notes}" AutoGenerateColumns="False" Height="350"
                                                AlternateRowBackground="#E2F0FA"
                                  RowDetailsVisibilityMode="Visible" RowHeight="0" CanUserFreezeColumns="False" BorderThickness="0"
                                               RowIndicatorVisibility="Collapsed" ShowColumnHeaders="False"
                                    ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                            <framework:RTPOGridView.Columns>
                                <telerik:GridViewDataColumn Width="*">
                                    <telerik:GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <framework:DashboardNotesGridRow  Note="{Binding Note}" RectangleBackground="{Binding RectangleColor}"
                                                                     NoteType="{Binding RectangleContent}" LoginUser="{Binding Name}" NoteDateTime="{Binding NoteDateTime, StringFormat='MM/dd/yyyy hh:mm'}"
                                                                     />
                                        </DataTemplate>
                                    </telerik:GridViewColumn.CellTemplate>
                                </telerik:GridViewDataColumn>
                            </framework:RTPOGridView.Columns>
                        </framework:RTPOGridView>

 Please help.
Shehnaz
Top achievements
Rank 1
 asked on 16 Nov 2012
9 answers
238 views
In multiple projects, I've had RadPanes set to only be shown when a button is clicks and they show as floating RadPanes. So in my XAML, I have their IsHidden property set to True so that they aren't shown until a button is clicked. The problem tough is that during the form load, you can see a "flash" of the RadPane(s) closing themselves. It's only on screen for maybe 1 second but it's annoying especially when there are multiple RadPanes. How can I prevent this?

For example code, simple put the code below in a RadDocking container and watch your application close in the middle of the screen during startup. You'll see the RadPane closing.

<telerik:RadSplitContainer InitialPosition="FloatingDockable"                                 
        telerik:RadDocking.FloatingLocation="450, 250"
        telerik:RadDocking.FloatingSize="300, 220" x:Name="uxWindowRadSplitContainer" >
    <telerik:RadPaneGroup>
        <telerik:RadPane Header="Test" CanDockInDocumentHost="False" IsHidden="True" x:Name="uxToolWindowRadPane">
            <TextBlock Text="Hi" />
        </telerik:RadPane>
    </telerik:RadPaneGroup>
</telerik:RadSplitContainer>
Boyan
Telerik team
 answered on 16 Nov 2012
3 answers
365 views
Hello,

My development team is currently evaluating the trial version of the RichTextBox to find out whether or not it will meet our current application requirements, one of which is pasting images.  Our users often take screenshots using an application called SnagIt and they need to be able to paste those screenshots into the editor.  

We are encountering some issues when pasting PNG images, but the behavior varies depending on the source of the image.  If we use Microsoft's Snipping Tool to take the screenshot, it pastes into the editor successfully.  However, if we use SnagIt, or even open an image in Microsoft Paint and then try to copy and paste it, the cursor in the textbox moves as if an image was pasted, but no image is displayed.  The area where the image should be is a white box.

We have done no customization of the RichTextBox or anything.  All I did was simply drag the control from the Visual Studio Toolbox onto the WPF canvas.

I have not seen any other posts where anyone has encountered this same issue.  I'm hoping someone has perhaps noticed this same issue before, or to bring it to the attention of the developers as a potential bug that needs to be fixed.  I've attached an image showing how the editor looks exhibiting successful pasting behavior and the unsuccessful behavior.

Thanks,

Frank
Robert
Top achievements
Rank 1
 answered on 16 Nov 2012
1 answer
138 views
Hi,

I upgraded my controls to WPF Q3 2012 (2012.3.1017.40) from 2012.1.215.40.
HtmlFormatProvider.Export is not working properly with TableCell with colspan. It was working before by not showing a width attribute in the style tag. Now it shows a width attribute, ignores manually set width and uses the width of smallest regular column.

I have tried traversing the RadDocument and setting the width manually to 530 px, it was ignored. I have also tried setting width on all table cells with colspan tag to null, it was ignored as well. 176.67px is the exact size of 1 column for me after document margins etc. Its a 4 column layout.

Below is an example of the first row in table. Previous Export is what it looked like. New Export is what it does now.

Previous Export (No Width tag in td with colspan tag)
<tr>
    <td style="border-left: 0px none #000000; border-top: 0px none #000000; border-right: 0px none #000000;
        border-bottom: 0px none #000000; padding: 5px 0px 5px 0px; vertical-align: top;"
        align="left" valign="top" colspan="3">
        Column 1-3
    </td>
    <td style="border-left: 0px none #000000; border-top: 0px none #000000; border-right: 0px none #000000;
        border-bottom: 0px none #000000; padding: 5px 0px 5px 0px; width: 176.666666666667px; vertical-align: top;"
        align="left" valign="top">
        Column 4
    </td>
</tr>

New Export (width tag in td with colspan)
<tr>
    <td style="border-left: 0px none #000000; border-top: 0px none #000000; border-right: 0px none #000000;
        border-bottom: 0px none #000000; padding: 5px 0px 5px 0px; width: 176.666666666667px;
        vertical-align: top;" align="left" valign="top" colspan="3">
        Column 1-3
    </td>
    <td style="border-left: 0px none #000000; border-top: 0px none #000000; border-right: 0px none #000000;
        border-bottom: 0px none #000000; padding: 5px 0px 5px 0px; width: 245px; vertical-align: top;"
        align="left" valign="top">
         Column 4
    </td>
</tr>

Any help is appreciated. Thanks.

Also noticed that new html export is very bulky with lots of additional styles and span tags on line breaks etc. It doesn't create any issues though.

Thanks,
Erol
Mihail
Telerik team
 answered on 16 Nov 2012
1 answer
98 views
hi,

when loading the RadScheduleView, the message "Please select a  view definition" shows up in the background until the first view is loaded. (it lasts about 1sec).

I would like to remove it entirely or at least translate it if possible. How could I achieve this with minimum effort (i.e.: is there a way to do this without having to replace the whole xaml for the control ?)

thanks,
Yana
Telerik team
 answered on 16 Nov 2012
1 answer
151 views
Hello,

i have a Gridview 

<telerik:RadGridView x:Name="MyGridView" Grid.Column="2" MinWidth="300" DockPanel.Dock="Right" HorizontalAlignment="Stretch" ItemsSource="{Binding Path=CurrentItems}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" IsReadOnly="True" AutoGenerateColumns="True" RowDetailsVisibilityMode="VisibleWhenSelected" teleriklocal:GridViewHeaderMenu.IsEnabled="True" RowIndicatorVisibility="Collapsed" AutoGeneratingColumn="MyGridView_AutoGeneratingColumn" EnableColumnVirtualization="True" EnableRowVirtualization="True" DistinctValuesLoading="MyGridView_DistinctValuesLoading">
    <telerik:RadGridView.RowStyle>
        <Style TargetType="telerik:GridViewRow">
            <Style.Triggers>        
                <DataTrigger Binding="{Binding Path=error,Converter={StaticResource ErrorConverter}}" Value="True">
                    <Setter Property="Foreground" Value="Red"></Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>                       
    </telerik:RadGridView.RowStyle>
</telerik:RadGridView>

ist fine, but my "error" alternative rows are not red, 
Now i added

<telerik:RadGridView.AlternativeRowStyle>
    <Style TargetType="telerik:GridViewRow">
        <Style.Triggers>       
            <DataTrigger Binding="{Binding Path=error,Converter={StaticResource ErrorConverter}}" Value="True">
                <Setter Property="Foreground" Value="Red"></Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>                      
</telerik:RadGridView.AlternativeRowStyle>

The rows are red, but now they have the same Background color as main rows. How can i set via trigger on alternativerowstyle ?


Ivan Ivanov
Telerik team
 answered on 16 Nov 2012
1 answer
120 views
I'm working on a view that is supposed to display a pie chart. The series ItemsSource is a RadObservableCollection<DataPoint> on our ViewModel. We always include the same four data points in this collection -- cash, check, credit, money order -- in a specified order, even if the values are zero. This collection is reconstructed every time our view is navigated to and the changes are always reflected on the pie.

In addition, we want each tender to have a specific color and a white stroke, so we have defined a style like so:

<telerik:PieSeries.SliceStyles>
    <Style TargetType="{x:Type Path}">
        <Setter Property="Fill" Value="{StaticResource BrushSecondaryGreen}" />
        <Setter Property="Stroke" Value="{StaticResource BrushInversePrimaryWhite}" />
        <Setter Property="StrokeThickness" Value="1" />
        <Setter Property="Visibility" Value="{Binding DepositSummary.Cash, Converter={StaticResource VisibleIfGreaterThanZero}}" />
    </Style>
    <Style TargetType="{x:Type Path}">
        <Setter Property="Fill" Value="{StaticResource BrushSecondaryOrange}" />
        <Setter Property="Stroke" Value="{StaticResource BrushInversePrimaryWhite}" />
        <Setter Property="StrokeThickness" Value="1" />
        <Setter Property="Visibility" Value="{Binding DepositSummary.Check, Converter={StaticResource VisibleIfGreaterThanZero}}" />
    </Style>
    <Style TargetType="{x:Type Path}">
        <Setter Property="Fill" Value="{StaticResource BrushSecondaryViolet}" />
        <Setter Property="Stroke" Value="{StaticResource BrushInversePrimaryWhite}" />
        <Setter Property="StrokeThickness" Value="1" />
        <Setter Property="Visibility" Value="{Binding DepositSummary.Credit, Converter={StaticResource VisibleIfGreaterThanZero}}" />
    </Style>
    <Style TargetType="{x:Type Path}">
        <Setter Property="Fill" Value="{StaticResource BrushSecondaryYellow}" />
        <Setter Property="Stroke" Value="{StaticResource BrushInversePrimaryWhite}" />
        <Setter Property="StrokeThickness" Value="1" />
        <Setter Property="Visibility" Value="{Binding DepositSummary.MoneyOrder, Converter={StaticResource VisibleIfGreaterThanZero}}" />
    </Style>
</telerik:PieSeries.SliceStyles>

The visibility is specified here so we don't see an extra white line sticking out from the center of the pie chart when one of the data points is zero. It worked great in testing -- hard-coding one of the slice styles to be collapsed when the corresponding data was zero got rid of the white line. However, it is not working with these converters. The converter only seems to fire the first time we visit our view, so all of the pie slices remain visible during later visits.

(See attached visual.)

We have also tried implementing this with DataTriggers instead of converters and did not have any luck.

At this point, I can only ask if you guys are aware of any issues with the way I have implemented this. Why might the converters used in the style only work once? I do nullify the collection (and DepositSummary object used for visibility) and rebuild it every time our view is navigated to, and those do have a property change notification. We are using Prism/MEF.

Thanks.
Petar Marchev
Telerik team
 answered on 16 Nov 2012
5 answers
242 views
Hi,

Is it possible to merge documents and add a custom header / footer programmatically or via a template?

Ideally, I would like to create a header and footer template using the RadRichTextBox UI.

My application merges several documents together, where I would like to be able to apply a common header and footer style/design to them programmatically using a template that was previously designed. ** I'm only interested in the header and footer.

I know how to merge documents together, I would just like to know how I can design a Header & Footer document template and apply that design/template programmatically to the other merged documents.

Any examples that you have would be very welcome.

Thank you very much for your time,

Rob
Robert
Top achievements
Rank 1
 answered on 15 Nov 2012
0 answers
136 views
<Window x:Class="AggregateFunctions.MainWindow"
         WindowState="Maximized"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadGridView HorizontalAlignment="Stretch" Margin="5" Name="radGridView1" VerticalAlignment="Stretch" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"
                             AutoGenerateColumns="True" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserSelect="False" GridLinesVisibility="Horizontal"
                             ShowInsertRow="False" ShowGroupFooters="False" ShowColumnHeaders="True" RowIndicatorVisibility="Collapsed" FrozenColumnCount="3"
                             AlternationCount="2"  Loaded="radGridView1_Loaded"
                             AlternateRowBackground="#F8F8F8" AutoGeneratingColumn="radGridView1_AutoGeneratingColumn">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Company Name" DataMemberBinding="{Binding CompanyName}" Width="180" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Ticker" DataMemberBinding="{Binding Ticker}" Width="80" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="MIC" DataMemberBinding="{Binding MicCode}" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Publisher" DataMemberBinding="{Binding Publisher}" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Industry" DataMemberBinding="{Binding Industry}" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Model Name" DataMemberBinding="{Binding RegressionName}" Width="180" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Multiple" DataMemberBinding="{Binding Multiple}" Width="120" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Qtrs Lead" DataMemberBinding="{Binding NumQtrsLead}" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Time Period" DataMemberBinding="{Binding TimePeriod}" DataFormatString="{}{0:MM/dd/yyyy}"  IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Model Case" DataMemberBinding="{Binding ModelCase}" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Is Default" DataMemberBinding="{Binding IsDefault}" IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="R. Squared" DataMemberBinding="{Binding RSquared}" IsReadOnly="True" TextAlignment="Right"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Indicator Percentile" DataMemberBinding="{Binding IndicatorPercentile}" DataFormatString="{}{0:P2}" TextAlignment="Right"  IsReadOnly="True"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Over Under Valuation" DataMemberBinding="{Binding OverUnderValuation}" DataFormatString="{}{0:P2}" TextAlignment="Right" IsReadOnly="True"></telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Data;
using System.Windows;
using Telerik.Windows.Controls;
 
namespace AggregateFunctions
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        List<string> lstColumns = new List<string>();       
        public MainWindow()
        {
            InitializeComponent();
 
            lstColumns.Add("CompanyName");
            lstColumns.Add("Ticker");
            lstColumns.Add("MicCode");
            lstColumns.Add("RegressionName");
            lstColumns.Add("Publisher");
            lstColumns.Add("Industry");
            lstColumns.Add("Multiple");
            lstColumns.Add("NumQtrsLead");
            lstColumns.Add("TimePeriod");
            lstColumns.Add("ModelCase");           
            lstColumns.Add("RSquared");
            lstColumns.Add("IndicatorPercentile");
            lstColumns.Add("OverUnderValuation");
        }
 
        private void radGridView1_AutoGeneratingColumn(object sender, Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs e)
        {
            if (lstColumns.Contains(e.Column.UniqueName))
                e.Cancel = true;
            else
            {
                e.Column.TextAlignment = TextAlignment.Right;
                e.Column.Width = new GridViewLength(110);
                e.Column.IsReadOnly = true;
            }
        }
 
        private DataTable LoadData()
        {
            int counter = 0;
            DataTable dt = new DataTable();
            foreach (var item in lstColumns)
            {
                if (counter <= 6)
                    dt.Columns.Add(item, typeof(string));
                else if (counter == 7)
                    dt.Columns.Add(item, typeof(int));
                else if (counter == 8)
                    dt.Columns.Add(item, typeof(DateTime));
                else if (counter == 9)
                    dt.Columns.Add(item, typeof(string));               
                else
                    dt.Columns.Add(item, typeof(double));
 
                counter++;
            }
 
            dt.Columns.Add("OilWith1M", typeof(double));
            dt.Columns.Add("CapUtilPC", typeof(double));
            dt.Columns.Add("UnEmployement", typeof(double));
            dt.Columns.Add("NaturalGas", typeof(double));
            dt.Columns.Add("10YTreasury", typeof(double));
            dt.Columns.Add("USUnEmployemnet", typeof(double));
            dt.Columns.Add("IndustrialProduction", typeof(double));
            dt.Columns.Add("NewHomeSales", typeof(double));
            dt.Columns.Add("InventorySalesRatio", typeof(double));
            dt.Columns.Add("NaturalGasNYM", typeof(double));
 
            Random r = new Random();
            for (int i = 1; i < 500; i++)
            {
                DataRow row = dt.NewRow();
                counter = 0;
                foreach (var item in dt.Columns)
                {
                    if (counter <= 6)
                        row[item.ToString()] = Guid.NewGuid().ToString().Substring(0, 5);
                    else if (counter == 7)
                        row[item.ToString()] = r.Next(1000 * i);
                    else if (counter == 8)
                        row[item.ToString()] = DateTime.Now.AddDays(i);
                    else if (counter == 9)
                        row[item.ToString()] = Guid.NewGuid().ToString().Substring(0, 5);                   
                    else
                        row[item.ToString()] = r.Next(1000 * i);                   
 
                    counter++;
                }              
 
                dt.Rows.Add(row);
            }
 
            return dt;
        }
 
        private void radGridView1_Loaded(object sender, RoutedEventArgs e)
        {
            this.radGridView1.ItemsSource = LoadData();
        }
    }
}
Hi All,

I use RadGridView and i apply group by functionality, When the user groups by a particular column, could we adds row at bottom of each group (or it top header row) with average for the all the columns from R. Squared to the right.
(Its my grid column) 
Sufyan
Top achievements
Rank 1
 asked on 15 Nov 2012
0 answers
158 views
I have a screen that has a radgridview on it when the users selects a row it populates the screen with data about the selected row.  When the user either adds a new record or updates and existing row I run an update then reload the grid with the new data and also to check and see if any other users have shanged any data.  The issue I am having is I would like to set the selected row to the row that was just added or to the row the user has just updated.
How can I set the selected row by an ID on the gird?
Eric Klein
Top achievements
Rank 1
 asked on 15 Nov 2012
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?