I wrote some code to change the skin in the Item Created, but I get a error.
Code:
protected
void CancellationsGrid_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
RadDatePicker picker = ((e.Item as GridEditableItem)["DateColumn"].Controls[0] as RadDatePicker);
if (picker != null)
{
picker.EnableEmbeddedSkins =
true;
picker.Skin =
"Sunset";
}
}
}
Error:
Message:
InvalidOperationException: Telerik.Web.UI.DatePickingInput with ID='dateInput' was unable to find embedded skin with name 'CoffeeShop'. Please, make sure that you spelled the skin name correctly, or if you want to use a custom skin, set EnableEmbeddedSkins=false.
Source:
at Telerik.Web.SkinRegistrar.GetEmbeddedSkinAttributes(ISkinnableControl control, Type controlType)
at Telerik.Web.SkinRegistrar.RegisterCssReferences(ISkinnableControl _control)
at Telerik.Web.UI.RadWebControl.RegisterCssReferences()
at Telerik.Web.UI.RadWebControl.OnPreRender(EventArgs e)
at Telerik.Web.UI.RadInputControl.OnPreRender(EventArgs e)
at Telerik.Web.UI.RadDateInput.OnPreRender(EventArgs e)
at Telerik.Web.UI.DatePickingInput.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I tried to also set
picker.DateInput.EnableEmbeddedSKins = true;
It didn't help. I keep getting the same error.
Is it possible to accomplish this?