Background: With many people having moved to working remotely, collaboration is a much larger part of any enterprise applications. As such, it would be highly beneficial to add real time collaboration capabilities to editor controls, more specifically the RadRichTextEditor control. It would work similarly to how MS Word works when more than one user is editing a document at the same time.
Scenario: Assume you have and WinForms application where there is a form that contains a RadRichTextEditor. The content for this control is populated from a centralized database. This content is editable by users of the application. Lets say that you have two users (User A and User B) editing this content at the same time. Currently, User A cannot see what User B is doing in real-time, and vice-versa. Each time one of the users saves the content, it will overwrite any changes made by the other user.
Desired outcome: If the users in the above scenario are using MS Word, each user would see that someone else is currently editing the document and the other user's changes would be displayed in real-time. This same outcome should be made more readily available with the Telerik editors, primarily the RadRichTextEditor, so that when two users are editing the same content, they would see each others' changes in real-time.
I know this is possible using SignalR and a bit of code, but I think it would be beneficial for the RadRichTextEditor to have better "out of the box" support for this feature.
I am aware of a web-based control that has this feature. Specifically, the CKEditor (https://ckeditor.com/) control has the features I am requesting. However, I am looking at WinForms as opposed to web.
RadVirtualGrid is created to support a million records or more. Still it contains some "heavy" operations like CopySelection/CutSelection/Paste which can take a long time.
I would like to intercept these methods so I can show a "Please wait"-window during the operation. Furthermore I have the need to set a flag to true when such a operation is executing.
The Cut operations of the RadVirtualGrid does not work.
When the SelectionMode is set to FullRowSelect, MultiSelect = true, and multiple rows are selected, the loop goes something like this:
// Pseudo code:
for(int rowIndex = firstRow; rowIndex <= lastRow; rowIndex++)
{
AddRowToClipboardData(rowIndex)
UserDeletedRow(rowIndex);
}
My suggestion:
The assembly is required for our RadMarkupEditor using the IE rendering engine. It allows you to specify HTML-like text formatting at design time in the Properties window of Visual studio:
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:I can't provide a project or even code snippets that would make sense out of context because the code base is too complex for an easy replication to be setup.
We are trying various things like calling Refresh, Update.
Hoping this is something you've encountered before and have some suggestions.
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
Currently, RadGridView offers GridViewImageColumn. However, it would be good to offer support for SVG images out of the box.
One possible approach is to introduce a new property for the GridViewImageColumn - ImageDrawType = ImageDrawType.Svg that controls what kind of images this column will store.
Second approach is to introduce a new GridViewSvgImageColumn.
Hi guys,
It would be great to be able to set the day start/finish times in your Scheduler.
Your Scheduler control is fantastic, but I am building a Scheduler for a company that operates over 24hrs and the shift hours are
6am - 6pm
6pm - 6am
both shifts are classed as being the same day even though the nightshift crosses over to the next day.
I would like to be able to adjust the 24hr period that defines a day so that in month view the appointment will not carry over to the next shift.
and in day view, the schedule will start at 6am and go through to 6am.
If you could implement this, your scheduler control would be even more powerful and awesome.
Thanks!
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.
This is about the following method:
public void SetError(GridViewCellCancelEventArgs e, Exception exception)
{
GridViewDataErrorEventArgs args = new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit);
if (e != null)
{
args = new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);
}
this.EventDispatcher.RaiseEvent<GridViewDataErrorEventArgs>(EventDispatcher.DataError, this, args);
if (args.ThrowException)
{
throw args.Exception;
}
if (args.Cancel)
{
//TODO: cancel row edit
}
}
Right now, the method GridViewTemplate.SetError accepts a parameter of type GridViewCellCancelEventArgs, which in itself is weird, because event args should only be used inside events and OnXXX-methods. But since SetError fires an event, one could argue that this method is like a OnXXX-method.
But inside it becomes more weird, it translates GridViewCellCancelEventArgs into GridViewDataErrorEventArgs. And I must admit, the last DataError-args feel a lot more logical that CellCancel-args when firing setting an error. Furthermore, if I create an override of class GridViewCellCancelEventArgs to contain more data about an error, this information never reaches the event handlers.
So why this translation? Or better: Why this parameter?
My suggestion would be to make a new overload:
public void SetError(GridViewDataErrorEventArgs e)
{
if (e == null)
throw new ArgumentNullException(nameof(e));
this.EventDispatcher.RaiseEvent<GridViewDataErrorEventArgs>(EventDispatcher.DataError, this, args);
if (args.ThrowException)
throw args.Exception;
if (args.Cancel)
{
// TODO: I really do not know what telerik wanted to do here, so I live this up to Telerik.
}
}
This is about this method:
public void SetError(GridViewCellCancelEventArgs e, Exception exception)
{
GridViewDataErrorEventArgs args = new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit);
if (e != null)
{
args = new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);
}
this.EventDispatcher.RaiseEvent<GridViewDataErrorEventArgs>(EventDispatcher.DataError, this, args);
if (args.ThrowException)
{
throw args.Exception;
}
if (args.Cancel)
{
//TODO: cancel row edit
}
}
The method GridViewTemplate.SetError accepts a parameter of type GridViewCellCancelEventArgs (named e), but uses the information to create a new object of type GridViewDataErrorEventArgs (named args) and uses information from e to fill args.
The method then fires an event with args. Args also has a property Cancel which can be set in the event handlers. But nothing is done with that property.
Parameter e also has a property Cancel which is never be filled. So it could be useful, at the end of SetError, to set e.Cancel with args.Cancel. This way the caller can use the Cancel information from the events.
This request is also related to my next request.
PS: Why is GridViewCellCancelEventArgs called this way? It implies it has arguments for an event, but it is not used for an event, am I right?
The method GridViewTemplate.SetError creates in most situations an GridViewDataErrorEventArgs object twice.
Current code:
GridViewDataErrorEventArgs args = new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit);
if (e != null)
{
args = new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);
}
In assume in most cases e will not be null, so in must cases the first args will be removed. This has a small negative impact on memory and performace.
Suggestion:
GridViewDataErrorEventArgs args = e == null
? new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit)
: new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);