I have a grid where I am using the EditFormsettings and a user control. The code looks like the following
<EditFormSettings UserControlName="~/TemplateUserControls/EditControls/GroupEditFormControl.ascx" EditFormType="WebUserControl">
<EditColumn UniqueName="GroupEditFormControl">
</EditColumn>
<PopUpSettings Modal="true" />
</EditFormSettings>
I have the client event set to call a javascript function to center the user control
<ClientSettings>
<ClientEvents OnRowDblClick="RowDblClick" OnPopUpShowing="onPopUpShowing" />
</ClientSettings>
And the Javascript looks like the following.
<script type="text/javascript">
function onPopUpShowing(sender, eventArgs) {
var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number') {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
popUp = eventArgs.get_popUp();
var gridWidth = myWidth;
var gridHeight = myHeight;
var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
popUp.style.left = ((gridWidth - popUpWidth) / 2) + "px";
popUp.style.top = ((gridHeight - popUpHeight) / 2) + "px";
}
</script>
The problem is no matter that values go into the Popup.style.left and popup.style.top values, the usercontrol is always in the same location. I have confirmed that the Javascript is being called by putting a few "alert" calls
For a quick test, I hard coded the top and left values (See below) to see if the user control would be at the top part of the screen
popUp.style.left = "10px";
popUp.style.top = "10px";
And the usercontrol's position did not move.
How can I center the usercontrol when using the editform function under the grid?
We are not able to exporting the radeditor data along with images and text and tables formats.
I am using below code.
protected void Button1_Click(object sender, EventArgs e)
{
try
{
ResponseDocument.ExportToDocx();
}
catch (Exception ex)
{
LogHelper.LogEvent(ex, this.Request.Url.LocalPath);
}
}
while exporting the data it's throwing error like
"The Document Processing Library fails to export the RadFlowDocument in Docx".
Please help.
Hi,
Is there an example available of how to validate the raddropdowntree in combination with AutoPostback = true?
TIA, Marc
I have a problem displaying appointments in the first row. They add to the database but disapear on the UI.
Here is the code for my rad Scheduler
<telerik:RadScheduler ID="AttendanceScheduler" runat="server" Skin="Office2007"
Width="100%" Height="100%"
StartEditingInAdvancedForm="true" SelectedView="TimelineView"
DisplayDeleteConfirmation="true" DayStartTime="08:00:00" DayEndTime="18:00:00"
TimeZoneOffset="0:00:00" HoursPanelTimeFormat="h:mm tt" NumberOfHoveredRows="1"
ShowHeader="false" ShowAllDayRow="false" ShowFullTime="false" ShowNavigationPane="false"
GroupBy="DayOfWeek" EnableResourceEditing="true" CustomAttributeNames=""
EnableCustomAttributeEditing="false" VisibleAppointmentsPerDay="1"
OnClientRequestSuccess="requestSuccess"
OnClientRequestFailed="requestFailed" OnClientAppointmentsPopulating="AttendancePopulating"
OnClientAppointmentsPopulated="AttendancePopulated"
OnClientTimeSlotClick="OnClientTimeSlotClick" OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick"
OnClientAppointmentInserting="AttendanceInserting" OnClientAppointmentCreated="AttendanceCreated"
OnClientAppointmentEditing="AttendanceEditing"
OnClientAppointmentMoveEnd="OnAttendanceMoveEnd"
OnClientAppointmentResizeEnd="OnAttendanceResizeEnd">
<MonthView UserSelectable="false" />
<TimelineView ColumnHeaderDateFormat="hh:mm tt" HeaderDateFormat="hh:mm tt" NumberOfSlots="48"
SlotDuration="00:15:00" GroupBy="DayOfWeek" TimeLabelSpan="1" StartTime="08:00" GroupingDirection="Vertical"
UserSelectable="false" />
<DayView UserSelectable="false" />
<WeekView UserSelectable="false" />
<WebServiceSettings Path="ClientAttendanceTemplateService.svc" ResourcePopulationMode="Manual"
GetResourcesMethod="GetClientAttendanceResources" GetAppointmentsMethod="GetClientAttendances"
InsertAppointmentMethod="InsertClientAttendance" UpdateAppointmentMethod="UpdateClientAttendance"
DeleteAppointmentMethod="DeleteClientAttendance" CreateRecurrenceExceptionMethod="CreateClientAttendanceRecurrenceException"
RemoveRecurrenceExceptionsMethod="RemoveClientAttendanceRecurrenceExceptions" />
<Localization ConfirmDeleteText="Are you sure you want to delete this Attendance?"
ConfirmDeleteTitle="Confirm Attendance Delete" />
</telerik:RadScheduler>
I am adding the resources in the backend using code below
private IEnumerable<Resource> GetResources()
{
List<Resource> resources = new List<Resource>();
for (int i = 0; i < 7; i++)
{
string dayOfWeek = GetDayOfWeek(i);
Resource res = new Resource("DayOfWeek", i, dayOfWeek);
resources.Add(res);
}
return resources;
}
private string GetDayOfWeek(int dow)
{
string dayOfWeek = "";
switch (dow)
{
case 1:
dayOfWeek = "Monday";
break;
case 2:
dayOfWeek = "Tuesday";
break;
case 3:
dayOfWeek = "Wednesday";
break;
case 4:
dayOfWeek = "Thursday";
break;
case 5:
dayOfWeek = "Friday";
break;
case 6:
dayOfWeek = "Saturday";
break;
case 0:
dayOfWeek = "Sunday";
break;
}
return dayOfWeek;
}
Only the first row of the scheduler doesn't show the added appointment!
Hi,
Wondering if you could help. I'm struggling to get a value from a ComboBox. I have the following ComboBox set up:
<
sq8:ComboBox
runat
=
"server"
ID
=
"cboAgree"
OnClientSelectedIndexChanged
=
"onSelectedIndexChanged"
><
Items
>
<
sq8:ComboBoxItem
runat
=
"server"
Text
=
"Agree"
Value
=
"Agree"
></
sq8:ComboBoxItem
>
<
sq8:ComboBoxItem
runat
=
"server"
Text
=
"Disagree"
Value
=
"Disagree"
></
sq8:ComboBoxItem
>
</
Items
>
</
sq8:ComboBox
>
<
sq:BindableControl
runat
=
"server"
TargetControlID
=
"cboAgree"
DataField
=
"Agreement"
></
sq:BindableControl
>
And the following JavaScript to get the value:
<
script
type
=
"text/javascript"
>
Sys.Application.add_load(FormLoad)
function FormLoad()
{
onSelectedIndexChanged(true);
}
function onSelectedIndexChanged(sender, eventArgs)
{
var commentsGrid = document.getElementById("comms");
commentsGrid.style.display = "none";
var item = eventArgs.get_item();
if (item == "Disagree") {
commentsGrid.style.display = "block";
} else {
commentsGrid.style.display = "none";
}
}
</
script
>
I get back the following error - "Uncaught TypeError: Cannot read property 'get_item' of undefined"
I have looked at the threads about getting ComboBox values on this forum but just can't seem to get this working.
When the value "Disagree" is selected from the combobox (id of the ComboBox is cboAgree) i want the grid to show. And when Agree is selected, i want the grid to disappear.
Could anyone steer me in the right direction? Thanks!