or
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"sm1"
>
</
telerik:RadScriptManager
>
<
telerik:RadTextBox
ID
=
"itemcount"
Label
=
"ItemCount"
runat
=
"server"
></
telerik:RadTextBox
>
<
asp:Button
runat
=
"server"
OnClick
=
"OnClick"
Text
=
"Reload"
/>
<
telerik:RadGrid
ID
=
"grid"
runat
=
"server"
Width
=
"990px"
EnableLinqExpressions
=
"False"
CellSpacing
=
"0"
DataSourceID
=
"ObjectDataSource2"
GridLines
=
"None"
OnPreRender
=
"grid_OnPreRender"
AllowMultiRowEdit
=
"True"
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"ObjectDataSource2"
AllowSorting
=
"True"
EditMode
=
"InPlace"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridNumericColumn
DataField
=
"Value1"
FilterControlAltText
=
"Filter Value1 column"
HeaderText
=
"Value1"
SortExpression
=
"Value1"
UniqueName
=
"Value1"
runat
=
"server"
>
</
telerik:GridNumericColumn
>
<
telerik:GridNumericColumn
DataField
=
"Value2"
FilterControlAltText
=
"Filter Value2 column"
HeaderText
=
"Value2"
SortExpression
=
"Value2"
UniqueName
=
"Value2"
runat
=
"server"
>
</
telerik:GridNumericColumn
>
<
telerik:GridNumericColumn
DataField
=
"Value3"
FilterControlAltText
=
"Filter Value2 column"
HeaderText
=
"Value3"
SortExpression
=
"Value3"
UniqueName
=
"Value3"
runat
=
"server"
>
</
telerik:GridNumericColumn
>
<
telerik:GridNumericColumn
DataField
=
"Value4"
FilterControlAltText
=
"Filter Value2 column"
HeaderText
=
"Value4"
SortExpression
=
"Value4"
UniqueName
=
"Value4"
runat
=
"server"
>
</
telerik:GridNumericColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:ObjectDataSource
ID
=
"ObjectDataSource2"
runat
=
"server"
SelectMethod
=
"GetObjects"
TypeName
=
"SimpleObjectProvider"
>
<
SelectParameters
>
<
asp:ControlParameter
runat
=
"server"
ControlID
=
"itemcount"
Type
=
"Int32"
Name
=
"itemcount"
/>
</
SelectParameters
>
</
asp:ObjectDataSource
>
protected
void
grid_OnPreRender(
object
sender, EventArgs e)
{
foreach
(GridItem item
in
grid.Items)
{
item.Edit =
true
;
}
grid.Rebind();
}
protected
void
OnClick(
object
sender, EventArgs e)
{
grid.Rebind();
}
public
class
SimpleObjectProvider
{
public
int
itemcount = 100;
/// <summary>
/// Initializes a new instance of the <see cref="SimpleObjectProvider"/> class.
/// </summary>
public
SimpleObjectProvider()
{
}
/// <summary>
/// Simple Select Method
/// </summary>
/// <returns>List of Objects</returns>
public
List<SimpleObject> GetObjects(
int
itemcount)
{
var simpleObjects =
new
List<SimpleObject>();
for
(
int
i = 1; i <= itemcount; i++)
{
simpleObjects.Add(
new
SimpleObject(i, i * i, 1m / i, 1.4m * i));
}
return
simpleObjects;
}
}
/// <summary>
/// A simple object
/// </summary>
public
class
SimpleObject
{
public
SimpleObject(
decimal
value1,
decimal
value2,
decimal
value3,
decimal
value4)
{
Value1 = value1;
Value2 = value2;
Value3 = value3;
Value4 = value4;
}
public
decimal
Value4 {
get
;
set
; }
public
decimal
Value3 {
get
;
set
; }
public
decimal
Value1 {
get
;
set
; }
public
decimal
Value2 {
get
;
set
; }
}
Hi,
I am trying to implement the load on demand functionality in Org Chart control.
From what I understand from the link1 and link2 is that the whole data (including the data which has already been rendered) needs to be rebound to the control each time a node is expanded. Please correct me if my understanding is wrong. If not, is it possible to implement it in such a way that if a node is expanded, only the children of that node needs to be fetched and bound to the control.
My primary objective is to bind a huge data set to the orgchart control without affecting the performance.
Thanks!
<
div
class
=
"photocontainer"
><
span
class
=
"message"
>
<
ecadis:EcadisLabel
ID
=
"lblLeftPhotoView"
LabelId
=
"text.leftPhotoView"
runat
=
"server"
/>
<
ecadis:EcadisLabel
runat
=
"server"
ID
=
"lblLeftPhotoViewRequired"
LabelId
=
"text.requiredStar"
Visible
=
"False"
CssClass
=
"error"
/></
span
>
<
telerik:RadBinaryImage
runat
=
"server"
Width
=
"175px"
Height
=
"120px"
ResizeMode
=
"Crop"
ID
=
"leftViewPhoto"
SavedImageName
=
"linkerflank.png"
ImageUrl
=
"/images/linkerflank.png"
/>
<
span
class
=
"invalidLeftPhoto"
></
span
>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"leftPhotoViewAsyncUpload"
MaxFileInputsCount
=
"1"
MaxFileSize
=
"2411724"
OnClientFileUploaded
=
"onLeftPhotoUploaded"
OnFileUploaded
=
"LeftViewPhotoFileUploaded"
AllowedFileExtensions
=
"jpeg,jpg,gif,png,bmp"
OnClientValidationFailed
=
"onLeftPhotoValidationFailed"
>
</
telerik:RadAsyncUpload
>
<
telerik:RadButton
runat
=
"server"
ID
=
"btnResetLeftPhotoView"
AutoPostBack
=
"false"
OnClientClicked
=
"leftViewPhotoClearImage"
>
</
telerik:RadButton
>
</
div
>
<
div
class
=
"photocontainer"
><
span
class
=
"message"
>
<
ecadis:EcadisLabel
ID
=
"lblRightPhotoView"
LabelId
=
"text.rightPhotoView"
runat
=
"server"
/><
ecadis:EcadisLabel
runat
=
"server"
ID
=
"lblRightPhotoViewRequired"
LabelId
=
"text.requiredStar"
Visible
=
"False"
CssClass
=
"error"
/></
span
>
<
telerik:RadBinaryImage
runat
=
"server"
Width
=
"175px"
Height
=
"120px"
ResizeMode
=
"Crop"
ID
=
"rightViewPhoto"
SavedImageName
=
"rechterflank.png"
ImageUrl
=
"/images/rechterflank.png"
/>
<
span
class
=
"invalidRightPhoto"
></
span
>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"rightPhotoViewAsyncUpload"
MaxFileInputsCount
=
"1"
MaxFileSize
=
"2411724"
OnClientFileUploaded
=
"onRightPhotoUploaded"
OnFileUploaded
=
"RightViewPhotoFileUploaded"
AllowedFileExtensions
=
"jpeg,jpg,gif,png,bmp"
OnClientValidationFailed
=
"onRightPhotoValidationFailed"
>
</
telerik:RadAsyncUpload
>
<
telerik:RadButton
runat
=
"server"
ID
=
"btnResetRightViewPhoto"
AutoPostBack
=
"False"
OnClientClicked
=
"rightViewPhotoClearImage"
/>
</
div
>
</
div
>
<
div
class
=
"dragAndDrop WP100"
>
<
div
class
=
"photocontainer"
><
span
class
=
"message"
>
<
ecadis:EcadisLabel
runat
=
"server"
ID
=
"lblFrontalPhotoView"
LabelId
=
"text.frontalPhotoView"
/><
ecadis:EcadisLabel
runat
=
"server"
ID
=
"lblFrontalPhotoViewRequired"
LabelId
=
"text.requiredStar"
Visible
=
"False"
CssClass
=
"error"
/></
span
>
<
telerik:RadBinaryImage
runat
=
"server"
Width
=
"175px"
Height
=
"120px"
ResizeMode
=
"Crop"
ID
=
"frontalViewPhoto"
SavedImageName
=
"frontaal.png"
ImageUrl
=
"/images/frontaal.png"
/>
<
span
class
=
"invalidFrontal"
></
span
>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"frontaalPhotoViewAsyncUpload"
MaxFileInputsCount
=
"1"
MaxFileSize
=
"2411724"
OnClientFileUploaded
=
"onFrontalPhotoUploaded"
OnFileUploaded
=
"FrontaalPhotoFileUploaded"
AllowedFileExtensions
=
"jpeg,jpg,gif,png,bmp"
OnClientValidationFailed
=
"onFrontalPhotoValidationFailed"
>
</
telerik:RadAsyncUpload
>
<
telerik:RadButton
runat
=
"server"
ID
=
"btnResetFrontaalViewPhoto"
AutoPostBack
=
"False"
OnClientClicked
=
"frontaalViewPhotoClearImage"
></
telerik:RadButton
>
</
div
>
<
div
class
=
"photocontainer"
><
span
class
=
"message"
><
ecadis:EcadisLabel
ID
=
"EcadisLabel5"
LabelId
=
"text.backPhotoView"
runat
=
"server"
/><
ecadis:EcadisLabel
runat
=
"server"
ID
=
"lblBackPhotoViewRequired"
LabelId
=
"text.requiredStar"
Visible
=
"False"
CssClass
=
"error"
/></
span
>
<
telerik:RadBinaryImage
runat
=
"server"
Width
=
"175px"
Height
=
"120px"
ResizeMode
=
"Crop"
ID
=
"backViewPhoto"
SavedImageName
=
"achteraan.png"
ImageUrl
=
"/images/achteraan.png"
/>
<
span
class
=
"invalidBack"
></
span
>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"backPhotoViewAsyncUpload"
MaxFileInputsCount
=
"1"
OnClientFileUploaded
=
"onBackPhotoUploaded"
OnFileUploaded
=
"BackPhotoFileUploaded"
AllowedFileExtensions
=
"jpeg,jpg,gif,png,bmp"
OnClientValidationFailed
=
"onBackPhotoValidationFailed"
MaxFileSize
=
"2411724"
>
</
telerik:RadAsyncUpload
>
<
telerik:RadButton
runat
=
"server"
ID
=
"btnResetBackViewPhoto"
AutoPostBack
=
"False"
OnClientClicked
=
"backViewPhotoClearImage"
></
telerik:RadButton
>
</
div
>
</
div
>
<
div
class
=
"dragAndDrop WP100"
>
<
div
class
=
"photocontainer"
><
span
class
=
"message"
><
ecadis:EcadisLabel
ID
=
"EcadisLabel6"
LabelId
=
"text.intFrontPhotoView"
runat
=
"server"
/><
ecadis:EcadisLabel
runat
=
"server"
ID
=
"lblIntFrontPhotoRequired"
LabelId
=
"text.requiredStar"
Visible
=
"False"
CssClass
=
"error"
/></
span
>
<
telerik:RadBinaryImage
runat
=
"server"
Width
=
"175px"
Height
=
"120px"
ResizeMode
=
"Crop"
ID
=
"interiourFrontViewPhoto"
SavedImageName
=
"interieur_vooraan.png"
ImageUrl
=
"/images/interieur_vooraan.png"
/>
<
span
class
=
"invalidIntFront"
></
span
>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"interiourFrontViewAsyncUpload"
MaxFileInputsCount
=
"1"
OnClientFileUploaded
=
"onIntFrontPhotoUploaded"
OnFileUploaded
=
"InteriourFrontPhotoFileUploaded"
AllowedFileExtensions
=
"jpeg,jpg,gif,png,bmp"
OnClientValidationFailed
=
"onIntFrontPhotoValidationFailed"
MaxFileSize
=
"2411724"
></
telerik:RadAsyncUpload
>
<
telerik:RadButton
runat
=
"server"
ID
=
"btnResetInteriourFrontViewPhoto"
AutoPostBack
=
"False"
OnClientClicked
=
"interiourFrontViewPhotoClearImage"
></
telerik:RadButton
>
</
div
>
function onLeftPhotoUploaded(sender, args) {
$find("<%=radAjaxManager.ClientID %>").ajaxRequest();
$telerik.$(".invalidLeftPhoto").html("");
$telerik.$("#lblLeftPhotoViewRequired").html("");
setTimeout(function () {
sender.deleteFileInputAt(0);
}, 10);
}
function onLeftPhotoValidationFailed(sender, args) {
$telerik.$('.invalidLeftPhoto').html('<%= MasterController.GetLabelValue("text.fileTooBig") %>').addClass("error");
sender.deleteFileInputAt(0);
}
function onRightPhotoUploaded(sender, args) {
$find("<%=radAjaxManager.ClientID %>").ajaxRequest();
$telerik.$(".invalidRightPhoto").html("");
$telerik.$("#lblRightPhotoViewRequired").html("");
setTimeout(function () {
console.log(sender._uploadedFiles.length);
sender.deleteFileInputAt(0);
}, 10);
}
function onRightPhotoValidationFailed(sender, args) {
$telerik.$('.invalidRightPhoto').html('<%= MasterController.GetLabelValue("text.fileTooBig") %>').addClass("error");
sender.deleteFileInputAt(0);
}
protected void LeftViewPhotoFileUploaded(object sender, FileUploadedEventArgs e)
{
string path = Path.Combine(ConfigurationManager.AppSettings["SaveLocation"], PartnerId.ToString(), CarId.ToString(), ConfigurationManager.AppSettings["GeneralPictureLocation"]);
e.File.SaveAs(Path.Combine(path, "linkerflank.png"));
byte[] array = CreateThumbnail(path, "linkerflank.png");
leftViewPhoto.DataValue = array;
}
protected void RightViewPhotoFileUploaded(object sender, FileUploadedEventArgs e)
{
string path = Path.Combine(ConfigurationManager.AppSettings["SaveLocation"], PartnerId.ToString(), CarId.ToString(), ConfigurationManager.AppSettings["GeneralPictureLocation"]);
e.File.SaveAs(Path.Combine(path, "rechterflank.png"));
byte[] array = CreateThumbnail(path, "rechterflank.png");
rightViewPhoto.DataValue = array;
}
<
telerik:GridTemplateColumn
DataField
=
"Data"
HeaderText
=
"Imagen"
UniqueName
=
"Upload"
>
<
ItemTemplate
>
<
a
class
=
"FotoGrid"
href
=
"#"
onclick
=
"VerImagen($(this))"
>
<
telerik:RadBinaryImage
ID
=
"RadBinaryImage2"
runat
=
"server"
AlternateText='<%#Eval("Contenido", "Photo of {0}") %>'
AutoAdjustImageControlSize="false" DataValue='<%#Eval("Contenido") is DBNull ? null : Eval("Contenido")%>'
Height="80px" ToolTip='<%#Eval("Contenido", "Photo of {0}") %>' Width="80px" />
</
a
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadAsyncUpload
ID
=
"FotoActualizar"
runat
=
"server"
AllowedFileExtensions
=
"jpg,jpeg,pdf"
MaxFileInputsCount
=
"1"
MaxFileSize
=
"1048576"
ToolTip
=
"Actualizar Archivo"
>
<
Localization
Cancel
=
"Cancelar"
Remove
=
"Quitar"
Select
=
"Archivo"
/>
</
telerik:RadAsyncUpload
>
<
asp:CustomValidator
runat
=
"server"
ID
=
"cvUploadFotoMaterial"
ClientValidationFunction
=
"validateUploadFoto"
ErrorMessage
=
"Fotografia es requerido"
ForeColor
=
"Red"
ValidationGroup
=
"vgGridFotos"
>*</
asp:CustomValidator
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>