or
grid.add_rowCreated(
function
(sender, args)
{
var
item = args.get_item();
if
(Edge.UI.GridExtensions.isNewRow(item))
Edge.UI.GridExtensions.setCellValue(item, uniqueName, Edge.UI.GridExtensions.SerialColumn.getMaxSerialValue(tableView, uniqueName) + 1);
});
Edge.UI.GridExtensions.SerialColumn.getMaxSerialValue =
function
(tableView, uniqueName)
{
var
max = Number.NEGATIVE_INFINITY,
dataItems = tableView.get_dataItems();
if
(dataItems && dataItems.length)
{
for
(
var
i = dataItems.length; i--;)
{
var
value = parseInt(Edge.UI.GridExtensions.getCellValue(dataItems[i], uniqueName));
if
(value > max)
max = value;
}
}
return
max === Number.NEGATIVE_INFINITY ? 0 : max;
}
p._owner.raise_rowCreated(
new
Telerik.Web.UI.GridDataItemEventArgs(n,
null
));
Array.insert(e, k, d);
if
(
this
._dataItems.length > 0 || (
this
._cachedItems &&
this
._cachedItems.length > 0)) {
return
this
._dataItems;
}
var
o = ($telerik.isOpera) ?
this
.get_element() :
this
.get_element().tBodies[0];
var
n = o.rows;
for
(
var
c = 0, k = n.length;
c < k;
c++) {
…
this
._owner.raise_rowCreating(
new
Sys.EventArgs());
…
if
(!b) {
b = $create(Telerik.Web.UI.GridDataItem, {_owner:
this
,_data: a},
null
,
null
, m);
}
…
this
._dataItems[
this
._dataItems.length] = b;
this
._owner.raise_rowCreated(
new
Telerik.Web.UI.GridDataItemEventArgs(m,
null
));
}
After this, the grid stops working. When I try adding new lines, an exception erupts. I don't know certainly the cause, but it should be because of the orphan item.
After the description of the problem, I'd like to say that some accessors in the Rad controls code involve a lot of work which shouldn't be the nature of accessors. I have some places where get_dataItems raises exceptions, and I had no means to avoid but a nasty dummy try/catch
try
{
gridDataItems =
this
.tableView.get_dataItems();
}
catch
(dummy)
{ }
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TreeListStringKey.aspx.cs" Inherits="LiveExamples_Services_Audit_TreeListStringKey" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
rei:REIRadScriptManager
ID
=
"REIRadScriptManager1"
runat
=
"server"
ScriptMode
=
"Release"
LoadScriptsBeforeUI
=
"true"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
</
Scripts
>
</
rei:REIRadScriptManager
>
<
div
>
<
telerik:RadTreeList
ID
=
"tree"
runat
=
"server"
OnNeedDataSource
=
"Tree_NeedDataSource"
ParentDataKeyNames
=
"RealParentId"
DataKeyNames
=
"RealId"
AllowPaging
=
"true"
PageSize
=
"1000"
AutoGenerateColumns
=
"false"
AllowSorting
=
"true"
EnableEmbeddedSkins
=
"false"
Skin
=
"EHB"
>
<
Columns
>
<
telerik:TreeListBoundColumn
UniqueName
=
"SectionName"
DataField
=
"SectionName"
HeaderText
=
"Section"
/>
<
telerik:TreeListBoundColumn
UniqueName
=
"ActionTaken"
DataField
=
"ActionTaken"
HeaderText
=
"Action"
/>
<
telerik:TreeListTemplateColumn
UniqueName
=
"ModifiedDate"
HeaderText
=
"Modified Date"
>
<
ItemTemplate
>
<%# (DateTime)Eval("ModifiedDate") == DateTime.MinValue ? "" : Eval("ModifiedDate") %>
</
ItemTemplate
>
</
telerik:TreeListTemplateColumn
>
<
telerik:TreeListBoundColumn
UniqueName
=
"ModifiedBy"
DataField
=
"ModifiedBy"
HeaderText
=
"Modified By"
/>
<
telerik:TreeListBoundColumn
UniqueName
=
"Value"
DataField
=
"Value"
HeaderText
=
"Value"
HeaderStyle-Width
=
"45%"
/>
</
Columns
>
</
telerik:RadTreeList
>
</
div
>
</
form
>
</
body
>
</
html
>
using
System;
using
System.Collections.Generic;
using
System.Globalization;
using
Telerik.Web.UI;
public
partial
class
LiveExamples_Services_Audit_TreeListStringKey : System.Web.UI.Page
{
public
class
FlatRevision
{
public
int
Id {
get
;
set
; }
public
int
ParentId {
get
;
set
; }
public
string
RealId {
get
{
return
Id.ToString(CultureInfo.InvariantCulture); } }
public
string
RealParentId {
get
{
return
ParentId.ToString(CultureInfo.InvariantCulture); } }
//public double RealId { get { return (double)Id; } }
//public double RealParentId { get { return (double)ParentId; } }
public
string
SectionName {
get
;
set
; }
public
DateTime ModifiedDate {
get
;
set
; }
public
string
ModifiedBy {
get
;
set
; }
public
string
Value {
get
;
set
; }
public
string
ActionTaken {
get
;
set
; }
public
RevType Type {
get
;
set
; }
}
public
enum
RevType
{
Section = 1,
Revision = 2
}
protected
void
Tree_NeedDataSource(
object
sender, TreeListNeedDataSourceEventArgs e)
{
tree.DataSource =
new
List<FlatRevision>
{
//sv report
new
FlatRevision { Id = 1, ParentId = 0, SectionName =
"Site Visit Report"
, Type = RevType.Section },
new
FlatRevision { Id = 2, ParentId = 1, SectionName =
"Key Findings"
, Type = RevType.Section },
//kf r1
//new FlatRevision { Id = 3, ParentId = 2, SectionName = "Revision", Type = RevType.Section, ModifiedBy = "Willis", ModifiedDate = DateTime.Now.AddDays(-2) }, //removing "revision" rows per Venkat
new
FlatRevision { Id = 4, ParentId = 2, SectionName =
"Key Finding - ADAP"
, Type = RevType.Section, Value=
"Type: ADAP"
, ActionTaken =
"Updated"
},
new
FlatRevision { Id = 5, ParentId = 2, SectionName =
"Key Finding - Financial Assessment"
, Type = RevType.Section, Value=
"Type: Financial Assessment"
, ActionTaken =
"Updated"
},
//kf r2
//new FlatRevision { Id = 6, ParentId = 2, SectionName = "Revision", Type = RevType.Section, ModifiedBy = "Jimmy", ModifiedDate = DateTime.Now.AddDays(-1)},//removing "revision" rows per Venkat
new
FlatRevision { Id = 7, ParentId = 2, SectionName =
"Key Finding - Financial Review"
, Type = RevType.Section, Value=
"Type: Financial Review"
, ActionTaken =
"Added"
},
//sv questionnaire
new
FlatRevision { Id = 8, ParentId = 0, SectionName =
"Post Site Visit Questionnaire"
, Type = RevType.Section },
new
FlatRevision { Id = 9, ParentId = 8, SectionName =
"1. Were there any updates made to the site visit agenda at the entrance conference with the organization? "
, Type = RevType.Section },
//simple checklist revision
//new FlatRevision { Id = 10, ParentId = 9, SectionName = "Revision", Type = RevType.Section, ModifiedBy = "Jasper", ModifiedDate = DateTime.Now.AddDays(-4).AddMinutes(-29) }, //removing "revision" rows per Venkat
//new FlatRevision { Id = 11, ParentId = 10, SectionName = "Checklist Question", Type = RevType.Section },
new
FlatRevision { Id = 12, ParentId = 9, SectionName =
"Answer"
, Type = RevType.Section, Value =
"Yes"
, ActionTaken =
"Updated"
},
new
FlatRevision { Id = 13, ParentId = 9, SectionName =
"Comment"
, Type = RevType.Section, Value =
"pajama pajama pajama pajama pajama pajama pajama pajama pajama pajama"
, ActionTaken =
"Updated"
},
new
FlatRevision { Id = 14, ParentId = 9, SectionName =
"Agenda Documents"
, Type = RevType.Section},
new
FlatRevision { Id = 15, ParentId = 14, SectionName =
"Document - 'Bananas.txt'"
, Type = RevType.Section, ActionTaken =
"Added"
},
new
FlatRevision { Id = 16, ParentId = 15, SectionName =
"Document Name"
, Type = RevType.Section, Value=
"Bananas.txt"
},
new
FlatRevision { Id = 17, ParentId = 15, SectionName =
"Document Size"
, Type = RevType.Section, Value=
"5kb"
},
new
FlatRevision { Id = 18, ParentId = 15, SectionName =
"Document Description"
, Type = RevType.Section, Value=
"This is the file that contains useful information about bananas."
},
new
FlatRevision { Id = 19, ParentId = 14, SectionName =
"Document - 'Fish.txt'"
, Type = RevType.Section, ActionTaken =
"Updated"
},
new
FlatRevision { Id = 20, ParentId = 19, SectionName =
"Document Name"
, Type = RevType.Section, Value=
"Fish.txt"
},
new
FlatRevision { Id = 21, ParentId = 19, SectionName =
"Document Size"
, Type = RevType.Section, Value=
"332kb"
},
new
FlatRevision { Id = 22, ParentId = 19, SectionName =
"Document Description"
, Type = RevType.Section, Value=
"All about fish."
},
};
}
}
Hello, is there a way to save out the users currently selected "view" of the pivotgrid, and then reload it?
I'd like to let my users build out views and then save them for later.
I couldn't find any examples of this in your samples.
thx
Hello My Dear Friends all telerik developer;
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(IsPostBack)
return
;
SessionClear();
if
(Request.QueryString[
"portCekKartID"
] !=
null
)
{
string
masterId = Request.QueryString[
"portCekKartID"
].ToString();
int
id = Convert.ToInt32(masterId);
UpdateFormControl(id);
}
if
(CekDurumGetir(masterId) != CekDurumTips.EldenTahsil)
{
Show(
"Error !"
);
//Radwindow not opened
return
;
}
else
{
//radwindow oppen
}
}
<
telerik:RadWindow
ID
=
"radwindowPortCekGeriAl"
AutoSize
=
"false"
OnClientBeforeClose
=
"pageReflesh"
Title
=
"Cirolanmış Çekleri Geri Al"
runat
=
"server"
Animation
=
"FlyIn"
Behaviors
=
"Default"
>
</
telerik:RadWindow
>
function
rightClickHandler(sender, args) {
var
menuItemValue = args.get_item().get_value();
if
(menuItemValue ==
"portCekGeriAl"
) {
var
rowID = $(
"#radGridClickedRowIndex2"
).val();
openPopupPortfoyeGeriAl(sender, rowID);
}
}
function
openPopupPortfoyeGeriAl(sender, selectID) {
var
width = parent.innerWidth - ((parent.innerWidth / 6) * 2);
var
height = parent.innerHeight - (parent.innerHeight / 4);
var
left = innerWidth / 9;
var
top = 0;
radopen(
"/PortfoyeGeriAl.aspx/?portCekKartID="
+ selectID,
"radwindowPortCekGeriAl"
, width, height, left, top);
}