I have a custom Fluent theme as a package, it would be nice if there was a way to load packages (Embedded Resource or files) with the RadThemeManager.
Rather than typing this: Telerik.WinControls.ThemeResolutionService.LoadPackageResource("GUI.Themes.Fluent_Custom.tssp");
Right now the RadThemeManager only supports XML files. Feeding it a tssp file doesn't work.
For it to show up in design-time I have to assign it all of the unpackaged XML files and then delete the RadThemeManager for the theme to show up, otherwise the load time is like 7 seconds, where as embedded packages load super fast.
The fluent theme has a lot of XML files and this is a huge pain, supporting 1 Embedded Resource tssp package would be nice.
Would also be nice if the RadThemeManager could apply/change a theme globally somewhere in the SmartTag menu or RadThemeManager properties.
Instead of having to type this: ThemeResolutionService.ApplicationThemeName = "Fluent_Custom";
Environment: Telerik WinForms 2018.3.1016.40, VS 2013 Pro U5, Win 10 Ent 64 1809 17763.195
Steps:
Create a new WinForm project with default settings
Add a RadForm with default settings
Add a RadScrollablePanel to the RadForm with default settings
Add a RadPanel inside the RadScrollablePanel with default settings
Add a 3 RadRadioButtons to the RadScrollablePanel with default settings
Select all 3
Press Ctrl+X to cut the radio buttons.
Actual Result: Visual Studio will immediately hang and any unsaved project work will be lost.
Actual Desire: To be able cut and paste the 3 radio buttons into the RadPanel, just like normal MS WinForm controls in design-time.
To reproduce:
- Open the Excel-like filtering example in the demo application and sort the second column.
- The sort icon is over the text.
Workaround:
private void RadGridView1_SortChanged(object sender, Telerik.WinControls.UI.GridViewCollectionChangedEventArgs e)
To reproduce:
- Set the MaxDropDownItems and the DefaultItemsCountInDropDown and open the popup on HDPI.
Until released the text can be cleared this way:
GridSearchCellElement searchCell = this.radGridView1.TableElement.FindDescendant<GridSearchCellElement>();
Deleting table right after merged fields are updated causes StackOverflowException.
To reproduce: add a RadLabel and change its cursor to Hand.
this.radLabel1.Cursor = Cursors.Hand;
The PixelatedHandCursor.png shows the poor quality of the cursor which should be improved.
Workaround: https://stackoverflow.com/questions/6016995/un-antialiased-hand-cursor-in-windows-forms-apps/6017174#6017174
public class LinkLabelEx : RadLabel
{
private const int WM_SETCURSOR = 0x0020;
private const int IDC_HAND = 32649;
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern IntPtr SetCursor(IntPtr hCursor);
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_SETCURSOR)
{
// Set the cursor to use the system hand cursor
SetCursor(LoadCursor(IntPtr.Zero, IDC_HAND));
// Indicate that the message has been handled
m.Result = IntPtr.Zero;
return;
}
base.WndProc(ref m);
}
}
The ImprovedCursorRendering.png shows the improved cursor.
Implement functionality to rotate the text in a cell.
When the current SpanLayoutBox is split (for example by inserting space), the DocumentPosition created with trackDocumentChangeEvents option (with some of the constructor accepting the boolean 'trackDocumentChangeEvents' parameter) jumps back with two symbols.
How to reproduce: create the following custom cell and notice that the collapsed elements would still occupy space inside the cell. Check the attached screenshot
public class PNUDFCellElement : GridDataCellElement
{
public PNUDFCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
{
}
private CustomStackLayoutElement stack;
private RadDropDownListElement radDropDownListElement;
private RadDateTimeEditorElement radDateTimeEditorElement;
private RadTextBoxControlElement radTextBoxElement;
protected override void CreateChildElements()
{
base.CreateChildElements();
stack = new CustomStackLayoutElement();
stack.StretchHorizontally = true;
stack.Orientation = Orientation.Horizontal;
radDropDownListElement = new RadDropDownListElement();
radDropDownListElement.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
radDropDownListElement.StretchHorizontally = true;
radDateTimeEditorElement = new RadDateTimeEditorElement();
radDateTimeEditorElement.StretchHorizontally = true;
radTextBoxElement = new RadTextBoxControlElement();
radTextBoxElement.StretchHorizontally = true;
stack.Children.Add(radDropDownListElement);
stack.Children.Add(radDateTimeEditorElement);
stack.Children.Add(radTextBoxElement);
this.Children.Add(stack);
}
protected override void SetContentCore(object value)
{
this.radDropDownListElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
this.radTextBoxElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
this.radDateTimeEditorElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
this.DrawText = false;
if (this.RowIndex % 3 == 0)
{
this.radDropDownListElement.Visibility = Telerik.WinControls.ElementVisibility.Visible;
this.radDropDownListElement.Text = this.Value + "";
}
else if (this.RowIndex % 3 == 1)
{
this.radTextBoxElement.Visibility = Telerik.WinControls.ElementVisibility.Visible;
this.radTextBoxElement.Text = this.Value + "";
}
else
{
this.radDateTimeEditorElement.Visibility = Telerik.WinControls.ElementVisibility.Visible;
}
base.SetContentCore(value);
}
}
public class CustomDataColumn : GridViewDataColumn
{
public CustomDataColumn(string fieldName) : base(fieldName)
{
}
public override Type GetCellType(GridViewRowInfo row)
{
if (row is GridViewDataRowInfo)
{
return typeof(PNUDFCellElement);
}
return base.GetCellType(row);
}
}
Workaround: use a custom StackLayoutElemetn
public class CustomStackLayoutElement : StackLayoutElement
{
protected override void ArrangeHorizontally(SizeF finalSize)
{
RectangleF clientRect = this.GetClientRectangle(finalSize);
float stretchableWidth = 0;
int stretchableCount = 0;
int nonStretchableItems = 0;
foreach (RadElement element in this.Children)
{
if (element.Visibility == ElementVisibility.Collapsed)
{
continue;
}
if (element.StretchHorizontally)
{
stretchableCount++;
}
else
{
stretchableWidth += element.DesiredSize.Width;
nonStretchableItems++;
}
}
if (nonStretchableItems > 0)
{
stretchableWidth += ElementSpacing * (nonStretchableItems - 1);
}
int spacing = this.ElementSpacing;
if (stretchableCount > 0)
{
stretchableWidth = (clientRect.Width - stretchableWidth) / stretchableCount;
stretchableWidth -= spacing * stretchableCount;
}
ArrangeItemsHorizontaly(clientRect, finalSize, stretchableWidth, spacing);
}
protected override void ArrangeItemsHorizontaly(RectangleF clientRect, SizeF finalSize, float stretchableWidth, float spacing)
{
float x = clientRect.X;
float y = clientRect.Y;
List<RadElement> children = new List<RadElement>(this.Children);
if (this.Comparer != null)
{
children.Sort(this.Comparer);
}
for (int i = 0; i < children.Count; i++)
{
RadElement element = null;
if (this.RightToLeft && this.RightToLeftMode == RightToLeftModes.ReverseItems)
{
element = children[children.Count - i - 1];
}
else
{
element = children[i];
}
if (element.Visibility == ElementVisibility.Collapsed)
{
continue;
}
RectangleF proposedRect = new RectangleF(x, y, stretchableWidth, clientRect.Height);
RectangleF finalRect = AlignRect(element, proposedRect);
if (this.RightToLeft && this.RightToLeftMode == RightToLeftModes.ReverseOffset)
{
finalRect.X = finalSize.Width - x - finalRect.Width;
}
this.ArrangeElement(element, clientRect, finalRect, finalSize);
x += finalRect.Width + spacing;
}
}
}