Hey all,
I'm working on a wrapper for the KendoUI color picker to allow users more control over the colors of how their data is being represented.
So the overall flow will be, given a dynamic list of data, create a color picker for each one, passing an object reference for that specific item. Then, upon a color being picked, call a function on that object to update it's color property with the selection.
My problem being that I can't figure out how to get the object reference into the color changed event. I thought using JS protoyped functions would work (because I need each color picker to have it's own scope so it knows which object's function to call) but 'this' inside of ColorPickerWidget is scoped to the window instead of to ColorPickerWidget.
Any suggestions would be appreciated!
JS functions:
function ColorPickerWidget(bindTo, objRef) {
var objectRef = objRef;
this.create(bindTo);
};
ColorPickerWidget.prototype.create = function(bindTo) {
$(bindto).kendoColorPicker({
value: "#ffffff",
buttons: false,
select: this.selectColor
});
}
ColorPickerWidget.prototype.selectColor = function(e) {
this.objectRef.invokeMethodAsync("ChangeColor", e.value);
}
.NET Functions:
protected async override Task OnInitializedAsync()
{
await JsRuntime.InvokeVoidAsync(identifier: "ColorPickerWidget", elRef, DotNetObjectReference.Create(this));
}
[JSInvokable]
public void ChangeColor(string color)
{
Color = color;
ColorChanged.InvokeAsync(color);
}
hello,
i had an issue with grid scroll because on some states after user has scrolled the grid i want to bring back up the scrolll and show first datas
also my grid is virtualized. is there any way to do this ?
Hi
I am just learning/testing with Blazor and have created a standard Blazor Server App, using the default template built into VS 2019. Is there a simple way I can convert this to a Telerik Blazor app? For exampe copy over some DLLs or maybe install a nuget package?
Or do I have to start from scratch and use the Telerik Blazor built into VS Studio?
Manythanks in advance
Hi,
I have a calendar control with initial date. It could be "Today" or any other date. The Calendar works fine but the initial date is not visually selected. If I click on any date it's get selected and displayed in "red" but I need it selected initially without user intervention.
<TelerikCalendar SelectionMode="@CalendarSelectionMode.Single"
ValueChanged="@( (DateTime d) => OnBeginDateChangeHandlerAsync(d) )"
Min="@beginmin" Max="@beginmax"
@bind-Date="@begindate">
</TelerikCalendar>
@code {
protected DateTime begindate { get; set; } = DateTime.Now.AddDays(-8).Date;
}
Thanks.
Hi,
Is there any way to disable all weekends on Calendar control? Yes, I could create a list of disable dates but it will be a huge list. I just curious if there is some setting to do that.
Thanks.
I've used your example code to adjust the font size on a grid and been using rowheight to adjust the row height but there appears to be some limit as too how small you can make the row height.
I've attached a screen shot which shows there is a lot of space in the row above and below the small text, can this be reduced?
Cheers
Steve
Hi,
when setting DropDownList's DefaultText (e.g. to a "none" string) then the component displays an additional entry which stands for a null/default value (in other words: it acts as a clear button).
But the OnChange event does not fire when selecting that entry.
Using: Telerik.UI.for.Blazor.Trial (2.14.1)
Regards
Kasimier Buchcik