Hi everybody
I m try use the class CustomDragandDrop on radtreeview but i have a issue,
if i use the next example, i dont have any problem:
protected void BindRadTreeView()
{
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(string));
dt.Columns.Add("Title", typeof(string));
dt.Columns.Add("ParentId", typeof(string));
string parentId = string.Empty;
string childId = string.Empty;
for (int i = 0; i < 2; i++)
{
parentId = Guid.NewGuid().ToString();
dt.Rows.Add(parentId, "Node" + i, null);
for (int j = 0; j < 5; j++)
{
childId = Guid.NewGuid().ToString();
dt.Rows.Add(childId, "SubNode" + i + "." + j, parentId);
}
}
this.radTreeView1.ChildMember = "Id";
this.radTreeView1.ParentMember = "ParentId";
this.radTreeView1.DisplayMember = "Title";
this.radTreeView1.DataSource = dt;
}
i can drag and drop correctly
but the problem is when i binding the Radtreeview
protected void llenatreeview1() {
dtTablas = dat.consultaBD();
DataTable dt = new DataTable();
dtCopi.Columns.Add("Id", typeof(string));
dtCopi.Columns.Add("Title", typeof(string));
dtCopi.Columns.Add("ParentId", typeof(string));
string parentId = string.Empty;
string Id = string.Empty;
string title = string.Empty;
foreach (DataRow row in dtTablas.Rows)
{
parentId = row["ParentId"].ToString();
Id = row["Id"].ToString();
title = row["Title"].ToString();
if (parentId == "")
dt.Rows.Add(Id, title, null);
else
dt.Rows.Add(Id, title, parentId);
}
radTreeView2.ChildMember = "Id";
radTreeView2.ParentMember = "ParentId";
radTreeView2.DisplayMember = "Title";
radTreeView2.DataSource = dt;
}
first is freeze and then appears the error.
when i drag and drop appears then next error:
System.StackOverflowException
GridView has a default text alignment for new columns as 'MiddleCenter'.
Default alignment for new GridViewDataRowInfo is 'left'.
Please can these be the same ?
Hi there,
We have recently found a bug on both the RadDocument and Rad Rich Text Editor. Created a RTF document via the RadRichText Editor. The RTF document contains a table. When the document is saved and loaded from the same form, it is displaying correctly, however when loaded from a different form, it seems to have shrunk and lost the column width, thus having long and skinny columns.
We have set the fixed column width on the table, however this did not seem to solve the issue.
I have attached two screenshots for reference. One with the correct looking table, and one with the long and skinny columns.
Is there a workaround, or is this a known bug?
Correct table:
Long and skinny columns:
Currently on Telerik Winforms version 2018.3.1016.40
Kind regards,
Paul
I have a form which contains TreeView control. I need to convert it to RadTreeView. So I replaced TreeView control with RadTreeView and TreeNode with RadTreeNode in the code. I found that the events in both are different, so tried to replace the events with similar events in RadTree.
Following are the events that I have replaced in my code :
1.
Private Sub TreeView1_AfterExpand(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvMain.AfterExpand
Replaced by -
Private Sub TreeView1_AfterExpand(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles tvMain.NodeExpandedChanged
2.
Private Sub TreeView1_AfterCollapse(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvMain.AfterCollapse
Replaced by -
Private Sub TreeView1_AfterCollapse(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles tvMain.NodeExpandedChanged
and included Expanded flag to check if it is expand or collapse.
Here, I noticed unwanted firing of this replaced event when compared to the old event, but I handled it using the Expanded flag.
3.
Private Sub tvMain_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvMain.AfterSelect
Replaced by -
Private Sub tvMain_AfterSelect(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles tvMain.SelectedNodesChanged
This event gets fired twice while clicking on a node.
My main issues are,
See attached screenshot. The popup calendar looks wrong when running on a display with 250% scaling. Surely, that's not correct. The calendar should not be so large and the fonts so small. Am I missing something? I have done all the other steps to enable High DPI support, and as you can see, the textbox area seems to scale fine.
Any ideas?
David
1. Select the ColorBox's ellipses to open the Color Dialog
2. Select the Web tab
3. Select Any colour in this Page
4. Select Transparent
Colour will update
5. Select the Professional tab
6. Select any colour
Colour won't update
7. Select any colour
Colour won't update
8. Select OK on Dialog
Colour will be transparent
Values will be same as selected in step 7
I would like to have a generic validation-mechanism, implemented in all controls. Hear me out:
A class ValidationInformation for containing all sort of validation information for a certain field, property, cell, etc. which has properties likes:
It also has a virtual method like bool Validate(object entity, object value, out string validationError).
A base class ValidationInformationProvider for retrieving validation information from various sources. It has some abstract methods for retrieval, storing/caching information per cell/field/property.
This base class has the following subclasses:
Each provider is responsible for reading validation information from the source (DataTable, annotations on a property, etc.) and fill a ValidationInformation object.
Now the fun begins...
Each Telerik class, like RadGridView and/or subcomponents should get a method or event to retrieve ValidationInformation. When the event is not handled or the method returns null, the default behavior kicks in.
When ValidationInformation is provided, default behavior is overridden. Properties of editors van be set with values from ValidationInformation (like Minimum and Maximum of a GridViewDecimalColumnPlus or RadSpinEditorElement). At the end if editing the method ValidationInformation.Validate is called to validate the new value. The validation error can be used for popups, or tooltips, or an exception.
This way a user does not have to think where to set which property of any Telerik control for any validation. This way a RadPropertyGrid and RadGridView can work the same way when it comes to data validation, regardless of all editors which work in the background.
In the image below you can notice lines that disappear, identical lines but rendered more or less thick.
Hi Dinko and Team,
As I mentioned in the previous forum, We need fix for Raddropdownlist.SelectedIndex.
When we set SelectedIndex=5 or some value in selectedIndexchangedEvent then the recursive call is happening for SelectedIndex. So we need to restrict the recursive call for both Raddropdownlist.DataSource as well as Raddropdownlist.SelectedIdex.
private void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
fillIndustryProcess1(); // radDropDownList1.DataSource = dt; when we set Datasource the recursive call is occurring
radDropDownList1.SelectedIdex = 5; // radDropDownList1.SelectedIdex= 5; when we set Datasource the recursive call is occurring
}
public void fillIndustryProcess1()Old Forums in which , Telerik team fixed the RadDropDownList .SelectedValue.
Previous forums in which , Telerik team yet to fix for RadDropDownList.Datasource.
Thanks,
Maheswari
Hello support,
here is what happend:
I created a RadFrom with controlls on it.
Then i add it to my RadDock like this:
private void Add_RadForm_asDocument_ToRadDock(RadDock rd, HostWindow hw, object radform, string title)
{
bool found = false;
foreach (var item in radDock_main_notr.DockWindows)
{
if (item.GetType() == typeof(HostWindow))
{
if (((HostWindow)item).Name == radform.GetType().Name + "1")
{
found = true;
hw = (HostWindow)item;
}
}
}
if (found == false && radform != null)
{
if (hw == null || hw.Text == "")
{
hw = rd.DockControl((System.Windows.Forms.Control)radform, DockPosition.Fill, DockType.Document);
}
}
hw.Text = title;
hw.CloseAction = DockWindowCloseAction.Close;
hw.ToolCaptionButtons = ToolStripCaptionButtons.None;
hw.Select();
}
The RadFrom is added to the RadDock:
Settings is the new RadFrom thats now docked.
But when i try to use the RadDropDownList then its "stucks" (also the other GUI controls):
The changed selection of the RadDropDownList will not change.
When i close the RadForm via the "x" and eropen it again it works.
We work with a RadGridView with 145000 rows and 4 columns. We use copy-paste to move data around from other apps and the application with build with Telerik.
When we copy a flat file (with tabs delimited fields) and we paste it to the RadGridView, the whole process is painfully slow. The function to retrieve the data from the clipboard takes minutes (maybe hours, I cancelled it). It tracked the cause down to the StringTokenizer class. The tokenizer splits the string up into separate fields. But after extracting a field it creates a new copy of that string (containing about 10MB of data) minus the field. I patched it (with HarmonyX) and now it takes only one second:
static class StringTokenizerPerformancePatch
{
static private readonly InstanceFieldAccessor<StringTokenizer, LinkedList<string>> _tokens = new InstanceFieldAccessor< StringTokenizer, LinkedList<string>>("tokens");
static private readonly InstanceFieldAccessor<StringTokenizer, string> _sourceString = new InstanceFieldAccessor<StringTokenizer, string>("sourceString");
static private readonly InstanceFieldAccessor< StringTokenizer, string> _delimiter = new InstanceFieldAccessor<StringTokenizer, string>("delimiter");
static private readonly InstanceFieldAccessor< StringTokenizer, IEnumerator<string>> _enumerator = new InstanceFieldAccessor<StringTokenizer, IEnumerator<string>>("enumerator");
[HarmonyPatch(typeof(StringTokenizer), "Tokenize")]
staticclassPatch_StringTokenizer_Tokenize
{
static bool Prefix(StringTokenizer __instance)
{
var tokens = _tokens.GetValue(__instance);
var sourceString = _sourceString.GetValue(__instance);
var delimiter = _delimiter.GetValue(__instance);
Tokenize(tokens, sourceString, delimiter);
_enumerator.SetValue(__instance, tokens.GetEnumerator());
returnfalse;
}
static private void Tokenize(LinkedList<string> tokens, string text, string delimiter)
{
tokens.Clear();
if (string.IsNullOrEmpty(text))
return;
int index = 0;
while(true)
{
var index2 = text.IndexOf(delimiter, index, StringComparison.Ordinal);
if (index2 < 0)
{
tokens.AddLast(text.Substring(index));
break;
}
string token = text.Substring(index, index2 - index);
tokens.AddLast(token);
index = index2 + delimiter.Length;
}
}
}
}
Please update your tokanizer to increase performance. While you are at it:In the exported PDF document, the font size of the header and footer is smaller than the font of the data cells, even though the specified font is the same size.
To reproduce set the same font to the header and data cells:
pdfExport.HeaderFont.Font = new Font("Segoe UI", 10f);
private void PdfExport_CellFormatting(object sender, PdfExportCellFormattingEventArgs e)
{
e.CellElement.Font = new Font("Segoe UI", 10f);
}
It would be great if there were a right-click menu option for custom Rad controls to "apply the theme to all sub-controls", similar to how Forms work.
I've attached images to illustrate the functionality.
Right now it only works for forms, and my custom controls have to be manually adjusted one at a time, by hand, which is time consuming and error prone.
It would save a lot of time and reduce the chance of missing a control when applying themes locally.
Right now the only way to apply themes is either globally or individually by hand, or with a find-replace-in-files command on the ThemeName property.
To reproduce RadGridView (or other RadControl) flooding WM_TIMER messages do the following
1. Create a simple WinForms project with a RadGridView in it.
2. Open spy++ tool (it comes with Visual Studio).
3. Attach the process that is running the WinForms and choose to display its messages.
4. You should now see a lot of WM_TIMER messages as shown in the gif file.
Hello,
Our product uses Infragistics controls. We have been in business for 21 years and since then we have been using Infragistics controls for WinForms. We would like to move to Telerik controls for WinForms, even though we already use Telerik controls for Blazor. Is there an easy way to convert them? Is there any plan to release a tool to convert them automatically? It will be very helpful and I am sure many companies are interested as well.
Thank you