Telerik Forums
UI for WPF Forum
1 answer
138 views
Hello, I'm working on a WPF application and using the RadChart control.
I'm familiar with the ItemToolTipFormat and DataPointMember="Tooltip" features, but I wonder if the following is possible:

I've attached an image for demonstration:
Is it possible that when I hover with the mouse cursor on the x axis categories, I'll get a tooltip:
For example: In the attached image, when I hover on the word May (or Sep or Nov and etc) with the mouse cursor, I will then get a tooltip.

What happens with the mentioned features above, I get a tooltip on the diagram itself, but as mentioned, I want a tooltip on the category itself on the x axis (when I hover on the months' words as displayed in the image).

Thank you in advance for your help!
 

Martin Ivanov
Telerik team
 answered on 06 Oct 2014
5 answers
1.2K+ views
Hi,

I'm creating a RadDocument from code and would like to be able to
determine the actual height of a specific tableRow.

I actually have two tables, and would like to have all the rows to have the same height ( = max of both tables):

for (int i = 0; i < rouwCount; i++)
{
    var maxHeight = tables.Max(x => x.Rows.ElementAt(i).Height);
    foreach (var table in tables)
    {
        table.Rows.ElementAt(i).Height = maxHeight;
    }
     
}

However, the height property is always zero. I understand this is not the actual height, is there a way to determine this?

Thanks,

Koen
Petya
Telerik team
 answered on 06 Oct 2014
2 answers
286 views
I have a RadGridView which is bound to an IQueryable. The initial data load is a bit slow, but is expected. However when I scroll at all it seems the data source is queried again. Thus performing any operations against the grid is fairly slow. I have solved this a bit by implementing the data pager. I have noticed that with a data page of 50 then scrolling to the bottom of the page yields a re-query. Then scrolling to the top does the same. However scrolling back to the bottom the data is cached. After this the single page can be scrolled very quickly.

Is it possible for the Grid to download 2 or 3 times more data than displayed, or the entire page size of content, so that it can act as a display buffer? Thus I can work with larger page sizes?
Dimitrina
Telerik team
 answered on 06 Oct 2014
1 answer
184 views
Hi,

I am trying to set different row heights on a row depending on a value in the underlying data.

So far I have worked out I can do the following...

var rows = rgv.ChildrenOfType<GridViewRow>();

int counter = 0;

foreach (GridViewRow gridViewRow in rows)
{
    gridViewRow.Height = 20.0 + counter;
    counter += 10;
}

This will set each row height to be 10 greater than its predecessor. The issue with this method is that the datagrid seems to calculate the height of the "rowspanel" based on the standard rowheight property and does not draw a vertical scroll bar, and also draws the horizontal scroll bar off the bottom of the visible area where it is not accessible.

My questions are is there a better way to achieve what I want? Maybe apply a style to the row whose height is bound to a property in the underlying data? Or is there some method I can call to "refresh" the datagrid to make it draw the horizontal scroll bar in the correct place and detect it needs to draw a vertical scroll bar.

Thanks

Andy


Dimitrina
Telerik team
 answered on 06 Oct 2014
9 answers
655 views
How would I programmatically add a text watermark to a Word document?

We are using C#, .NET 4.5 for a WPF desktop application on Windows 7.  Telerik UI for WPF version 2014.2.617.45 is used.

This needs to
1. Create a new word document
2. Add several pages of text, tables and images to the word document
3. Add a user entered watermark such as "For Internal Use Only" to each page at 44 point and angled from bottom left to top right.
4. The watermark should appear on all pages
5. Save the document in MS Word 2010 format if possible

It needs to be done in C# since there is no RichTextBox control in the application.


Petya
Telerik team
 answered on 06 Oct 2014
1 answer
208 views
Hello,

I ran into a snag recently that I realized was probably not a "common" request or feature set (due to most documentation/code examples).
The EditorAttribute  attribute class does its job for the compile-time defining of custom controls for properties. This part works well, however I was wondering if there is any other way to define custom controls of specific types for the RadPropertyGrid class at runtime?

Where was my "snag"?
Since The "target property" is passed to the constructor of the EditorAttribute when it is declared as an attribute above any given class's property/variable, any "target property" defined becomes a "static declaration" due to it being bound to a class's property's CustomProperty's constructor argument list within the assembly which ends up being a read-only list at run-time.

What scenario would require "run-time" defined EditorAttributes?
Since our scenario is a bit complex (run-time construction of classes), the easiest way to describe the issue would be that a "data container class" could have the same EditorAttribute defined for a generic property (as an example an Object class) of which could require the defined User Control Editor class to utilize different TargetProperty depending upon the type of the given example "Object class".

My temporary Fix (or potentially permanent with some instantiation reduction optimizations):
====================================================================
   public class CustomEditorAttribute : EditorAttribute
    {

        public CustomEditorAttribute(Type editorType)
            : base(editorType, GetTargetProperty(editorType), GetEditorStyle(editorType))
        {

        }

        public CustomEditorAttribute(Type editorType, EditorStyle editorStyle)
            : base(editorType, GetTargetProperty(editorType), GetEditorStyle(editorType))
        {

        }

        public CustomEditorAttribute(Type editorType, string targetProperty)
            : base(editorType, GetTargetProperty(editorType), GetEditorStyle(editorType))
        {
        }

        public CustomEditorAttribute(Type editorType, string targetProperty, EditorStyle editorStyle)
            : base(editorType, GetTargetProperty(editorType), GetEditorStyle(editorType))
        {

        }

        static CustomPropertyControl GetPropertyControl(Type type)
        {
            if (type.IsSubclassOf(typeof(CustomPropertyControl )))
            {
                return (CustomPropertyControl )InternalLib.AssemblyClassHelper.GetObjectInstance(type);
            }
            else
            {
                throw new Exception("The type (" + type.Name + ") is not a valid PropertyControl type!");
            }
        }

        public static String GetTargetProperty(Type type)
        {
            return GetPropertyControl(type).GetPropertyTargetName();
        }

        public static EditorStyle GetEditorStyle(Type type)
        {
            return GetPropertyControl(type).GetEditorStyle();
        }

    }
====================================================================
So, my current run-time assignment of EditorAttribute arguments "fix" was to derive from the EditorAttribute class and pass the results of statically defined methods within said class that invoke an instance of the Custom Editor Control class type defined within the EditorAttribute declaration in question.  The above code could also be modified further by passing a specific class type that is not the editor class in question, but a "type" container class which then could be modified at run-time based on different states of the application at the time of invocation.


Usage of the EditorAttribute Example:
====================================================================
...
        [InternalLib.PropertyControls.FieldProperties.CustomEditorAttribute(typeof(InternalLib.PropertyControls.ImagePropertyControl))]
        public Image ImageProperty
        {
            get
            {
                return imageProperty;
            }
            set
            {
                if (value != null && this.imageProperty != value)
                {
                    this.imageProperty = value;
                    this.OnPropertyChanged("ControlImage");
                    if (OnImageSourceChanged != null)
                    {
                        OnImageSourceChanged.Invoke(this.imageProperty.Source);
                    }
                }
            }
        }
...

Where:
public partial class ImagePropertyControl:CustomPropertyControl
{
...
        public override String GetPropertyTargetName()
        {
            return "SelectedItem";  //The control houses a RadListBox and as such the "SelectedItem" property of the listbox is the target property
        }

        public override EditorStyle GetEditorStyle()
        {
            return EditorStyle.Modal;
        } 

...
}

And where:
    public class BaseCustomPropertyControl:UserControl
    {
        
        public virtual String GetPropertyTargetName()
        {
            return String.Empty;
        }

        public virtual EditorStyle GetEditorStyle()
        {
            return EditorStyle.None;
        }
    }
====================================================================
However, it seems like a lot of work to simply be able to define the TargetPropery and the EditorStyle at run-time for a specific type.

Is there some way to (more easily) add EditorAttribute's programmatically to a RadPropertyGrid?

If not, then I figured I would post my current solution here in the event anyone else was trying to define class property EditorAttributes at run-time and needed one possible way to do it.

Cheers,

-Noel


p.s. 
~Side-Note on the included Code~
The code snippet included has an major optimization/instantiation issue.  One optimization one could do would be to create a
static dictionary in the BaseCustomPropertyControl class that is populated via a method always called in the BaseCustomPropertyControl
constructor that then in turn invokes the GetPropertyTargetName and GetEditorStyle methods (or is virtual and the child class is responsible
for returning proper information), stores both values into another container class/structure, and then adds the Key, as the Type, and
the Value, as the hypothetical container class, to the static dictionary which could then be checked via a static method defined within the
BaseCustomPropertyControl prior to constructing an entire new class instance each time.  This would reduce the number of
"bogus/ghost" instances of the child class derived from the BaseCustomPropertyControl (in this case it is the
ImagePropertyControl).  That would then reduce the number of times it would have to instantiate custom property controls (editors) when getting the TargetProperty and EditorStyle.
So, the example included in this post is strictly just a quick and dirty version.
Maya
Telerik team
 answered on 06 Oct 2014
12 answers
387 views
I am using the select all checkbox out of the box for selected items. I tried to change the header template using the following code:

<Style x:Key="MultiGridCheckbox" TargetType="telerik:GridViewCheckBoxColumn">
        <Setter Property="Header">
            <Setter.Value>
                <CheckBox IsChecked="{Binding Path=AllMembersAreChecked,                               
  RelativeSource={RelativeSource AncestorType=widgets:TelerikGrid}}"/>
            </Setter.Value>
        </Setter>
    </Style>

