<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
<
ClientEvents
OnScroll
=
"ScrollGrid"
OnColumnResized
=
"ColumnResized"
OnColumnShown
=
"ColumnShown"
/>
var
isInGridScrolling =
false
;
function
ScrollGrid(sender, args) {
var
scrollTop = args.get_scrollTop();
isInGridScrolling =
true
;
$telerik.getElementByClassName(document.body,
"rsContentScrollArea"
).scrollTop = scrollTop;
isInGridScrolling =
false
;
}
function
contentPageLoad() {
$addHandler($telerik.getElementByClassName(document.body,
"rsContentScrollArea"
),
"scroll"
,
function
(e) {
if
(!isInGridScrolling) {
var
RadGrid1 = $find(
"<%= SPGrid.ClientID %>"
);
RadGrid1.GridDataDiv.scrollTop = e.target.scrollTop;
}
});
var
zChar =
new
Array(
' '
,
'('
,
')'
,
'-'
,
'.'
);
var
maxphonelength = 12;
var
phonevalue1;
var
phonevalue2;
var
cursorposition;
function
ParseForNumber1(object) {
phonevalue1 = ParseChar(object.value, zChar);
}
function
ParseForNumber2(object) {
phonevalue2 = ParseChar(object.value, zChar);
}
function
backspacerUP(object, e) {
if
(e) {
e = e
}
else
{
e = window.event
}
if
(e.which) {
var
keycode = e.which
}
else
{
var
keycode = e.keyCode
}
ParseForNumber1(object)
if
(keycode >= 48) {
ValidatePhone(object)
}
}
function
backspacerDOWN(object, e) {
if
(e) {
e = e
}
else
{
e = window.event
}
if
(e.which) {
var
keycode = e.which
}
else
{
var
keycode = e.keyCode
}
ParseForNumber2(object)
}
function
GetCursorPosition() {
var
t1 = phonevalue1;
var
t2 = phonevalue2;
var
bool =
false
for
(i = 0; i < t1.length; i++) {
if
(t1.substring(i, 1) != t2.substring(i, 1)) {
if
(!bool) {
cursorposition = i
bool =
true
}
}
}
}
function
ValidatePhone(object) {
var
p = phonevalue1
p = p.replace(/[^\d]*/gi,
""
)
if
(p.length < 3) {
object.value = p
}
else
if
(p.length == 3) {
pp = p;
d5 = p.indexOf(
'-'
)
if
(d5 == -1) {
pp = pp +
"-"
;
}
object.value = pp;
}
else
if
(p.length > 3 && p.length < 6) {
l30 = p.length;
p30 = p.substring(0, 3);
p30 = p30 +
"-"
p31 = p.substring(3, l30);
pp = p30 + p31;
object.value = pp;
}
else
if
(p.length >= 6) {
l30 = p.length;
p30 = p.substring(0, 3);
p30 = p30 +
"-"
p31 = p.substring(3, l30);
pp = p30 + p31;
l40 = pp.length;
p40 = pp.substring(0, 7);
p40 = p40 +
"-"
p41 = pp.substring(7, l40);
ppp = p40 + p41;
object.value = ppp.substring(0, maxphonelength);
}
GetCursorPosition()
if
(cursorposition >= 0) {
if
(cursorposition == 0) {
cursorposition = 2
}
else
if
(cursorposition <= 2) {
cursorposition = cursorposition + 1
}
else
if
(cursorposition <= 5) {
cursorposition = cursorposition + 2
}
else
if
(cursorposition == 6) {
cursorposition = cursorposition + 2
}
else
if
(cursorposition == 7) {
cursorposition = cursorposition + 4
e1 = object.value.indexOf(
')'
)
e2 = object.value.indexOf(
'-'
)
if
(e1 > -1 && e2 > -1) {
if
(e2 - e1 == 4) {
cursorposition = cursorposition - 1
}
}
}
else
if
(cursorposition < 11) {
cursorposition = cursorposition + 3
}
else
if
(cursorposition == 11) {
cursorposition = cursorposition + 1
}
else
if
(cursorposition >= 12) {
cursorposition = cursorposition
}
var
txtRange = object.createTextRange();
txtRange.moveStart(
"character"
, cursorposition);
txtRange.moveEnd(
"character"
, cursorposition - object.value.length);
txtRange.select();
}
}
function
ParseChar(sStr, sChar) {
if
(sChar.length ==
null
) {
zChar =
new
Array(sChar);
}
else
zChar = sChar;
for
(i = 0; i < zChar.length; i++) {
sNewStr =
""
;
var
iStart = 0;
var
iEnd = sStr.indexOf(sChar[i]);
while
(iEnd != -1) {
sNewStr += sStr.substring(iStart, iEnd);
iStart = iEnd + 1;
iEnd = sStr.indexOf(sChar[i], iStart);
}
sNewStr += sStr.substring(sStr.lastIndexOf(sChar[i]) + 1, sStr.length);
sStr = sNewStr;
}
return
sNewStr;
}
I have a textbox that is bound to an Employer class - Address class - PostalZipCode field such as this:
# Bind("Employer.Address.PostalZipCode")
It loads the data in a formview correctly. However when I edit a value and get into the View_Updating method, my e.DataItem doesn't reflect any changes I've made.
What's the correct way to go about this?
We have a project in production where we implemented a simple RadWindow and allow the iframe content to be printed.
This has worked fine for years, but since IE11 the print functionality has stopped working. I tried upgrading to the latest Telerik suite but it did not fix the issue.
Here is the snippet I am using to accomplish the printing which is almost a literal copy from the Telerik examples (which works in every IE prior to 11, Chrome, and Firefox for us)
<script type=
"text/javascript"
>
function
PrintIframeContent() {
var
oWindow = GetRadWindow();
var
content = oWindow.GetContentFrame().contentWindow;
var
printDocument = content.document;
if
(document.all) {
printDocument.execCommand(
"Print"
);
}
else
{
content.print();
}
}
function
GetRadWindow() {
var
oWindow =
null
;
if
(window.radWindow) oWindow = window.radWindow;
else
if
(window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return
oWindow;
}
function
CloseWin() {
//Get the RadWindow
var
oWindow = GetRadWindow();
//Call its Close() method
oWindow.Close();
}
</script>
I can see the code is getting executed when debugging but it does not fire an actual print command in the browser (to show the print dialogue).
If I force my IE11 browser into IE10 Document Mode then everything works as expected.
For some reason the content.print() seems to do nothing now under Edge mode. Oddly enough if I use the other function from the JavaScript printDocument.execCommand("Print") then everything works fine in IE11 Edge mode.
Can someone explain what is going on here as this has been in production and working for years until this, and I had to implement this change not knowing why this is now happening.
Also a side note, I had to force my IE11 browser into IE10 Document Mode emulation on this page also to even get the RadEditor menu items to show so I could use/see the 'Format Code Block' option.
Thank you please advise