or
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FAUSControl.ascx.cs" Inherits="ATR.ePRiSM.Portal.UI.FAUS.FAUSControl" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
script
>
function ShowFausSelector() {
//OpenRadWindow("FausSelector.aspx", 400, 500);
var w = document.all("tblFausDropDown").offsetWidth + 10;
var h = 300;
oWnd = radopen("about:blank", "RadWindowForFaus");
oWnd.setSize(w, h);
oWnd.set_modal(false);
oWnd.setUrl("http://www.google.com");
oWnd.set_visibleTitlebar(false);
oWnd.set_visibleStatusbar(false);
x = getAbsoluteLeft(document.all("tblFausDropDown")) - 12;
y = getAbsoluteTop(document.all("tblFausDropDown")) + 20;
oWnd.moveTo(x, y);
}
function getAbsoluteLeft(element) {
try {
var left = 0;
var objParent = element;
do {
left += objParent.offsetLeft;
objParent = objParent.offsetParent;
}
while (objParent != null);
return left;
}
catch (x) { }
}
/******************************************************************************
* Returns the absolute position of the top edge of the specified element.
*****************************************************************************/
function getAbsoluteTop(element) {
try {
var top = 0;
var objParent = element;
do {
top += objParent.offsetTop;
objParent = objParent.offsetParent;
}
while (objParent != null);
return top;
}
catch (x) { }
}
</
script
>
<
style
>
.RadWindow_Sunset .rwTopLeft,
.RadWindow_Sunset .rwTopCenter,
.RadWindow_Sunset .rwTopRight,
.RadWindow_Sunset .rwFooterLeft,
.RadWindow_Sunset .rwFooterRight,
.RadWindow_Sunset .rwFooterCenter,
.RadWindow_Sunset .rwBodyLeft,
.RadWindow_Sunset .rwBodyRight,
.RadWindow_Sunset .rwTitlebar,
.RadWindow_Sunset .rwTitlebar,
.RadWindow_Sunset .rwNoTitlebar,
.RadWindow_Sunset .rwTopResize
{
background-image: none !important;
}
.RadWindow_Sunset .rwTitlebar,
.RadWindow_Sunset .rwTitlebar,
.RadWindow_Sunset .rwNoTitlebar
{
display:none !important;
}
</
style
>
<
TABLE
style
=
"WIDTH: 100%"
border
=
0
id
=
"tblFausDropDown"
><
TBODY
>
<
TR
>
<
TD
onclick
=
"ShowFausSelector()"
style
=
"WIDTH: 100%"
>
<
DIV
id
=
ReportCriteria_FausTree_divFaus
style
=
"BORDER-TOP: #808080 1px solid; HEIGHT: 21px; BORDER-RIGHT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BORDER-LEFT: #808080 1px solid; WIDTH: 100%; BACKGROUND-COLOR: white"
>
<
label
runat
=
"server"
id
=
"lblFaus"
style
=
"FLOAT: left; PADDING-LEFT: 2px"
></
label
>
<
IMG
style
=
"FLOAT: right"
alt
=
""
src
=
"../../images/drop-down-arrow-faus.png"
width
=
17
height
=
21
> </
DIV
></
TD
></
TR
></
TBODY
></
TABLE
>
<
telerik:RadWindowManager
ID
=
"RadWindowManagerFaus"
runat
=
"server"
Skin
=
"Sunset"
EnableAjaxSkinRendering
=
"true"
VisibleStatusbar
=
"false"
VisibleTitlebar
=
"false"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"RadWindowForFaus"
runat
=
"server"
Skin
=
"Sunset"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WinTest.Default" %>
<%@ Register Src="~/FAUSControl.ascx" TagPrefix="uc1" TagName="FAUSControl" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
asp:ScriptManager
ID
=
"scriptProcedure"
EnablePartialRendering
=
"true"
runat
=
"server"
></
asp:ScriptManager
>
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"RadWindow1"
runat
=
"server"
VisibleStatusbar
=
"false"
VisibleTitlebar
=
"false"
Skin
=
"Vista"
>
</
telerik:RadWindow
>
<
telerik:RadWindow
ID
=
"RadWindow2"
runat
=
"server"
VisibleStatusbar
=
"false"
VisibleTitlebar
=
"false"
Skin
=
"Vista"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
<
uc1:FAUSControl
runat
=
"server"
id
=
"FAUSControl"
/>
</
div
>
</
form
>
</
body
>
</
html
>
<
telerik:RadComboBox
ID
=
"CustomerSearch"
runat
=
"server"
Width
=
"180"
Height
=
"160"
MarkFirstMatch
=
"true"
AllowCustomText
=
"true"
CssClass
=
"CustomerSearch"
AutoPostBack
=
"false"
OnClientKeyPressing
=
"HandleKeyPress"
EnableVirtualScrolling
=
"true"
ShowMoreResultsBox
=
"true"
EmptyMessage
=
"Enter last, first to search..."
BackColor
=
"White"
Skin
=
"Forest"
/>
<
asp:SqlDataSource
ID
=
"dsCustomer"
runat
=
"server"
SelectCommand
=
"CustomerSearchName"
SelectCommandType
=
"StoredProcedure"
></
asp:SqlDataSource
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function searchnav(sender, args) {
var iframe = document.getElementById('ctl00_iMainPages');
if (sender.get_value() != null && sender.get_value() != '') {
iframe.src = sender.get_value() + '&T=Client';
}
}
function HandleKeyPress(sender, args) {
if (e.get_domEvent().keyCode == 13) {
searchnav(sender, args);
}
}
</
script
>
</
telerik:RadScriptBlock
>
_storeResources:
function
(h) {
var
g = [];
var
f =
this
;
h.forEach(
function
(i) {
Array.add(g, {Key: i.get_key(),Type: i.get_type(),Text: i.get_text(),EncodedKey: i._getInternalKey(),Available: i.get_available(),Attributes: f._storeAttributes(i.get_attributes())});
});
return
g;
}
public
class
RadSearchBoxExtender : RadSearchBox, INamingContainer
{
#region Public properties.
public
string
Value
{
get
{
this
.EnsureChildControls();
return
this
.valueField.Value;
}
set
{
this
.EnsureChildControls();
this
.valueField.Value = value;
}
}
public
override
string
Text
{
get
{
this
.EnsureChildControls();
return
this
.textField.Value;
}
set
{
this
.EnsureChildControls();
this
.textField.Value = value;
base
.Text = value;
}
}
#endregion Public properties.
#region Private methods.
private
HiddenField valueField;
private
HiddenField textField;
private
string
valueFieldId
{
get
{
return
this
.ID +
"_Value"
;
}
}
private
string
textFieldId
{
get
{
return
this
.ID +
"_Text"
;
}
}
#endregion Private methods.
#region Overrides.
protected
override
void
CreateChildControls()
{
this
.valueField =
new
HiddenField();
this
.valueField.ID =
this
.valueFieldId;
this
.valueField.Value =
null
;
this
.textField =
new
HiddenField();
this
.textField.ID =
this
.valueFieldId;
this
.textField.Value =
null
;
this
.Controls.Add(
this
.valueField);
this
.Controls.Add(
this
.textField);
base
.CreateChildControls();
}
#endregion Overrides.
protected
new
void
OnSearch(SearchBoxEventArgs e)
{
base
.OnSearch(e);
this
.EnsureChildControls();
this
.valueField.Value = e.Value;
this
.textField.Value = e.Text;
}
protected
override
void
OnInit(EventArgs e)
{
base
.OnInit(e);
}
protected
override
void
OnPreRender(EventArgs e)
{
base
.OnPreRender(e);
}
protected
override
void
Render(System.Web.UI.HtmlTextWriter writer)
{
base
.Render(writer);
this
.valueField.RenderControl(writer);
}
}
Private Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
Dim table As New DataTable()
table.Load(get data from database)
For rowCounter As Integer = 0 To table.Rows.Count - 1
For columnCounter As Integer = 0 To table.Columns.Count Step -1
Dim tc As New GridTemplateColumn
tc.HeaderText = "qty_1"
tc.UniqueName = "qty1" & columnCounter.ToString
tc.ItemTemplate = New MyTemplate(tc.UniqueName)
grdSchedule.MasterTableView.Columns.Add(tc)
next
next
End Sub
Private Class MyTemplate
Implements ITemplate
Protected textBox As TextBox
Private colname As String
Public Sub New(ByVal cName As String)
MyBase.New()
colname = cName
End Sub
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
textBox = New TextBox
textBox.ID = "abc"
container.Controls.Add(textBox)
End Sub
End Class
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"uxRadScriptManager"
runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadStyleSheetManager
ID
=
"uxRadStyleSheetManager"
Runat
=
"server"
></
telerik:RadStyleSheetManager
>
<
telerik:RadButton
ID
=
"RadButton2"
runat
=
"server"
Text
=
"This button is OK"
></
telerik:RadButton
>
<
br
/>
<
br
/>
<
telerik:RadDockZone
runat
=
"server"
ID
=
"RadDockZone2"
>
<
telerik:RadDock
ID
=
"uxLogonPanel"
runat
=
"server"
Title
=
"Logon"
style
=
"overflow:hidden;"
EnableAnimation
=
"false"
AutoPostBack
=
"false"
Resizable
=
"false"
DefaultCommands
=
"None"
EnableDrag
=
"False"
Index
=
"-1"
Pinned
=
"True"
Tag
=
""
Width
=
"296"
>
<
ContentTemplate
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Inside dock"
></
telerik:RadButton
>
<
table
id
=
"uxLogonTable"
Runat
=
"server"
>
<
tr
>
<
td
>
<
telerik:RadButton
ID
=
"uxLogonButton"
runat
=
"server"
Text
=
"Inside table in dock"
></
telerik:RadButton
>
</
td
>
</
tr
>
</
table
>
</
ContentTemplate
>
</
telerik:RadDock
>
</
telerik:RadDockZone
>
</
form
>
</
body
>
</
html
>