Hi Telerik,
Is it possible to have a RadDock class which implements IPostBackEventHandler's RaisePostBackEvent method and also utilize the cleanliness of RadDock_Command?
Currently, I have this setup:
My RadDock has a custom command which opens a dialog window. This window visualizes some of the RadDock's settings. After closing, those changes must be persisted and reflected on the RadDock.
I noticed, however, that after implemented IPostBackEventHandler, that RadDock's commands are getting eaten by this RaisePostBackEvent instead of filtering into RadDock_Command.
Is it possible to achieve this?
Is it possible to have a RadDock class which implements IPostBackEventHandler's RaisePostBackEvent method and also utilize the cleanliness of RadDock_Command?
Currently, I have this setup:
/// <summary>
/// Parses custom/default commands of RadDock.
/// </summary>
public
void
RadDock_Command(
object
sender, DockCommandEventArgs e)
{
Logger.InfoFormat(
"Command {0} detected for {1} "
, e.Command.Name, ID);
switch
(e.Command.Name)
{
case
"Close"
:
Close();
break
;
case
"Refresh"
:
RefreshContent(ForceCacheRefresh.True);
break
;
case
"Toggle Legend"
:
ToggleLegend();
break
;
case
"Undo Drill Down"
:
UndoDrillDown();
break
;
default
:
Logger.ErrorFormat(
"Unhandled command name: {0}"
, e.Command.Name);
break
;
}
}
public
void
RaisePostBackEvent(
string
eventArgument)
{
HandleDialogClose(eventArgument);
}
private
void
HandleDialogClose(
string
json)
{
if
(json.Contains(
"HistoricalLocalSettingsJSON"
))
{
UpdateSettings(JsonConvert.DeserializeObject<HistoricalLocalSettingsJSON>(json));
}
else
if
(json.Contains(
"CustomLocalSettingsJSON"
))
{
UpdateSettings(JsonConvert.DeserializeObject<CustomLocalSettingsJSON>(json));
}
else
{
Logger.ErrorFormat(
"Unable to handle JSON: {0}"
, json);
}
}
My RadDock has a custom command which opens a dialog window. This window visualizes some of the RadDock's settings. After closing, those changes must be persisted and reflected on the RadDock.
I noticed, however, that after implemented IPostBackEventHandler, that RadDock's commands are getting eaten by this RaisePostBackEvent instead of filtering into RadDock_Command.
Is it possible to achieve this?