or
if
(navigator.userAgent.indexOf(
"Trident"
)>-1&&navigator.userAgent.indexOf(
"MSIE"
)==-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;
<%@ Page Title="" Language="C#" MasterPageFile="~/masters/BrokerPlusMstr.Master" AutoEventWireup="true" CodeBehind="OfcSourceList.aspx.cs" Inherits="BrokerPlusOffice.OfcSourceList" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"HeadContent"
runat
=
"server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
runat
=
"server"
>
<
h3
>
Sources
</
h3
>
<
p
>
The Sources codes are used to describe how real estate business leads were directed to your company.
</
p
>
<
div
class
=
"container"
>
<
div
class
=
"row10"
>
<
div
class
=
"one column"
>
</
div
>
<
div
class
=
"fourteen columns"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
></
telerik:RadGrid
>
</
div
>
<
div
class
=
"one column"
>
</
div
>
</
div
>
</
div
>
<
br
/>
<
div
class
=
"container"
>
<
div
class
=
"row10"
>
<
div
class
=
"sixteen columns"
style
=
"text-align: center;"
>
<
telerik:RadButton
ID
=
"CreateNew"
runat
=
"server"
Text
=
"Create New"
CausesValidation
=
"False"
ToolTip
=
"Displays a form for adding a new Source to the database."
UseSubmitBehavior
=
"True"
OnClick
=
"CreateNew_Click"
/>
<
telerik:RadButton
ID
=
"CloseMe"
runat
=
"server"
Text
=
"Close Window"
CausesValidation
=
"False"
ToolTip
=
"Closes this window."
UseSubmitBehavior
=
"False"
OnClientClicked
=
"closemenow"
/>
</
div
>
</
div
>
</
div
>
<
div
class
=
"container"
>
<
div
class
=
"row10"
>
<
div
class
=
"sixteen columns"
style
=
"text-align: center;"
>
<
asp:Label
ID
=
"PageErrors"
runat
=
"server"
Font-Bold
=
"True"
ForeColor
=
"#C00000"
Width
=
"95%"
></
asp:Label
>
</
div
>
</
div
>
</
div
></
asp:Content
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Data;
using
System.Data.Common;
using
System.Data.Sql;
using
System.Data.SqlClient;
using
System.Web.Security;
using
System.Configuration;
using
System.Collections;
using
Telerik.Web.UI;
using
ApplDB = PublixDBCS10;
using
BrokerPlusDBCS10;
namespace
BrokerPlusOffice
{
public
partial
class
OfcSourceList : Common.THDiBasePage
{
protected
void
Page_Init(
object
sender, System.EventArgs e)
{
if
(!Page.IsPostBack)
{
// Get the users form security rules and set the buttons accordingly
string
sUserFormRules = Convert.ToString(Session[
"UserBrokerPlusFormsRules"
]);
string
sRule = sUserFormRules.Substring(40, 1);
switch
(sRule)
{
case
"0"
:
// the user is not authorized for this page, so send them to the error page
Response.Redirect(
"~/UserNotAuthorized.aspx"
);
break
;
case
"1"
:
// The user is only authorized for read-only activities, so set the buttons accordingly
this
.CreateNew.Enabled =
false
;
break
;
case
"2"
:
// The user is authorized to update data, so leave the buttons as is
break
;
}
GridHyperLinkColumn hypercolumn =
null
;
GridBoundColumn boundcolumn =
null
;
RadGrid1.ID =
"RadGrid1"
;
RadGrid1.EnableViewState =
false
;
RadGrid1.NeedDataSource +=
new
Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
RadGrid1.Width = Unit.Percentage(100);
RadGrid1.PageSize = 15;
RadGrid1.AllowPaging =
true
;
RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
RadGrid1.AutoGenerateColumns =
false
;
RadGrid1.AllowFilteringByColumn =
true
;
RadGrid1.ExportSettings.ExportOnlyData =
true
;
RadGrid1.ExportSettings.IgnorePaging =
true
;
RadGrid1.ExportSettings.HideStructureColumns =
true
;
RadGrid1.ExportSettings.OpenInNewWindow =
true
;
RadGrid1.MasterTableView.CommandItemSettings.ShowExportToCsvButton =
false
;
RadGrid1.MasterTableView.CommandItemSettings.ShowExportToExcelButton =
false
;
RadGrid1.MasterTableView.CommandItemSettings.ShowExportToPdfButton =
false
;
RadGrid1.MasterTableView.CommandItemSettings.ShowExportToWordButton =
false
;
RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton =
false
;
RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
RadGrid1.MasterTableView.Width = Unit.Percentage(100);
RadGrid1.MasterTableView.DataKeyNames =
new
string
[] {
"Source"
};
hypercolumn =
new
GridHyperLinkColumn();
hypercolumn.HeaderText =
"Edit"
;
hypercolumn.UniqueName =
"Source"
;
hypercolumn.Text =
"<img border=\"0\" alt=\"View\" src=\"../Icons/pencil_16.png\" />"
;
hypercolumn.DataNavigateUrlFields =
new
string
[] {
"Source"
};
hypercolumn.DataNavigateUrlFormatString =
"OfcSourceEdit.aspx?M=Y&K="
+
"{"
+
"0"
+
"}"
;
RadGrid1.MasterTableView.Columns.Add(hypercolumn);
hypercolumn =
null
;
boundcolumn =
new
GridBoundColumn();
boundcolumn.UniqueName =
"SourceText"
;
boundcolumn.DataField =
"SourceText"
;
boundcolumn.HeaderText =
"Source"
;
boundcolumn.Visible =
true
;
RadGrid1.MasterTableView.Columns.Add(boundcolumn);
boundcolumn =
null
;
RadGrid1.AllowPaging = Convert.ToBoolean(Session[
"ShowListsWithPaging"
]);
}
}
public
DataTable GetDataTable()
{
String ConnString = System.Configuration.ConfigurationManager.ConnectionStrings[
"BrokerPlus"
].ConnectionString;
DataTable dt =
new
DataTable();
using
(SqlConnection sqlcon =
new
SqlConnection(ConfigurationManager.ConnectionStrings[
"BrokerPlus"
].ConnectionString))
{
using
(SqlCommand cmd =
new
SqlCommand(
"Sources_GetAllBySource_Account"
, sqlcon))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(
new
SqlParameter(
"@Source_Account"
, Convert.ToInt32(Session[
"UserAccount"
])));
using
(SqlDataAdapter da =
new
SqlDataAdapter(cmd))
{
da.Fill(dt);
return
dt;
}
}
}
}
private
void
RadGrid1_NeedDataSource(
object
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
(source
as
RadGrid).DataSource = GetDataTable();
}
protected
void
CreateNew_Click(
object
sender, EventArgs e)
{
Response.Redirect(
"OfcSourceEdit.aspx?M=N&K="
);
}
}
}
<telerik:AjaxSetting AjaxControlID=
"cboKey"
>
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID=
"cboKey"
/>
<telerik:AjaxUpdatedControl ControlID=
"cboKey_X2"
/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID=
"cboKey_X2"
>
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID=
"cboKey_X2"
/>
<telerik:AjaxUpdatedControl ControlID=
"cboKey"
/>
</UpdatedControls>
</telerik:AjaxSetting>
If
Me
.cboKey.Visible =
True
OrElse
Me
.cboKey_X2.Visible =
True
Then
If
piX2 <> 0
Then
Me
.cboKey.Visible =
False
Me
.cboKey_X2.Visible =
True
ElseIf
piX2 = 0
Then
Me
.cboKey_X2.Visible =
False
Me
.cboKey.Visible =
True
End
If
Hello,
I'm using the following to provide checkboxes for row selection in one of my grids:
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"> |
<HeaderStyle Width="20px"></HeaderStyle> |
</telerik:GridClientSelectColumn> |