This works however the problem I'm having is if the user selects a row I want the header checkbox to be set to null to indicate to the user that there's a row(s) selected in the grid. Is that possible?
Vanya Pavlova
Telerik team
 answered on 06 Oct 2014
2 answers
282 views
I am using ServiceStack Ormlite for my data access and have a table with several million rows of data. Downloading this all locally to display in the RadGridView is not a good solution.

I have spent several hours now trying to figure out how to convert the FilterDescriptors and SortDescriptors to linq so that I can use them in Ormlite. It seems this is impossible. I have also tried the VirtualQueryableCollectionView, but run into the same issues.

The only solution I see now is to use EntityFramework for this data which I really don't want to do.
Datafyer
Top achievements
Rank 1
Veteran
 answered on 03 Oct 2014
7 answers
418 views
Hi All

is it possble to change the size of TileListItem accornig to some ratio

For example :
Item 1   20*20
Item  2  20*20
Item 3  20*100
Item 4   20*20
item 5   40*40
....
...
....
...

Is This possible ?

Regards
Yoan
Telerik team
 answered on 03 Oct 2014
1 answer
151 views
Hi,

I want to place labels directly on the border of the pie, so that half of the label should be onto the pie, and other half should be out of the pie.

I’ve found a Margin property of ChartSeriesLabelDefinition but it does not fulfill my goal. Margin >= 0 draws labels onto the pie (closely to its center), and Margin < 0 draws them out of the pie (with different offsets, btw). I need some interjacent position. Is there any workaround?

Thanks.
Pavel R. Pavlov
Telerik team
 answered on 03 Oct 2014
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?