<%
-- "About" window --%>
<telerik:RadWindow runat="server" ID="AboutWindow" Overlay="false" VisibleStatusbar="false" Behaviors="Move,Close" Animation="None" Modal="true" Title="About This Demo" Width="490px" Height="425px" IconUrl="Images/about_icon.png" OnClientShow="aboutWindowShow">
<ContentTemplate>
<uc:About runat ="server" ID="AboutDialog" />
</ContentTemplate>
</telerik:RadWindow>
and i have added this function
function buttonClicked(sender, args) {
if (args.get_item().get_index() == 0)
$find(
'AboutWindow').show();
}
<
telerik:RadGrid
runat
=
"server"
ID
=
"List"
AllowPaging
=
"true"
AllowSorting
=
"True"
AllowFilteringByColumn
=
"True"
ShowStatusBar
=
"true"
AutoGenerateColumns
=
"false"
OnEditCommand
=
"List_OnEditCommand"
OnItemCommand
=
"List_Command"
OnItemDataBound
=
"List_ItemDataBound"
Visible
=
"false"
>
<
ClientSettings
EnablePostBackOnRowClick
=
"true"
>
<
Selecting
AllowRowSelect
=
"True"
/>
</
ClientSettings
>
<
PagerStyle
Mode
=
"NumericPages"
Position
=
"Bottom"
></
PagerStyle
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
ShowHeadersWhenNoRecords
=
"true"
DataKeyNames
=
"Id"
ClientDataKeyNames
=
"Id"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Id"
UniqueName
=
"Id"
HeaderText
=
"Id"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"Id"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
DataField
=
"Name"
UniqueName
=
"Name"
HeaderText
=
"Name"
DataType
=
"System.String"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"Name"
>
<
ItemTemplate
> <%# Eval("Name")%> <
img
src
=
"/Images/bc_<%# Eval("
name")%>.png" alt="" /></
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"FirstName"
UniqueName
=
"FirstName"
HeaderText
=
"Firstname"
DataType
=
"System.String"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"Firstname"
>
</
telerik:GridBoundColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"Edit"
>
</
telerik:GridEditCommandColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
protected void button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection();
SqlCommand comand = new SqlCommand("research", conn);
comand.Parameters.Add(new SqlParameter("@id", SqlDbType.Int)).Value = u_id;
comand.CommandType = CommandType.StoredProcedure;
DataTable dt = new DataTable();
try
{
conn.Open();
SqlDataReader r = comand.ExecuteReader();
dt.Load(r);
List.DataBind();
List.DataSource = dt;
List.DataBind();
List.Visible = true;
}
catch (SqlException ex)
{
}
finally
{
conn.Close();
}
}
protected void button2_Click(object sender, EventArgs e)
{
foreach (search cs in u.search)
{
u.save(u.id, u.ac, u.s);
}
SqlConnection conn = new SqlConnection();
SqlCommand comand = new SqlCommand("proc_s", conn);
comand.Parameters.Add(new SqlParameter("@id", SqlDbType.Int)).Value = u_id;
comand.CommandType = CommandType.StoredProcedure;
DataTable dt = new DataTable();
try
{
conn.Open();
SqlDataReader r = comand.ExecuteReader();
dt.Load(r);
List.DataSource = dt;
List.DataBind();
List.Visible = true;
}
catch (SqlException ex)
{
}
finally
{
conn.Close();
}
}
<
div
class
=
"leftPanelBarContainer"
>
<
div
id
=
"slidingDiv"
style
=
"visibility: hidden"
runat
=
"server"
>
<
telerik:RadPanelBar
runat
=
"server"
ID
=
"rdpbSalary"
ExpandMode
=
"FullExpandedItem"
Skin
=
"Vista"
EnableEmbeddedSkins
=
"false"
Width
=
"550px"
Height
=
"300px"
>
<
Items
>
<
telerik:RadPanelItem
Expanded
=
"true"
Text
=
"Employee Salary Information"
runat
=
"server"
Selected
=
"true"
>
<
Items
>
<
telerik:RadPanelItem
Value
=
"SalaryInformation"
runat
=
"server"
>
<
ItemTemplate
>
<
div
style
=
"float: right; font-family: Verdana; margin-right: 15px;"
>
<
span
style
=
"color: Red;"
>*</
span
> Denotes are Mandatory
</
div
>
<
br
/>
<
div
class
=
"text"
style
=
"background-color: #ffffff"
>
<
ul
class
=
"formList"
id
=
"salaryinfo"
>
<
li
>
<
asp:Label
Width
=
"155px"
runat
=
"server"
CssClass
=
"label1"
ID
=
"lblSalaryPayRate"
AssociatedControlID
=
"rdbtnlstPayRate"
>What is the Pay Rate? <
span
style
=
"color:Red"
>*</
span
></
asp:Label
>
<
asp:RadioButtonList
ID
=
"rdbtnlstPayRate"
runat
=
"server"
AutoPostBack
=
"true"
RepeatDirection
=
"Horizontal"
OnSelectedIndexChanged
=
"rdbtnlstPayRate_SelectedIndexChanged"
Style
=
"width: 155px"
ValidationGroup
=
"salaryValidation1"
>
<
asp:ListItem
Value
=
"S"
>Salary</
asp:ListItem
>
<
asp:ListItem
Value
=
"H"
>Hourly</
asp:ListItem
>
</
asp:RadioButtonList
>
<
asp:RequiredFieldValidator
ID
=
"rfvsalaryTypeID"
runat
=
"server"
ControlToValidate
=
"rdbtnlstPayRate"
CssClass
=
"error"
ErrorMessage
=
"Please Select One Pay Rate"
ValidationGroup
=
"salaryValidation1"
></
asp:RequiredFieldValidator
>
</
li
>
<
li
>
<
asp:Label
runat
=
"server"
Width
=
"150px"
CssClass
=
"label1"
ID
=
"lblsalaryPeriodWages"
AssociatedControlID
=
"txtsalaryPeriodWages"
>Period Wages <
span
style
=
"color:Red"
>*</
span
></
asp:Label
>
<
telerik:RadNumericTextBox
runat
=
"server"
ID
=
"txtsalaryPeriodWages"
Width
=
"200px"
ValidationGroup
=
"salaryValidation"
IncrementSettings-InterceptMouseWheel
=
"false"
IncrementSettings-InterceptArrowKeys
=
"false"
>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"rqrdsalaryWages"
ValidationGroup
=
"salaryValidation"
ForeColor
=
"Red"
ControlToValidate
=
"txtsalaryPeriodWages"
ErrorMessage
=
"Required Period Wages"
></
asp:RequiredFieldValidator
>
</
li
>
<
li
>
<
asp:Label
runat
=
"server"
CssClass
=
"label1"
Width
=
"150px"
ID
=
"lblsalaryRatePay"
AssociatedControlID
=
"txtsalaryRatePay"
>Rate of Pay <
span
style
=
"color:Red"
>*</
span
></
asp:Label
>
<
telerik:RadNumericTextBox
runat
=
"server"
ID
=
"txtsalaryRatePay"
Width
=
"200px"
ValidationGroup
=
"hourlyValidation"
IncrementSettings-InterceptMouseWheel
=
"false"
IncrementSettings-InterceptArrowKeys
=
"false"
>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"rqrdsalaryRatePay"
ValidationGroup
=
"hourlyValidation"
ForeColor
=
"Red"
ControlToValidate
=
"txtsalaryRatePay"
ErrorMessage
=
"Required Rate of Pay "
></
asp:RequiredFieldValidator
>
</
li
>
<
li
>
<
asp:Label
runat
=
"server"
CssClass
=
"label1"
Width
=
"150px"
ID
=
"lblSalaryOthers"
AssociatedControlID
=
"txtsalaryOthers"
>Hours <
span
style
=
"color:Red"
>*</
span
></
asp:Label
>
<
telerik:RadNumericTextBox
runat
=
"server"
ID
=
"txtsalaryOthers"
Width
=
"200px"
ValidationGroup
=
"hourlyValidation"
IncrementSettings-InterceptMouseWheel
=
"false"
IncrementSettings-InterceptArrowKeys
=
"false"
>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
runat
=
"server"
ValidationGroup
=
"hourlyValidation"
ID
=
"rqrdsalaryOther"
ControlToValidate
=
"txtsalaryOthers"
ErrorMessage
=
"Required Other Hours Rate"
ForeColor
=
"Red"
></
asp:RequiredFieldValidator
>
</
li
>
</
ul
>
<
br
/>
<
asp:ValidationSummary
runat
=
"server"
ID
=
"validationSummary2"
CssClass
=
"validationSummary"
/>
<
table
style
=
"margin-left: 50px;"
>
<
tr
>
<
td
>
<
telerik:RadButton
ID
=
"rdbtnsalarySave"
ValidationGroup
=
"salaryValidation1"
runat
=
"server"
Text
=
"Save & Next"
OnClick
=
"rdbtnsalarySave_Click"
>
</
telerik:RadButton
>
<
telerik:RadButton
ID
=
"rdbtnsalaryCancel"
runat
=
"server"
Text
=
"Cancel"
OnClick
=
"rdbtnsalaryCancel_Click"
>
</
telerik:RadButton
>
<
br
/>
</
td
>
</
tr
>
</
table
>
<
br
/>
</
div
>
</
ItemTemplate
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
>
</
div
>
<
telerik:RadCodeBlock
ID
=
"rdcode"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
var panelDomElement = $get('<%= rdpbSalary.ClientID %>');
var timage = $get('<%= lnkAdd.ClientID %>');
if (panelDomElement) {
SetUpAnimation(timage.id, Telerik.Web.UI.jSlideDirection.Center, panelDomElement);
}
function SetUpAnimation(image, direction, element) {
element.style.position = "relative";
var slider = document.getElementById(image);
var expanded = false;
var expandAnimation = new Telerik.Web.UI.AnimationSettings({});
var collapseAnimation = new Telerik.Web.UI.AnimationSettings({});
var slide = new Telerik.Web.UI.jSlide(element, expandAnimation, collapseAnimation, false);
slide.initialize();
slide.set_direction(direction);
slider.onclick = function () {
element.parentNode.style.visibility = "visible";
element.parentNode.style.display = "block";
if (!expanded) {
slide.expand();
}
else {
slide.collapse();
}
expanded = !expanded;
return false;
}
}
</
script
>
</
telerik:RadCodeBlock
>
</
div
>
function
GetRadWindow() {
var
oWindow =
null
;
if
(window.radWindow) oWindow = window.radWindow;
else
if
(window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return
oWindow;
}
function
Close(){
GetRadWindow().close();
}
Protected
Sub Page_Load(
ByVal
sender as
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.load
If
User.Identity.IsAuthenticated = true
Then
'(...)
Else
RadScriptManager.RegisterClientScriptBlock(
Me
, [
GetType
()],
"mykey"
,
"Close();"
,
True
)
End
End
sub
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="radCBOLookup.ascx.vb"
Inherits="HEW.radCBOLookup" %>
<
telerik:RadComboBox
ID
=
"radCBOLookup"
runat
=
"server"
MarkFirstMatch
=
"true"
AllowCustomText
=
"false"
Width
=
"50px"
DropDownWidth
=
"350px"
MaxHeight
=
"300px"
NoWrap
=
"true"
HighlightTemplatedItems
=
"true"
ExpandDirection
=
"Down"
ExpandDelay
=
"0"
CollapseDelay
=
"0"
>
<
HeaderTemplate
>
<
table
style
=
"width: 100%; text-align: left; font-size: 8pt"
>
<
tr
>
<
td
style
=
"width: 20%;"
>
Code
</
td
>
<
td
style
=
"width: 80%;"
>
Description
</
td
>
</
tr
>
</
table
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
table
style
=
"width: 100%; text-align: left; font-size: 8pt"
>
<
tr
>
<
td
style
=
"width: 20%;"
>
<%#DataBinder.Eval(Container.DataItem, "Master_Type_Code")%>
</
td
>
<
td
style
=
"width: 80%;"
>
<%#DataBinder.Eval(Container.DataItem, "Master_Desc")%>
</
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
e.Item.Text = (DirectCast(e.Item.DataItem, DataRowView))("Master_Type_Code").ToString
e.Item.Value = (DirectCast(e.Item.DataItem, DataRowView))("Master_Type_Code").ToString.Trim
e.Item.Attributes("Description") = (DirectCast(e.Item.DataItem, DataRowView))("Master_Desc").ToString.Trim
protected void rgPayoutElections_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = e.Item as GridDataItem;
int accountID = Int32.Parse(item.GetDataKeyValue("AccountID").ToString());
DataRow[] dr = PayoutElection.GetPayouts_ByAccount_ListByParticipant(Int32.Parse(Profile.ParticipantID), accountID);
Table tblPayoutType = new Table();
foreach (DataRow row in dr)
{
TableRow trPayoutType = new TableRow();
TableCell cellPayoutType = new TableCell();
cellPayoutType.Text = row["PayoutType"].ToString();
cellPayoutType.CssClass = "textRed";
trPayoutType.Cells.Add(cellPayoutType);
tblPayoutType.Rows.Add(trPayoutType);
}
item["PayoutType"].Controls.Add(tblPayoutType);
}
}
Below is a portion of my grid, which uses a DetailTable with its own CommandItemTemplate
<
DetailTables
>
<
telerik:GridTableView
Name
=
"PersonConditionGrid"
runat
=
"server"
DataKeyNames
=
"PersonConditionId"
Caption
=
"Conditions linked with this Person"
DataSourceID
=
"PersonConditionViewDataSrcId"
TableLayout
=
"Auto"
Width
=
"580px"
AutoGenerateColumns
=
"false"
CommandItemDisplay
=
"Top"
ShowFooter
=
"true"
FooterStyle-BorderStyle
=
"Solid"
FooterStyle-BorderWidth
=
"2pt"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"PersonId"
MasterKeyField
=
"PersonId"
/>
</
ParentTableRelation
>
<
HeaderStyle
Font-Bold
=
"true"
/>
<
CommandItemTemplate
>
<
table
width
=
"100%"
>
<
tr
>
<
td
align
=
"left"
>
<
asp:LinkButton
ID
=
"btnAddNew"
runat
=
"server"
CommandName
=
"InitInsert"
><
asp:Image
ID
=
"imgAddNew"
runat
=
"server"
ImageUrl
=
"~/Images/button-New-24.gif"
/> Add New Condition</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnSaveNew"
runat
=
"server"
CommandName
=
"PerformInsert"
ValidationGroup
=
"EntryClass_VG"
><
asp:Image
ID
=
"imgSaveNew"
runat
=
"server"
ImageUrl
=
"~/Images/button-Save-24.gif"
/> Save Condition</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnEdit"
runat
=
"server"
CommandName
=
"EditSelected"
><
asp:Image
ID
=
"imgEdit"
runat
=
"server"
ImageUrl
=
"~/Images/button-Edit-24.gif"
/> Take Action on Condition</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnSaveEdit"
runat
=
"server"
CommandName
=
"UpdateEdited"
ValidationGroup
=
"EntryClass_VG"
><
asp:Image
ID
=
"imgSaveEdit"
runat
=
"server"
ImageUrl
=
"~/Images/button-Save-24.gif"
/> Save Condition</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnCancel"
runat
=
"server"
CommandName
=
"CancelAll"
CausesValidation
=
"false"
><
asp:Image
ID
=
"imgCancel"
runat
=
"server"
ImageUrl
=
"~/Images/button-Cancel-24.gif"
/> Cancel Edit</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnDelete"
runat
=
"server"
CommandName
=
"DeleteSelected"
OnClientClick
=
"return confirm('Are you sure you want to delete the selected record?');"
><
asp:Image
ID
=
"imgDelete"
runat
=
"server"
ImageUrl
=
"~/Images/button-Del-24.gif"
/> Delete Condition</
asp:LinkButton
>
</
td
>
</
tr
>
</
table
>
</
CommandItemTemplate
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"SiteAccessConditionName"
HeaderText
=
"Access Condition Name"
HeaderStyle-Width
=
"200px"
HeaderStyle-HorizontalAlign
=
"Center"
>
<
ItemTemplate
>
After a Save operation, the detailTable remains open, with the new item displayed in the grid (as expected).
After a Cancel or Delete operation, the DetailsTable collapses and the user has to expand the item again.
Is there some way to prevent the DetailTable from collapsing after the Cancel or Delete operation?