====================================================================================================
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="contentPage.aspx.vb" Inherits="contentPage" title="Untitled Page" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" src="limitCharacters2.js"></script>
<telerik:RadEditor ID="RadEditorHeadline" runat="server" OnClientLoad="LimitCharacters" OnClientPasteHtml="OnClientPasteHtml">
<Content></Content></telerik:RadEditor>
<telerik:RadEditor ID="RadEditorPurpose" runat="server" OnClientLoad="LimitCharacters" NewLineBr="False" OnClientPasteHtml="OnClientPasteHtml">
<Content></Content></telerik:RadEditor>
</asp:Content>
//========================================================================================================
//limitCharacters2.js
//========================================================================================================
// JavaScript File to limit characters entered into Prometheus Rad Editor control
var editorList= new Object();
var editorLengthArray = [80,80,80];
var counter = 0;
function isAlphaNumericKey(keyCode)
{
if ((keyCode > 47 && keyCode < 58) || (keyCode > 64 && keyCode < 91))
{
return true;
}
return false;
}
function LimitCharacters(editor)
{
editorList[editor.get_id()] = editorLengthArray[counter];
counter++;
editor.attachEventHandler("onkeydown", function(e)
{
e = (e == null)? window.event : e;
if (isAlphaNumericKey(e.keyCode))
{
var maxTextLength = editorList[editor.get_id()];
textLength = editor.get_text().length;
if (textLength >= maxTextLength)
{
alert('You are not able to type more than ' + maxTextLength + ' symbols!');
e.returnValue = false;
}
}
});
}
function CalculateLength(editor, value)
{
var textLength = editor.get_text().length;
var clipboardLength = value.length;
textLength += clipboardLength;
return textLength;
}
function OnClientPasteHtml(editor, args)
{
var maxTextLength = editorList[editor.get_id()];
var commandName = args.get_commandName();
var value = args.get_value();
if (commandName == "PasteFromWord"
|| commandName == "PasteFromWordNoFontsNoSizes"
|| commandName == "PastePlainText"
|| commandName == "PasteAsHtml"
|| commandName == "Paste" )
{
var textLength = CalculateLength (editor, value);
if (textLength >= maxTextLength)
{
alert('You are not able to type more than ' + maxTextLength + ' symbols!');
args.set_cancel(true);
}
}
}

private void BindViewer() { VS.ViewerService obj = new VS.ViewerService(); String SessionKey = obj.newSession(); DateTime Date1 = Convert.ToDateTime("1980-01-01"); DateTime Date2 = Convert.ToDateTime("2012-12-31"); VS.extract extract = obj.getObjects(SessionKey, "Butt", Date1, false, Date2, false, "", ""); try { RadPanelBar1.Items.Clear(); RadScheduler1.Appointments.Clear(); int Len = extract.set.Length; for (int i = 0; i < Len; i++) { VS.vertex value = extract.set[i]; String PanelClass = value.meta; PanelClass = PanelClass.Replace(Remstr, ""); PanelClass = PanelClass.Replace(Remstr2, ""); Appointment app = null; if (value.atom != null) { RadPanelItem pane = RadPanelBar1.Items.FindItemByText(PanelClass); if (pane == null) { RadPanelItem nwpane = new Telerik.Web.UI.RadPanelItem(PanelClass); RadPanelItem nwpaneSpliter = new Telerik.Web.UI.RadPanelItem(PanelClass); nwpaneSpliter.IsSeparator = true; RadPanelBar1.Items.Add(nwpane); pane = nwpane; } if (value.meta == "za.co.abacus.C_EVENT") { app = new Appointment(); } int atomLen = value.atom.Length; for (int j = 0; j < atomLen; j++) { VS.atom atm = value.atom[j]; if (atm.meta.Contains("za.co.reactor.A_LABEL")) { RadPanelItem NewItem = new RadPanelItem(atm.content); pane.Items.Add(NewItem); if (app != null) { app.Subject = atm.content; app.Description = atm.content; app.ID = value.key; } } if (app != null && atm.meta.Contains("za.co.abacus.C_EVENT")) { app.ID = atm.content; } if (app != null && atm.meta.Contains("za.co.reactor.A_HORIZON")) { app.Start = Convert.ToDateTime(atm.content); } if (app != null && atm.meta.Contains("za.co.reactor.AA_HORIZON")) { app.End = Convert.ToDateTime(atm.content); } if (app != null && atm.meta.Contains("za.co.reactor.A_TEXT")) { app.Description = atm.content; } if (app != null && atm.meta.Contains("za.co.reactor.A_TEXT")) { app.RecurrenceRule = atm.content; } if (app != null && app.End > app.Start) { RadScheduler1.DataStartField = app.Start.ToString(); RadScheduler1.DataSubjectField = app.Subject.ToString(); RadScheduler1.DataEndField = app.End.ToString(); RadScheduler1.DataKeyField = app.ID.ToString(); RadScheduler1.SelectedView = SchedulerViewType.MonthView; RadScheduler1.SelectedDate = app.Start; SlidingZone1.ExpandedPaneId = "RadSlidingPane1"; } } } } } catch (ApplicationException ex) { } finally { obj.closeSession(SessionKey); } }Good Day All
I have a Class that is defined like this
namespace EAVV{ public class EAV { private string _Attribute; private string _Value; public string Attribute { get { return _Attribute; } set { _Attribute = value; } } public string Value { get { return _Value; } set { _Value = value; } } public EAV(string AttributeEA, string ValueEA) { this._Attribute = AttributeEA; this._Value = ValueEA; } public EAV() { } }}And I have another one to process this like this
namespace EAVV{ public class EAVProcess { public List<EAV> GetRecords(List<string> ParentRecords,List<string> ChildRecords) { List<EAV> Final= new List<EAV>(); for (int i = 0; i < ParentRecords.Count; i++) { for (int J = 0; J < ChildRecords.Count; J++) { Final.Add(new EAV(ParentRecords[i], ChildRecords[J])); } } return Final; } public EAVProcess() { } }}
And as you can see this will return a list. So I am binding my Grid(Telerik) which is the same as binding the normal asp.net grid like this
RadGrid1.DataSource = EAVobj.GetRecords(ParentRecordsRow, ChildRecordsField); RadGrid1.DataBind();And I get the Following Data
from the Image, You can see there is an Attribute Column and there is a Value Column, Now what i want to do is that i want to have only one Country and one Event in the Attribute and the Values must be nested underneath each other in a Grid, so basically i need a nested View and the Attribute is the parent and the Values will be grouped according to their parent.
<
telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" >
<
asp:Image id="imgLoading" runat="server" ></asp:Image>
</
telerik:RadAjaxLoadingPanel>
<
telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
< telerik:RadGrid ID="CWGrid" runat="server" Width="100%" OnNeedDataSource="CWGrid_NeedDataSource" >
</
telerik:RadGrid>
</
telerik:RadAjaxPanel>
public
void CWGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
DataSet objSD = SetData();
if (objDS.Tables.Count > 0)
CWGrid.DataSource = objDS;
}