Hi,
I have extracted the xml for radorgchart. Within this I have some rendered fields
When I attempt to use this xml to rebind another orgchart,
within the databinding event I’d like to display the text of one rendered field
within a label control.
I’m nearly there; I can see the rendered fields for a particular
node:
node.GroupItems[0].RenderedFields
Hi,
When the editor is in Div-mode and set to Auto Resize height, then you can't set focus by clicking on the lower part of the editor.
Do the following in the online-demo:
http://demos.telerik.com/aspnet-ajax/editor/examples/contentareamodediv/defaultcs.aspx
When this is done, you can only set focus by clicking in the top region of the editor!
Regards
Andreas
I can see that he OnClientLoad is not fired when Enabled="false" is set, if I change this to true its working like a charm, is this by design?
seems weird as the control should have a load event on the client either way, problem is i need to declare the editor as a variable to set the enabled state manually with JS.
var
_editor;
function
edtRotator_onClientLoad(editor, args) {
_editor = editor;
}
$(
".rotator-images"
).dblclick(
function
() {
_editor.enableEditing(
true
);
_editor.set_editable(
true
);
});
Been battling this error for a full day for a fully programmatically created RadGrid. Looked through so many posts that concentrate on making sure the RadGrid is created at the correct point in the page lifecycle, making sure columns and groups and created in the correct order etc etc.
I was seeing the error on entering a context header menu after the grid data had been modified at least once.
The fix.... make sure the RadGrid.ID property is set!
Hope this saves somebody else a full day of head scratching!
Hi,
I have a TabStrip inside a Template Column in a Grid. I need to count how many times one of the tabs has been clicked.
How do I attach an event to do that please?
Cheers,
Jack
Hello Anyone,
I am using the code in this link to implement ExportToExcel - http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/excel-export/defaultcs.aspx
This doesn't exports excel file in IE 11 browser. The site is also configured with https://. When i use https://, the exportToExcel works fine.
How do i handle the code to work with http://. Is there any property that i might not be setting? Or some other code that i must include for it to work? Or could it be some underlying data issue that might be causing problem?
Please suggest
thanks
Hi,
I have set up a small testpage to show my problem: When i Click on [Generate wizardsteps] the steps are created and [Next step] is working. When I click the [Generate wizardsteps] button again the steps are re-created, but I have to hit a [Next step] button twice in order to go to a next step. What could cause this behavior?
Here is my page code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test2.aspx.vb" Inherits="test2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
<telerik:RadButton RenderMode="Lightweight" runat="server" ID="RadButton1" Text="Generate wizardsteps" OnClick="RadButton1_Click"></telerik:RadButton>
<telerik:RadWizard DisplayNavigationButtons="false" OnWizardStepCreated="RadWizard1_WizardStepCreated" RenderMode="Lightweight" runat="server" ID="RadWizard1" Height="360px">
</telerik:RadWizard>
</div>
</form>
</body>
</html>
and this is the code-behind:
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
Partial Public Class test2
Inherits System.Web.UI.Page
Protected Sub RadButton1_Click(sender As Object, e As EventArgs)
RadWizard1.WizardSteps.Clear()
For i As Integer = 0 To 4
Dim [step] As New RadWizardStep()
[step].ID = "Step " + (i + 1).ToString()
RadWizard1.WizardSteps.Add([step])
Next
Dim completeStep As New RadWizardStep()
completeStep.ID = "Complete"
RadWizard1.WizardSteps.Add(completeStep)
RadWizard1.ActiveStepIndex = RadWizard1.WizardSteps(0).Index
End Sub
Protected Sub RadWizard1_WizardStepCreated(sender As Object, e As WizardStepCreatedEventArgs)
Dim lc As New RadButton()
lc.Text = "Next step"
AddHandler lc.Command, AddressOf RadButton2_Click
e.RadWizardStep.Controls.Add(lc)
End Sub
Protected Sub RadButton2_Click(sender As Object, e As EventArgs)
Dim [step] As RadWizardStep = DirectCast(DirectCast(sender, RadButton).Parent, RadWizardStep)
RadWizard1.ActiveStepIndex = RadWizard1.WizardSteps([step].Index).Index + 1
End Sub
End Class
I really hope you can find something.
This is an excerpt from an important project.
Thanks, Marc
Hi i used your example http://demos.telerik.com/aspnet-ajax/asyncupload/examples/persistuploadedfiles/defaultvb.aspx?show-source=true
I modified it a bit to be more simple:
TestUpload.aspx
001.
<%@ Page Language="vb" CodeFile="TestUpload.aspx.vb" AutoEventWireup="true" Inherits="TestUpload" %>
002.
003.
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
004.
005.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
006.
<
html
xmlns
=
'http://www.w3.org/1999/xhtml'
>
007.
<
head
runat
=
"server"
>
008.
<
title
>Telerik ASP.NET Example</
title
>
009.
<
style
type
=
"text/css"
>
010.
/** Customize the demo canvas */
011.
#example .demo-container {
012.
padding: 28px 0;
013.
width: 882px;
014.
height: 330px;
015.
background: transparent url("Images/background.png") top left no-repeat;
016.
position: relative;
017.
}
018.
019.
#example .demo-container h2 {
020.
margin: 0 -30px 15px;
021.
padding: 25px 30px 0;
022.
color: #ffffff;
023.
background: #4ba2d1;
024.
font-size: 36px;
025.
line-height: 1;
026.
}
027.
028.
.demo-container h2 sup {
029.
font-size: 14px;
030.
line-height: 1;
031.
}
032.
033.
034.
.demo-container .qsf-fb {
035.
padding: 30px;
036.
width: 327px;
037.
overflow: hidden;
038.
}
039.
040.
.demo-container .qsf-fb ul {
041.
margin: 0;
042.
padding: 0;
043.
list-style-type: none;
044.
}
045.
046.
.demo-container .qsf-fb label {
047.
width: auto;
048.
display: block;
049.
}
050.
051.
.demo-container .qsf-fb .buttons {
052.
margin-top: 13px;
053.
}
054.
055.
056.
.demo-container .preview {
057.
width: 495px;
058.
height: 331px;
059.
position: absolute;
060.
top: 28px;
061.
left: 387px;
062.
}
063.
064.
/* Customize uploaded file name */
065.
html .RadUpload .ruUploadProgress {
066.
display: inline-block;
067.
max-width: 200px;
068.
overflow: hidden;
069.
text-overflow: ellipsis;
070.
white-space: nowrap;
071.
vertical-align: top;
072.
}
073.
074.
html div.photo-upload {
075.
font-size: 12px;
076.
}
077.
</
style
>
078.
</
head
>
079.
080.
<
body
>
081.
<
form
id
=
"form1"
runat
=
"server"
>
082.
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
083.
<
Scripts
>
084.
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
085.
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
086.
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
087.
</
Scripts
>
088.
</
telerik:RadScriptManager
>
089.
<
telerik:RadSkinManager
ID
=
"RadSkinManager1"
runat
=
"server"
ShowChooser
=
"true"
/>
090.
<
telerik:RadFormDecorator
RenderMode
=
"Lightweight"
runat
=
"server"
DecoratedControls
=
"Buttons, TextBox"
/>
091.
092.
<
div
class
=
"demo-container no-bg"
>
093.
<
div
class
=
"qsf-demo-canvas"
id
=
"qsfexWrapper"
>
094.
<
div
class
=
"qsf-fb"
>
095.
<
h2
>Dream Holiday <
sup
>Contest</
sup
></
h2
>
096.
<
ul
>
097.
<
li
>
098.
<
label
>Upload a photo of your dream holiday:</
label
>
099.
<
telerik:RadAsyncUpload
RenderMode
=
"Lightweight"
CssClass
=
"photo-upload"
runat
=
"server"
ID
=
"RadAsyncUpload1"
OnClientFileUploaded
=
"onClientFileUploaded"
PostbackTriggers
=
"RadButton1"
100.
MaxFileInputsCount
=
"1"
AllowedFileExtensions
=
".jpg"
Skin
=
"Outlook"
/>
101.
</
li
>
102.
</
ul
>
103.
104.
<
p
class
=
"buttons"
>
105.
<
asp:Button
runat
=
"server"
ID
=
"RadButton1"
Text
=
"Submit your picture and information"
OnClientClick
=
"updatePictureAndInfo(); return false;"
/>
106.
</
p
>
107.
</
div
>
108.
109.
<
telerik:RadBinaryImage
runat
=
"server"
ID
=
"RadBinaryImage1"
ImageUrl
=
"images/blank.png"
110.
Width
=
"495"
Height
=
"331"
ResizeMode
=
"Fit"
AlternateText
=
"No picture available"
111.
CssClass
=
"preview"
></
telerik:RadBinaryImage
>
112.
</
div
>
113.
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
114.
<
script
type
=
"text/javascript"
>
115.
//
<![CDATA[
116.
Sys.Application.add_load(function () {
117.
window.upload = $(".RadAsyncUpload");
118.
window.button = $("#RadButton1");
119.
demo.initialize();
120.
});
121.
122.
123.
//]]>
124.
</
script
>
125.
</
telerik:RadScriptBlock
>
126.
<
script
type
=
"text/javascript"
>
127.
(function () {
128.
var $;
129.
var upload;
130.
var button;
131.
var demo = window.demo = window.demo || {};
132.
133.
demo.initialize = function () {
134.
$ = $telerik.$;
135.
button = window.button;
136.
upload = window.upload;
137.
};
138.
139.
window.onClientFileUploaded = function (sender, args) {
140.
button.removeAttr('disabled');
141.
};
142.
143.
window.updatePictureAndInfo = function () {
144.
var uploadedRows = upload.find(".ruUploadSuccess");
145.
if (uploadedRows.length > 0) {
146.
alert('postback');
147.
__doPostBack('RadButton1', 'RadButton1Args');
148.
}
149.
else {
150.
alert("Please select a picture/country");
151.
}
152.
};
153.
154.
155.
})();
156.
</
script
>
157.
</
div
>
158.
159.
</
form
>
160.
</
body
>
161.
</
html
>
And the VB.net code
01.
Imports
System
02.
Imports
System.Drawing
03.
04.
Partial
Class
TestUpload
05.
Inherits
System.Web.UI.Page
06.
07.
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Handles
Me
.Load
08.
09.
If
(
Not
IsPostBack)
Then
10.
RadButton1.Enabled =
False
11.
Else
12.
13.
RadButton1.Enabled =
True
14.
End
If
15.
16.
End
Sub
17.
18.
Protected
Sub
FileUploaded()
Handles
RadAsyncUpload1.FileUploaded
19.
20.
Dim
bitmapImage
As
Bitmap = ResizeImage(RadAsyncUpload1.UploadedFiles(0).InputStream)
21.
Dim
stream
As
System.IO.MemoryStream =
New
System.IO.MemoryStream()
22.
bitmapImage.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp)
23.
RadBinaryImage1.DataValue = stream.ToArray()
24.
25.
End
Sub
26.
27.
Protected
Sub
RadButton1_Click()
Handles
RadButton1.Click
28.
29.
30.
End
Sub
31.
32.
Public
Function
ResizeImage(
ByVal
stream
As
IO.Stream)
As
Bitmap
33.
Dim
originalImage
As
System.Drawing.Image = Bitmap.FromStream(stream)
34.
35.
Dim
height
As
Integer
= 331
36.
Dim
width
As
Integer
= 495
37.
38.
Dim
scaledImage
As
New
Bitmap(width, height)
39.
40.
Using g
As
Graphics = Graphics.FromImage(scaledImage)
41.
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
42.
g.DrawImage(originalImage, 0, 0, width, height)
43.
Return
scaledImage
44.
End
Using
45.
46.
End
Function
47.
48.
End
Class
On line 99 of the aspx file you can see that the postbacktrigger is set to RadButton1. RadButton1 fires updatePictureAndInfo (line 143) I added a alert('postback') just before the __doPostBack() but this is never triggered.
Now in the VB file. If i were to change RadButton1.enabled = False to Radbutton1.enabled = True (line 10). Then press the button after uploading a JPG image the postback alert is fired but I get a server error:
Invalid postback or callback argument. Event validation is enabled using <
pages
enableEventValidation
=
"true"
/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Any help? I need the function updatePictureAndInfo() to fire even when the submit button initially would be disabled.
Thanks