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).
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?
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.
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.
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))
{
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.
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?
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.
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?