protected
void
RadGrid1_PreRender(
object
sender, EventArgs e)
{
if
(!Page.IsPostBack)
{
RadGrid1.MasterTableView.IsItemInserted =
true
;
RadGrid1.Rebind();
}
GridCommandItem commandItem = RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0]
as
GridCommandItem;
commandItem.Visible = !RadGrid1.MasterTableView.IsItemInserted;
if
(!commandItem.Visible)
// If edit form is open
{
GridEditFormItem editFormItem = RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)[0]
as
GridEditFormItem;
editFormItem.Parent.Controls.Remove(editFormItem);
commandItem.Parent.Controls.AddAt(0, editFormItem);
}
}
<
asp:UpdatePanel
ID
=
"updtImagepanel"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
div
style
=
"height: 600px"
id
=
"designDiv"
runat
=
"server"
>
<
table
>
<
tr
>
<
td
>
<
div
style
=
"height: 600px; width: 400px;"
>
<
telerik:RadImageEditor
ID
=
"RadImageEditor"
runat
=
"server"
StatusBarMode
=
"Hidden"
Width
=
"400px"
Height
=
"600px"
OnImageEditing
=
"Image1_ImageEditing"
EnableResize
=
"true"
>
<
Tools
>
<
telerik:ImageEditorToolGroup
>
</
telerik:ImageEditorToolGroup
>
</
Tools
>
</
telerik:RadImageEditor
>
</
div
>
</
td
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
protected
void
Image1_ImageEditing(
object
sender, ImageEditorEditingEventArgs args)
{
args.Cancel =
true
;
string
fileFolder = ConfigurationManager.AppSettings[
"Telerik_FileUpload"
];
string
fileName =
string
.Empty;
var commandArguments =
(Dictionary<
string
,
object
>)args.ClientObjectsDictionary[
"commandArgument"
];
if
(args.CommandName ==
"SaveImage"
)
{
EditableImage editableImage = args.Image;
// Cropping Of an Image
Rectangle cropRectangle =
new
Rectangle(
Convert.ToInt16(commandArguments[
"viewportX"
]) - Convert.ToInt16(commandArguments[
"topX"
]),
Convert.ToInt16(commandArguments[
"viewportY"
]) - Convert.ToInt16(commandArguments[
"topY"
]),
400,
600);
editableImage.Crop(cropRectangle);
// Applying Title, Subtitle on Image
//
//Code to set variables for ApplyText method omitted for brevity
//
//Custom function to apply text to the cropped image
Image newImage = ApplyText(titlePosition, subTitlePosition, authorNamePosition, title, subtitle, authorName, editableImage);
newImage.Save(Path.Combine(fileFolder, fileName), ImageFormat.Jpeg);
RadImageEditor.ImageUrl =
//path to my image
updtImagepanel.Update();
}
}
<
telerik:RadButton
ID
=
"RadButton15"
runat
=
"server"
PostBackUrl
=
"~/CostDashboard.aspx"
Skin
=
"Default"
Target
=
"_blank"
Text
=
"Costing"
Visible
=
"True"
Width
=
"200px"
ButtonType
=
"LinkButton"
>
</
telerik:RadButton
>
<
telerik:RadScheduler
runat
=
"server"
ID
=
"RadScheduler1"
TimelineView-NumberOfSlots
=
"7"
AdvancedForm-Enabled
=
"false"
OnClientAppointmentClick
=
"appointmentClick"
EnableExactTimeRendering
=
"false"
SelectedView
=
"TimelineView"
CustomAttributeNames
=
"SRID,PhaseID"
OnAppointmentContextMenuItemClicked
=
"RadScheduler1_AppointmentContextClick"
DataStartField
=
"StartDate"
DataEndField
=
"EndDate"
DataKeyField
=
"PhaseID"
DataSubjectField
=
"PhaseName"
DataSourceID
=
"PhasesDataSource"
AllowDelete
=
"false"
AllowEdit
=
"true"
AllowInsert
=
"false"
OnTimeSlotCreated
=
"RadScheduler1_TimeSlotCreated"
OverflowBehavior
=
"Scroll"
EnableAjaxSkinRendering
=
"true"
DayView-UserSelectable
=
"false"
WeekView-UserSelectable
=
"false"
MonthView-UserSelectable
=
"false"
GroupBy
=
"PhaseName"
GroupingDirection
=
"Vertical"
RowHeaderWidth
=
"150px"
>
<
AppointmentTemplate
>
<
b
><%# Eval("SRID") %></
b
>
</
AppointmentTemplate
>
<
AppointmentContextMenus
>
<
telerik:RadSchedulerContextMenu
runat
=
"server"
ID
=
"SchedulerAppointmentContextMenu"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Unschedule"
Value
=
"CommandEdit"
/>
</
Items
>
</
telerik:RadSchedulerContextMenu
>
</
AppointmentContextMenus
>
<
TimelineView
GroupingDirection
=
"Vertical"
NumberOfSlots
=
"7"
GroupBy
=
"PhaseName"
/>
<
ResourceHeaderTemplate
>
<
asp:Panel
runat
=
"server"
ID
=
"resoursePanel"
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text='<%# Eval("Text") %>'></
asp:Label
>
</
asp:Panel
>
</
ResourceHeaderTemplate
>
<
ResourceTypes
>
<
telerik:ResourceType
KeyField
=
"PhaseName"
Name
=
"PhaseName"
TextField
=
"PhaseName"
ForeignKeyField
=
"PhaseName"
DataSourceID
=
"AllPhases"
/>
</
ResourceTypes
>
</
telerik:RadScheduler
>
Random r =
new
Random();
protected
void
RadScheduler1_TimeSlotCreated(
object
sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e)
{
if
(e.TimeSlot.Duration.Days == 1)
{
DateTime date = e.TimeSlot.Start;
if
(date.DayOfWeek != DayOfWeek.Saturday && date.DayOfWeek != DayOfWeek.Sunday)
{
int
allocated = getAllocatedTime_Day(date,e.TimeSlot.Resource.Text);
if
(allocated <= 0)
e.TimeSlot.CssClass +=
"timeslot-empty"
;
else
if
(allocated < 25)
e.TimeSlot.CssClass +=
"timeslot-low"
;
else
if
(allocated < 45)
e.TimeSlot.CssClass +=
"timeslot-mediumlow"
;
else
if
(allocated < 65)
e.TimeSlot.CssClass +=
"timeslot-medium"
;
else
if
(allocated < 85)
e.TimeSlot.CssClass +=
"timeslot-mediumhigh"
;
else
if
(allocated <= 100)
e.TimeSlot.CssClass +=
"timeslot-high"
;
else
if
(allocated > 100)
e.TimeSlot.CssClass +=
"timeslot-overbooked"
;
else
e.TimeSlot.CssClass +=
"timeslot-empty"
;
}
}
}
private
int
getAllocatedTime_Day(DateTime time,
string
department)
{
return
r.Next(0,120);
}
<
CommandItemTemplate
>
<
table
width
=
"100%"
>
<
tr
class
=
"customFont"
>
<
td
align
=
"left"
>
<
asp:LinkButton
ID
=
"LinkButton2"
runat
=
"server"
OnClientClick
=
"openWin('/portals/0/NewSearch.aspx?AuthoringNames='); return false;"
>
<
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
src
=
"/portals/0/Images/add-icon.png"
/>New Search</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"LinkButton1"
runat
=
"server"
OnClientClick
=
"openWin2('/portals/0/NewPublicationList.aspx'); return false;"
>
<
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
src
=
"/portals/0/Images/add-icon.png"
/>Import PMID List</
asp:LinkButton
>
<
td
align
=
"left"
>
</
td
>
<
td
align
=
"right"
>
<
asp:LinkButton
ID
=
"LinkButton4"
runat
=
"server"
OnClientClick
=
"refreshGrid(); return false;"
>
<
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
src
=
"/portals/0/Images/Refresh.png"
/> Refresh</
asp:LinkButton
>
</
td
>
</
tr
>
</
table
>
</
CommandItemTemplate
>
function openWin2(url) {
var oWnd = $find("<%=RadWindow1.ClientID%>");
var authorNames = document.getElementById('<%=HiddenField1.ClientID%>').value;
oWnd.setUrl(url + "?AuthoringNames=" + authorNames);
var oWnd = radopen("/portals/0/NewSearch.aspx?AuthoringNames=" + authorNames, "RadWindow1");
}
var oWnd2 = parentRadWindowManager.open("/portals/0/QuerySaver.aspx", "RadWindow3");
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
ShowContentDuringLoad
=
"false"
VisibleStatusbar
=
"false"
Modal
=
"True"
runat
=
"server"
EnableShadow
=
"true"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"RadWindow1"
runat
=
"server"
Modal
=
"true"
Width
=
"750"
Height
=
"600"
OnClientClose
=
"OnClientClose"
Behaviors
=
"Close,Move"
ReloadOnShow
=
"true"
NavigateUrl
=
"/portals/0/NewSearch.aspx"
>
</
telerik:RadWindow
>
<
telerik:RadWindow
ID
=
"RadWindow2"
runat
=
"server"
Modal
=
"true"
Width
=
"750"
Height
=
"300"
OnClientClose
=
"OnClientClose"
Behaviors
=
"Close,Move"
ReloadOnShow
=
"true"
>
</
telerik:RadWindow
>
<
telerik:RadWindow
ID
=
"RadWindow3"
runat
=
"server"
Width
=
"650"
Height
=
"480"
Modal
=
"true"
NavigateUrl
=
"/portals/0/QuerySaver.aspx"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
<div style="margin-top: 4px; text-align: right;">
<button title="Submit" id="close" onclick="returnToParent(); return false;">
Submit</button>
</div>
into this:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.Attributes("onclick") = "return returnToParent(); return false;"
End Sub
But it takes two clicks to call the function. All help is apprecieted
<
tool
name
=
"InsertElement"
type
=
"dropdown"
showicon
=
"true"
showtext
=
"false"
>
<
item
name
=
"xref"
Value
=
"xref"
/>
<
item
name
=
"p"
Value
=
"p"
/>
</
tool
>
span.InsertElement
{
background-image: url(../Images/icoElemCut.png);
background-repeat :no-repeat;
}
.rade_toolbar
.InsertElement
also.
But i didnt get the image only. I got the drop down with image. I hace attached the image.
2. I need to assign the actual content to editor after editing some text in editor.
first time, i bind the actual text to editor. It will display correct.
then, i can edit some text and with out saving to data base, press the Reload button.
While reloading, i will assign the actual content from data base to editor.
It is assigned correctly in code behind. but editor shows with edited content.
How to refresh/update the editor while reassigning the content.
It is urgent project. Please help me.
Thanks in advance.
Uma