or
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HideGridLines.aspx.cs"
Inherits="Test.HideGridLines" %>
<!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"
>
<
telerik:RadScriptManager
ID
=
"ScriptManager"
runat
=
"server"
/>
<
table
width
=
"763"
border
=
"0"
cellspacing
=
"0"
cellpadding
=
"0"
>
<
tr
>
<
td
valign
=
"top"
>
<
asp:UpdatePanel
ID
=
"UpdatePanelOptIn"
runat
=
"server"
>
<
ContentTemplate
>
<
telerik:RadGrid
ID
=
"RadGridOptIn"
runat
=
"server"
AutoGenerateColumns
=
"false"
ShowHeader
=
"false"
ItemStyle-BackColor
=
"Transparent"
AlternatingItemStyle-BackColor
=
"Transparent"
BorderColor
=
"Transparent"
OnItemDataBound
=
"RadGridOptIn_ItemDataBound"
>
<
MasterTableView
DataKeyNames
=
"OptInTypeId"
BackColor
=
"Transparent"
BorderColor
=
"Transparent"
GridLines
=
"None"
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"IsRequired"
ItemStyle-HorizontalAlign
=
"Right"
ItemStyle-VerticalAlign
=
"Top"
>
<
ItemTemplate
>
<
asp:PlaceHolder
ID
=
"plhOptInRequired"
runat
=
"server"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"IsSelected"
ItemStyle-HorizontalAlign
=
"Left"
ItemStyle-VerticalAlign
=
"Top"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"cboIsSelected"
runat
=
"server"
AutoPostBack
=
"true"
OnCheckedChanged
=
"cboIsSelected_CheckedChanged"
TabIndex
=
"30"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"OptInHtml"
ItemStyle-HorizontalAlign
=
"Left"
ItemStyle-VerticalAlign
=
"Top"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
td
>
</
tr
>
</
table
>
</
form
>
</
body
>
</
html
>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
namespace Test
{
public partial class HideGridLines : System.Web.UI.Page
{
#region Properties
#region HcpOptIns
private UserProfileOptInList HcpOptIns
{
get
{
if (ViewState["HcpOptIns"] == null)
{
ViewState["HcpOptIns"] = UserProfileOptInList.GetUserProfileOptInList();
}
return (UserProfileOptInList)ViewState["HcpOptIns"];
}
set
{
ViewState["HcpOptIns"] = value;
}
}
#endregion
#endregion
#region Events
#region cboIsSelected_CheckedChanged
protected void cboIsSelected_CheckedChanged(object sender, EventArgs e)
{
try
{
CheckBox optIn = (CheckBox)sender;
bool isSelected = optIn.Checked;
GridDataItem item = (GridDataItem)optIn.NamingContainer;
// get UserProfileOptInCollection record by datakey from the grid
long optInTypeID = Convert.ToInt64(item.GetDataKeyValue("OptInTypeId"));
UserProfileOptIn regOptIn = HcpOptIns.ItemByOptInTypeId(optInTypeID);
regOptIn.IsSelected = isSelected;
BindOptIns();
}
catch (Exception ex)
{
string message = ex.Message;
}
}
#endregion
#region Page_Load
protected void Page_Load(object sender, EventArgs e)
{
BindOptIns();
}
#endregion
#region RadGridOptIn_ItemDataBound
protected void RadGridOptIn_ItemDataBound(object sender, GridItemEventArgs e)
{
try
{
if (e.Item is GridDataItem)
{
if (e.Item.DataItem is UserProfileOptIn)
{
PlaceHolder plhOptInRequired = (PlaceHolder)e.Item.FindControl("plhOptInRequired");
CheckBox chkOptIn = (CheckBox)e.Item.FindControl("cboIsSelected");
UserProfileOptIn optIn = (UserProfileOptIn)e.Item.DataItem;
System.Web.UI.WebControls.Image imgESignature = (System.Web.UI.WebControls.Image)e.Item.FindControl("imgESignature");
if (optIn.IsRequired)
{
AddContentToPlaceHolderControl(@"<
span
class
=
""
RequiredFieldAsterik""> * </
span
>", ref plhOptInRequired);
}
else
{
AddContentToPlaceHolderControl(" ", ref plhOptInRequired);
}
if (optIn.IsSelected)
{
chkOptIn.Checked = true;
}
else
{
chkOptIn.Checked = false;
}
}
}
}
catch (Exception ex)
{
string message = ex.Message;
}
}
#endregion
#endregion
#region Methods
#region AddContentToPlaceHolderControl
/// <
summary
>
/// Method to indicate required fields
/// </
summary
>
/// <
param
name
=
"controlHTML"
>HTML Literal Control to be added to the PlaceHolder Control.</
param
>
/// <
param
name
=
"inputPlaceHolderControl"
>PlaceHolder Control that will have literal control added to it.</
param
>
public static void AddContentToPlaceHolderControl(string controlHTML, ref PlaceHolder inputPlaceHolderControl)
{
Literal htmlForPlaceHolder = new Literal();
htmlForPlaceHolder.Text = controlHTML;
inputPlaceHolderControl.Controls.Add(htmlForPlaceHolder);
}
#endregion
#region BindOptIns
private void BindOptIns()
{
RadGridOptIn.DataSource = HcpOptIns;
RadGridOptIn.DataBind();
}
#endregion
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Test
{
[Serializable]
public class UserProfileOptIn
{
#region Instance Variables
private long _userProfileOptInTypeId;
private long _optInTypeId;
private bool _isRequired;
private bool _isDisplayed;
private bool _isSelected;
private string _optInHtml = string.Empty;
#endregion
#region Properties
public long UserProfileOptInTypeId
{
get { return this._userProfileOptInTypeId; }
set { this._userProfileOptInTypeId = value; }
}
public long OptInTypeId
{
get { return this._optInTypeId; }
set { this._optInTypeId = value; }
}
public bool IsRequired
{
get { return this._isRequired; }
}
public bool IsDisplayed
{
get { return this._isDisplayed; }
set { this._isDisplayed = value; }
}
public bool IsSelected
{
get { return this._isSelected; }
set { this._isSelected = value; }
}
public string OptInHtml
{
get { return this._optInHtml; }
set { this._optInHtml = value; }
}
#endregion
#region Constructor
private UserProfileOptIn(long userProfileOptInTypeId, long optInTypeId, bool isRequired, bool isDisplayed, bool isSelected, string optInHtml)
{
this._userProfileOptInTypeId = userProfileOptInTypeId;
this._optInTypeId = optInTypeId;
this._isRequired = isRequired;
this._isDisplayed = isDisplayed;
this._isSelected = isSelected;
this._optInHtml = optInHtml;
}
#endregion
#region Factory Methods
public static UserProfileOptIn NewUserProfileOptInt(long userProfileOptInTypeId, long optInTypeId, bool isRequired, bool isDisplayed, bool isSelected, string optInHtml)
{
return new UserProfileOptIn(userProfileOptInTypeId, optInTypeId, isRequired, isDisplayed, isSelected, optInHtml);
}
#endregion
}
[Serializable()]
public class UserProfileOptInList : List<
UserProfileOptIn
>
{
#region Constructor
private UserProfileOptInList(bool getList)
{
if (getList)
{
this.Add(UserProfileOptIn.NewUserProfileOptInt(1, 1, true, true, false, "This is the first condition."));
this.Add(UserProfileOptIn.NewUserProfileOptInt(2, 3, true, true, false, "This is the second condition."));
this.Add(UserProfileOptIn.NewUserProfileOptInt(3, 1, true, true, false, "This is the third condition."));
this.Add(UserProfileOptIn.NewUserProfileOptInt(4, 4, true, true, false, "This is the fourth condition."));
this.Add(UserProfileOptIn.NewUserProfileOptInt(5, 5, true, true, false, "This is the fifth condition."));
this.Add(UserProfileOptIn.NewUserProfileOptInt(6, 6, true, true, false, "This is the sixth condition."));
}
}
#endregion
#region Factory Methods
public static UserProfileOptInList NewUserProfileOptInList()
{
return new UserProfileOptInList(false);
}
public static UserProfileOptInList GetUserProfileOptInList()
{
return new UserProfileOptInList(true);
}
#endregion
#region Methods
public UserProfileOptIn ItemByOptInTypeId(long optInTypeId)
{
foreach (UserProfileOptIn userProfileOptInItem in this)
{
if (userProfileOptInItem.OptInTypeId == optInTypeId)
{
return userProfileOptInItem;
}
}
return null;
}
#endregion
}
}
if
(key == 40 || key == 9)
// down arrow or tab
{
// open combobox if not already
if
(!comboBox.get_dropDownVisible()) {
comboBox.showDropDown();
comboBox._childListElementWrapper.style.height =
"400px"
;
}
// focus first visible child node
$(nodes).each(
function
(sender, args) {
var
node = args;
if
(node.get_nodes().get_count() == 0 &&
// leaf node
!$(node._element).is(
':hidden'
))
// and hasn't been filtered out
{
$(node._contentElement).focus();
node.highlight();
// node.set_selected(true);
return
false
;
}
}
);
}
l.findItemByValue(
"CommandEdit"
).set_enabled(
true
);
l.findItemByValue(
"CommandDelete"
).set_enabled(
true
);
<
telerik:RadScheduler
ID
=
"radScheduler"
runat
=
"server"
DayEndTime
=
"19:00:00"
FirstDayOfWeek
=
"Monday"
LastDayOfWeek
=
"Sunday"
OverflowBehavior
=
"Expand"
SelectedView
=
"WeekView"
ShowAllDayRow
=
"True"
ShowFooter
=
"False"
Skin
=
"Windows7"
WorkDayEndTime
=
"19:00:00"
OnClientAppointmentClick
=
"OnClientAppointmentClick"
OnClientTimeSlotClick
=
"OnClientTimeSlotClick"
ShowViewTabs
=
"False"
CustomAttributeNames
=
"FileCode, DocketNo"
AdvancedForm-EnableCustomAttributeEditing
=
"true"
AllowInsert
=
"False"
OnTimeSlotCreated
=
"radScheduler_TimeSlotCreated"
OnFormCreated
=
"radScheduler_FormCreated"
StartInsertingInAdvancedForm
=
"false"
EnableDescriptionField
=
"true"
EnableCustomAttributeEditing
=
"true"
Localization-AdvancedSubject
=
"Code Center"
OnAppointmentContextMenuItemClicked
=
"radScheduler_AppointmentContextMenuItemClicked"
>
<
AdvancedForm
Modal
=
"True"
/>
<
Localization
AdvancedSubject
=
"Code Center"
></
Localization
>
<
TimelineView
UserSelectable
=
"False"
/>
<
MonthView
UserSelectable
=
"False"
/>
<
AppointmentContextMenus
>
<
telerik:RadSchedulerContextMenu
ID
=
"contextMenu"
runat
=
"server"
>
<
Items
>
<
telerik:RadMenuItem
runat
=
"server"
Text
=
"Negate Timesheet"
Value
=
"NegateCommand"
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadSchedulerContextMenu
>
</
AppointmentContextMenus
>
</
telerik:RadScheduler
>
Public Sub ShowFieldDescription(ByVal sender As Object, ByVal e As EventArgs)
Dim ibtDescription As ImageButton = DirectCast(sender, ImageButton)
Dim frvView As FormView = DirectCast(ibtDescription.NamingContainer, FormView)
Dim strFieldName As String = ibtDescription.AlternateText.ToString
Dim strErrorId As String = DirectCast(frvView.FindControl("ErrorId"), Label).Text
Dim txtField As TextBox
Dim strFieldValue As String = ""
Select Case strFieldName
Case "Error Description"
txtField = DirectCast(frvView.FindControl("ErrorDescription"), TextBox)
Case "Error Comments"
txtField = DirectCast(frvView.FindControl("ErrorComments"), TextBox)
Case "HTTP Reference"
txtField = DirectCast(frvView.FindControl("SourceHTTPReference"), TextBox)
Case "Form Data"
txtField = DirectCast(frvView.FindControl("SourceFormData"), TextBox)
Case "All HTTP Headers"
txtField = DirectCast(frvView.FindControl("SourceAllHTTPHeaders"), TextBox)
Case "HTTP User Agent"
txtField = DirectCast(frvView.FindControl("SourceHTTPUserAgent"), TextBox)
End Select
strFieldValue = txtField.Text.ToString
Dim rwdFieldDisplay As New RadWindow
Dim strNavigation As String = "~/Modules/Central/WBF CTL Large Field Display.aspx?&ErrorId=" + strErrorId + "&FieldName=" + strFieldName + "&FieldValue=" + strFieldValue
rwdFieldDisplay.ID = "rwdDisplay"
rwdFieldDisplay.NavigateUrl = strNavigation
rwdFieldDisplay.Skin = "Black"
rwmFieldDescription.Windows.Add(rwdFieldDisplay)
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadListView1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"ListViewPanel1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
div
style
=
"width: 880"
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Black"
>
</
telerik:RadAjaxLoadingPanel
>
<
asp:Panel
ID
=
"ListViewPanel1"
runat
=
"server"
>
<
telerik:RadListView
ID
=
"RadListView1"
runat
=
"server"
DataKeyNames
=
"fabricid"
AllowPaging
=
"True"
>
<
LayoutTemplate
>
<
div
class
=
"RadListView RadListViewFloated RadListView_Default"
>
<
div
class
=
"rlvFloated"
>
<
div
id
=
"itemPlaceholder"
runat
=
"server"
>
</
div
>
</
div
>
</
div
>
<
telerik:RadDataPager
ID
=
"RadDataPager1"
runat
=
"server"
PagedControlID
=
"RadListView1"
>
<
Fields
>
<
telerik:RadDataPagerButtonField
FieldType
=
"Numeric"
/>
</
Fields
>
</
telerik:RadDataPager
>
</
LayoutTemplate
>
.....
protected void Page_Load(object sender, EventArgs e)
{
String WhereClause = string.Empty;
//determine which button clicked http://stackoverflow.com/questions/1099020/asp-net-cross-page-posting
if (Request.Form["btnTextGeneric"] != null)
{
// do button 1 stuff
}
else if (Request.Form["btnCBFabrics"] != null)
{
/////COLORS
if (Request.Form["color_spice"] != null) { WhereClause += " OR ado_products_fabrics.color = 'spice'"; }
.....
if (WhereClause != "")
{
RadListView1.DataSource = GetDataTable("SELECT * FROM [ado_products_fabrics] WHERE 0 = 1" + WhereClause);
}
else
{
RadListView1.DataSource = GetDataTable("SELECT * FROM [ado_products_fabrics]");
}
RadListView1.DataBind();