telerik:RadComboBox ID="RadComboBoxStringInLookupValue" Runat="server" Width="325px" AllowCustomText="True"
EmptyMessage="<%$ Resources:CommonUserMsg, EnterValueMsgResource %>" EnableTextSelection="False"
DropDownWidth="325px" HighlightTemplatedItems="True" Visible="true" OnClientDropDownClosing="OnClientDropDownClosing"
OnClientDropDownClosed="populateComboBoxEmptyMessage" CausesValidation="False" >
<
ItemTemplate
>
<
ul
>
<
li
class
=
"col1"
>
<
telerik:RadListBox
ID
=
"RadListBoxSource"
runat
=
"server"
Height
=
"125px"
DataSourceID
=
"ObjectDataSourceLookUpValues"
DataTextField
=
"Descr"
DataValueField
=
"Code"
AllowTransfer
=
"true"
TransferToID
=
"RadListBoxDestination"
AllowTransferOnDoubleClick
=
"True"
SelectionMode
=
"Multiple"
OnClientSelectedIndexChanged
=
"SetCanvasChanged"
ondatabound
=
"OnDataBound"
onitemdatabound
=
"OnItemsDataBound"
>
<
ButtonSettings
ReorderButtons
=
"Common"
></
ButtonSettings
>
</
telerik:RadListBox
>
</
li
>
<
li
class
=
"col2"
>
<
telerik:RadListBox
ID
=
"RadListBoxDestination"
runat
=
"server"
Height
=
"125px"
SelectionMode
=
"Multiple"
>
<
ButtonSettings
ReorderButtons
=
"Common"
></
ButtonSettings
>
</
telerik:RadListBox
>
</
li
>
</
ul
>
</
ItemTemplate
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
""
/>
</
Items
>
</
telerik:RadComboBox
>
function
OnClientDropDownClosing(sender, args) {
args.set_cancel(
false
);
var
target = args.get_domEvent().target;
//cancel drop-down closing only when clicked inside and not on the arrow
if
(target && target != sender.get_imageDomElement() && (jQuery.contains(sender.get_element(), target) ||
jQuery.contains(sender.get_dropDownElement(), target)))
{
args.set_cancel(
true
);
}
}
tableView.dataBind(); the RadGridPractices_DataBinding function is not invoked and
the grid continues to display the old rows and adds the 'No records to display' message at the bottom of the grid. Paging, sorting, filtering all work and i am calling the same webmethod for my rebind. I wonder if it is something to do with the non standard Grid DataBinding parameters? I have looked at various examples and the Client-side binding topic. I am at a loss.{"d":{"Practices":[{"PracticeID":2,"PTypeID":1,"PracticeDesc":"Storage Tank 1","PracticeType":"Aboveground storage tank","AspectID":4,"luAspectID":3,"Aspect":"Electricity use","ImpactID":0,"luImpactID":0,"Impact":"","IsActive":true,"Score":"11.2","ScoreMax":"55","ScoreAvg":"24.62"},{"PracticeID":2,"PTypeID":1,"PracticeDesc":"Storage Tank 1","PracticeType":"Aboveground storage tank","AspectID":5,"luAspectID":4,"Aspect":"Fire/explosion","ImpactID":0,"luImpactID":0,"Impact":"","IsActive":true,"Score":"55","ScoreMax":"55","ScoreAvg":"24.62"}],"PracticeCount":11}}
<telerik:RadCodeBlock ID=
"RadCodeBlock1"
runat=
"server"
>
<script type=
"text/javascript"
>
function
RadButtonIncludeAspects_OnClientCheckedChanged(sender, args) {
var
aspectsButton = $find(
"<%= RadButtonIncludeAspects.ClientID %>"
);
var
impactsButton = $find(
"<%= RadButtonIncludeImpacts.ClientID %>"
);
if
(!aspectsButton.get_checked()) {
// need aspects to select impacts
impactsButton.set_checked(
false
);
}
var
includeAspects = aspectsButton.get_checked().toString();
var
includeImpacts = impactsButton.get_checked().toString();
var
tableView = $find(
"<%= RadGridPractices.ClientID %>"
).get_masterTableView();
var
currentPageIndex = tableView.get_currentPageIndex();
var
pageSize = tableView.get_pageSize();
var
sortExpressions = tableView.get_sortExpressions();
var
filterExpressions = tableView.get_filterExpressions();
PageMethods.GetPracticesAndCount(currentPageIndex, pageSize,
""
,
""
, installationID,
installationModifier, environmentalWeight, regulatoryWeight,
publicPerceptionWeight, healthAndSafetyWeight, includeAspects, includeImpacts, bindGrid);
}
function
bindGrid(result) {
//debugger;
var
tableView = $find(
"<%= RadGridPractices.ClientID %>"
).get_masterTableView();
tableView.set_dataSource(result);
tableView.dataBind();
//var grid = $find("<%= RadGridPractices.ClientID %>");
//grid.repaint();
}
function
RadGridPractices_OnCommand(sender, args) {
// Handle the RadGrid's Command event here
}
function
RadGridPractices_OnRowDataBound(sender, args) {
//debugger;
if
(args.get_dataItem()[
'Score'
] >= 18) {
args.get_item().get_cell(
'column'
).style.color=
'#FF3300'
;
args.get_item().get_cell(
'PracticeType'
).style.color=
'#FF3300'
;
args.get_item().get_cell(
'PracticeDesc'
).style.color=
'#FF3300'
;
args.get_item().get_cell(
'Aspect'
).style.color=
'#FF3300'
;
args.get_item().get_cell(
'Impact'
).style.color=
'#FF3300'
;
args.get_item().get_cell(
'Score'
).style.color=
'#FF3300'
;
args.get_item().get_cell(
'ScoreAvg'
).style.color=
'#FF3300'
;
args.get_item().get_cell(
'ScoreMax'
).style.color=
'#FF3300'
;
}
else
if
(args.get_dataItem()[
'Score'
] >= 11) {
args.get_item().get_cell(
'column'
).style.color=
'#FF9900'
;
args.get_item().get_cell(
'PracticeType'
).style.color=
'#FF9900'
;
args.get_item().get_cell(
'PracticeDesc'
).style.color=
'#FF9900'
;
args.get_item().get_cell(
'Aspect'
).style.color=
'#FF9900'
;
args.get_item().get_cell(
'Impact'
).style.color=
'#FF9900'
;
args.get_item().get_cell(
'Score'
).style.color=
'#FF9900'
;
args.get_item().get_cell(
'ScoreAvg'
).style.color=
'#FF9900'
;
args.get_item().get_cell(
'ScoreMax'
).style.color=
'#FF9900'
;
}
else
if
(args.get_dataItem()[
'Score'
] >= 7) {
args.get_item().get_cell(
'column'
).style.color=
'#00CC00'
;
args.get_item().get_cell(
'PracticeType'
).style.color=
'#00CC00'
;
args.get_item().get_cell(
'PracticeDesc'
).style.color=
'#00CC00'
;
args.get_item().get_cell(
'Aspect'
).style.color=
'#00CC00'
;
args.get_item().get_cell(
'Impact'
).style.color=
'#00CC00'
;
args.get_item().get_cell(
'Score'
).style.color=
'#00CC00'
;
args.get_item().get_cell(
'ScoreAvg'
).style.color=
'#00CC00'
;
args.get_item().get_cell(
'ScoreMax'
).style.color=
'#00CC00'
;
}
else
{
args.get_item().get_cell(
'column'
).style.color=
'#000000'
;
args.get_item().get_cell(
'PracticeType'
).style.color=
'#000000'
;
args.get_item().get_cell(
'PracticeDesc'
).style.color=
'#000000'
;
args.get_item().get_cell(
'Aspect'
).style.color=
'#000000'
;
args.get_item().get_cell(
'Impact'
).style.color=
'#000000'
;
args.get_item().get_cell(
'Score'
).style.color=
'#000000'
;
args.get_item().get_cell(
'ScoreAvg'
).style.color=
'#000000'
;
args.get_item().get_cell(
'ScoreMax'
).style.color=
'#000000'
;
}
}
function
RadGridPractices_DataBinding(sender, args) {
alert(
'databinding'
);
var
aspectsButton = $find(
"<%= RadButtonIncludeAspects.ClientID %>"
);
var
includeAspects = aspectsButton.get_checked().toString();
var
impactsButton = $find(
"<%= RadButtonIncludeImpacts.ClientID %>"
);
var
includeImpacts = impactsButton.get_checked().toString();
var
methodArguments = args.get_methodArguments();
var
myMethodArguments = methodArguments;
myMethodArguments.installationID = installationID;
myMethodArguments.installationModifier = installationModifier;
myMethodArguments.environmentalWeight = environmentalWeight;
myMethodArguments.regulatoryWeight = regulatoryWeight;
myMethodArguments.publicPerceptionWeight = publicPerceptionWeight;
myMethodArguments.healthAndSafetyWeight = healthAndSafetyWeight;
myMethodArguments.includeAspects = includeAspects;
myMethodArguments.includeImpacts = includeImpacts;
args.set_methodArguments(myMethodArguments);
};
function
RadGridPractices_OnRowSelected(sender, args) {
// alert('TODO: Highlight associated Commands and Locations');
};
function
RadGridPractices_OnRowDeselected(sender, args) {
// alert('TODO: Highlight associated Commands and Locations');
};
</script>
</telerik:RadCodeBlock>
<table style=
"width: 100%;"
>
<tr>
<td>
<telerik:RadButton ID=
"RadButtonIncludeAspects"
runat=
"server"
ButtonType=
"ToggleButton"
Text=
"Include Aspects"
ToggleType=
"CheckBox"
Checked=
"True"
onclientcheckedchanged=
"RadButtonIncludeAspects_OnClientCheckedChanged"
AutoPostBack=
"False"
>
</telerik:RadButton>
<telerik:RadButton ID=
"RadButtonIncludeImpacts"
runat=
"server"
ButtonType=
"ToggleButton"
Text=
"Include Impacts"
ToggleType=
"CheckBox"
Checked=
"True"
OnClientCheckedChanged=
"RadButtonIncludeImpacts_OnClientCheckedChanged"
AutoPostBack=
"False"
>
</telerik:RadButton>
</td>
</tr>
<tr>
<td>
<telerik:RadGrid ID=
"RadGridPractices"
runat=
"server"
AllowPaging=
"True"
GridLines=
"None"
PageSize=
"2"
AllowFilteringByColumn=
"True"
AllowSorting=
"True"
AllowMultiRowSelection=
"True"
>
<HeaderContextMenu CssClass=
"GridContextMenu GridContextMenu_Default"
></HeaderContextMenu>
<MasterTableView AutoGenerateColumns=
"False"
>
<CommandItemSettings ExportToPdfText=
"Export to Pdf"
></CommandItemSettings>
<RowIndicatorColumn FilterControlAltText=
"Filter RowIndicator column"
>
<HeaderStyle Width=
"20px"
></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText=
"Filter ExpandColumn column"
>
<HeaderStyle Width=
"20px"
></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridClientSelectColumn FilterControlAltText=
"Filter column column"
UniqueName=
"column"
>
</telerik:GridClientSelectColumn>
<%-- <telerik:GridBoundColumn DataField=
"PracticeID"
DataType=
"System.Int32"
FilterControlAltText=
"Filter PracticeID column"
HeaderText=
"ID"
ReadOnly=
"True"
SortExpression=
"PracticeID"
UniqueName=
"PracticeID"
>
</telerik:GridBoundColumn>--%>
<telerik:GridBoundColumn DataField=
"PracticeType"
FilterControlAltText=
"Filter PracticeType column"
HeaderText=
"Practice Type"
ReadOnly=
"True"
SortExpression=
"PracticeType"
UniqueName=
"PracticeType"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"PracticeDesc"
FilterControlAltText=
"Filter PracticeDesc column"
HeaderText=
"Practice"
ReadOnly=
"True"
SortExpression=
"PracticeDesc"
UniqueName=
"PracticeDesc"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"Aspect"
FilterControlAltText=
"Filter Aspect column"
HeaderText=
"Aspect"
ReadOnly=
"True"
SortExpression=
"Aspect"
UniqueName=
"Aspect"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"Impact"
FilterControlAltText=
"Filter Impact column"
HeaderText=
"Impact"
ReadOnly=
"True"
SortExpression=
"Impact"
UniqueName=
"Impact"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"Score"
FilterControlAltText=
"Filter Score column"
HeaderText=
"Score"
ReadOnly=
"True"
SortExpression=
"Score"
UniqueName=
"Score"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"ScoreAvg"
FilterControlAltText=
"Filter ScoreAvg column"
HeaderText=
"Avg"
ReadOnly=
"True"
SortExpression=
"ScoreAvg"
UniqueName=
"ScoreAvg"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"ScoreMax"
FilterControlAltText=
"Filter ScoreMax column"
HeaderText=
"Max"
ReadOnly=
"True"
SortExpression=
"ScoreMax"
UniqueName=
"ScoreMax"
>
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText=
"Filter EditCommandColumn column"
></EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<DataBinding Location=
"PAI.aspx"
SelectMethod=
"GetPracticesAndCount"
FilterParameterType=
"Linq"
CountPropertyName=
"PracticeCount"
DataPropertyName=
"Practices"
FilterParameterName=
"filterExpressions"
MaximumRowsParameterName=
"rowCount"
SortParameterName=
"sortExpressions"
SortParameterType=
"Linq"
StartRowIndexParameterName=
"startIndex"
>
</DataBinding>
<Selecting AllowRowSelect=
"True"
EnableDragToSelectRows=
"true"
/>
<ClientEvents OnDataBinding=
"RadGridPractices_DataBinding"
OnRowSelected=
"RadGridPractices_OnRowSelected"
OnRowDeselected=
"RadGridPractices_OnRowDeselected"
OnRowDataBound=
"RadGridPractices_OnRowDataBound"
OnCommand=
"RadGridPractices_OnCommand"
/>
</ClientSettings>
<FilterMenu EnableImageSprites=
"False"
></FilterMenu>
</telerik:RadGrid>
</td>
</tr>
</table>
<
telerik:RadGrid ID="RadGrid1" ShowFooter="true"
Width="99%" EnableLinqExpressions="false" FooterStyle-CssClass="GridColHeadNormal"
AllowSorting="True" runat="server">
<MasterTableView ClientDataKeyNames="KEYID">
<Columns>
<telerik:GridBoundColumn HeaderText="Employee Name" DataField="Name" UniqueName="Name"
SortExpression="Name" FilterControlWidth="100%" AutoPostBackOnFilter="true"
CurrentFilterFunction="contains" ShowFilterIcon="false" Resizable="False" />
<telerik:GridBoundColumn HeaderText="SSN" DataField="EMP_SSN"
UniqueName="SSN" SortExpression="EMP_SSN" FilterControlWidth="100px" AutoPostBackOnFilter="true"
CurrentFilterFunction="contains" ShowFilterIcon="false" Resizable="False" />
<telerik:GridBoundColumn HeaderText="Pay Period" DataField="CODE" SortExpression="CODE"
UniqueName="CODE" AutoPostBackOnFilter="true" Resizable="False" >
<FilterTemplate>
<telerik:RadComboBox ID="RadComboBoxPP" DataSourceID="SqlDataSourcePP" DataTextField="Code" Width="100px"
DataValueField="Code" Height="100px" AppendDataBoundItems="true" OnClientSelectedIndexChanged="SelectedIndexChanged"
SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Code").CurrentFilterValue %>'
runat="server">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function SelectedIndexChanged(sender,args) {
var tableView=$find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
sender.value= args.get_item().get_value();
tableView.filter(
"CODE",args.get_item().get_value(),"EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Department" Aggregate="Count" DataField="Department" SortExpression="Department"
UniqueName="Department" AutoPostBackOnFilter="true" Resizable="False" >
<FilterTemplate>
<telerik:RadComboBox ID="RadComboBoxDep" DataSourceID="SqlDataSourceDepartment" DataTextField="Department"
DataValueField="Department" Height="100px" AppendDataBoundItems="true" OnClientSelectedIndexChanged="SelectedIndexChanged2"
SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Department").CurrentFilterValue %>'
runat="server">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
<script type="text/javascript">
function SelectedIndexChanged2(sender,args) {
var tableView=$find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
sender.value= args.get_item().get_value();
tableView.filter(
"Department",args.get_item().get_value(),"EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
<FooterStyle CssClass="GridColHeadNormal" />
</telerik:GridBoundColumn>
<telerik:GridNumericColumn Aggregate="Count" DataField="KEYID" Display="false"
UniqueName="KEYID" SortExpression="KEYID" ShowFilterIcon="false" AllowFiltering="false" />
</Columns>
</MasterTableView>
<ClientSettings AllowGroupExpandCollapse="False" AllowExpandCollapse="False" ReorderColumnsOnClient="False" Resizing-AllowColumnResize="False" Resizing-ClipCellContentOnResize="True" Scrolling-ScrollHeight="350px">
<ClientEvents OnRowSelected="RowSelected" />
</ClientSettings>
</telerik:RadGrid>
css
.normal
{
font-family: Verdana, 'MS Sans Serif';
font-weight: normal;
font-size: 8pt;
}
.GridColHeadNormal
{
background-color: #3969A5;
color:White ;
font-weight:normal;
font-size: 8pt;
width: 1%;
text-align: center;
}
.GridRow
{
padding-right: 5px;
padding-left: 3px;
cursor: pointer;
background-color: white;
height: 18px;
white-space: nowrap;
vertical-align: top;
text-align: left;
}
.GridAltRow
{
padding-right: 5px;
padding-left: 3px;
/*background-color: #EFE7EF;*/
background-color: #efefef;
cursor: pointer;
height: 18px;
white-space: nowrap;
vertical-align: top;
text-align: left;
}
Base class page load
Protected Sub SetRadGridProperties(ByVal grd As RadGrid)
Try
grd.EnableEmbeddedSkins =
False
grd.AutoGenerateColumns =
False
grd.CssClass =
"normal"
'grd.ShowFooter = False
grd.BorderColor = System.Drawing.Color.FromArgb(66, 105, 99)
grd.BorderWidth =
New System.Web.UI.WebControls.Unit("1")
'grd.GridLines = GridLines.Both
grd.CellPadding = 0
grd.CellSpacing = 0
grd.BorderStyle = System.Web.UI.WebControls.BorderStyle.Outset
grd.HeaderStyle.Height =
New System.Web.UI.WebControls.Unit("24")
grd.HeaderStyle.Width =
New System.Web.UI.WebControls.Unit("1")
grd.HeaderStyle.VerticalAlign = VerticalAlign.NotSet
grd.HeaderStyle.CssClass =
"GridColHeadNormal"
grd.ItemStyle.CssClass =
"GridRow"
grd.AlternatingItemStyle.CssClass =
"GridAltRow"
grd.PagerStyle.Height =
New System.Web.UI.WebControls.Unit("18")
grd.PagerStyle.HorizontalAlign = HorizontalAlign.NotSet
grd.PagerStyle.Mode = System.Web.UI.WebControls.PagerMode.NumericPages
grd.AllowSorting =
True
grd.EnableLinqExpressions =
False
grd.AllowFilteringByColumn =
True
grd.ClientSettings.Selecting.AllowRowSelect =
True
grd.ClientSettings.Scrolling.UseStaticHeaders =
True
grd.AllowMultiRowSelection =
True
grd.GridLines = GridLines.Both
''grd.ClientSettings.Scrolling.ScrollHeight = Unit.Percentage(60)
grd.ClientSettings.Scrolling.AllowScroll =
True
grd.FilterItemStyle.Height = Unit.Pixel(30)
Catch ex As Exception
End Try
End Sub
Protected
Sub BindGrid2()
Dim sFilter As String = ""
Dim ssnLookUp As String = "" '--filter text box type #+, etc
Dim nKeyID As Integer = -1 '--selected criteria id
Dim iMode As Integer = 0 '--filter combo
Dim sEnhSQL As String = "1=1"
Dim blnTerm As Boolean = False '--Not clear
Dim sNumEmpNo As String = "Y" '--if emp no is numeric > global setting
Dim sValidateEmp As String = "N" '--if validate emp > global setting
Dim obj As New PerfectEmployee
Dim strExcep As String = ""
Try
If Not Page.IsPostBack Then
sourceMode =
"(For Groups)"
If obj.GetData(SqlDataSourceGroups, strExcep, "groups") = False Then
Throw New Exception(strExcep.ToString)
End If
sourceMode =
"(For Users)"
If obj.GetData(SqlDataSourceUsers, strExcep, "users") = False Then
Throw New Exception(strExcep.ToString)
End If
End If
If isSelIndex = False Then BindFilters()
sourceMode =
"(For Departments)"
If obj.GetData(SqlDataSourceDepartment, strExcep, "departments") = False Then
Throw New Exception(strExcep.ToString)
End If
sourceMode =
"(For Payperiods)"
If obj.GetData(SqlDataSourcePP, strExcep, "payperiods") = False Then
Throw New Exception(strExcep.ToString)
End If
iDisplayMode = 1
'--Name
sFilter = txtSearch.Text &
""
If sFilter.Trim <> "" Then
If sFilter.Substring(0, 1) >= "0" And sFilter.Substring(0, 1) <= "9" Then
ssnLookUp =
"TRUE"
iDisplayMode = 2
'--SSN Mumber
End If
If sFilter.Substring(0, 1) = "#" Then
iDisplayMode = 3
'--emp number
ElseIf sFilter.Substring(0, 1) = "+" Then
iDisplayMode = 4
'--Pay File Number
End If
End If
G_StrAdCriteria =
"1=1"
iMode = cmbMode.SelectedIndex
If (cmbCriteria.SelectedIndex >= cmbCriteria.Items.Count - 1) Then
G_StrAdCriteria = Request.Form(
"hdAdCriteria") & ""
If IsNumeric(G_StrAdCriteria) Then
nKeyID =
CInt(G_StrAdCriteria)
G_StrAdCriteria = GetCriteriaFormula(nKeyID)
G_StrAdCriteria = NulltoNone(G_StrAdCriteria,
"1=1")
End If
ElseIf (cmbCriteria.SelectedIndex <> 0) Then
Dim sPart1 As String = cmbCriteria.SelectedItem.Value.Split("|")(0).ToString()
Dim sPart2 As String = cmbCriteria.SelectedItem.Value.Split("|")(1).ToString()
sFlagForCrit = sPart2
nKeyID =
CInt(sPart1)
Dim sSelText As String
sSelText = cmbCriteria.SelectedItem.Text
'-- to avoid unhandled NULL statements.
If InStr(sSelText, "(filter)") > 0 Then
G_StrAdCriteria =
""
Else
G_StrAdCriteria = GetCriteriaFormula(nKeyID) &
"" '--check if criteria selected
End If
End If
G_StrAdCriteria = NulltoNone(G_StrAdCriteria,
"1=1")
'Code to filter employees based on groups, department and Payperiods
If radioGD.Items(1).Selected = True Then
G_StrAdCriteria = G_StrAdCriteria &
" and employee_main.keyid in (Select emp_key from employee_group where GRP_Key = " & cmbGroup.Items(cmbGroup.SelectedIndex).Value & ") "
'ElseIf radioGD.Items(2).Selected = True Then
' G_StrAdCriteria = G_StrAdCriteria & " and employee_main.keyid in (Select emp_key from employee_Department where DEP_KEY = " & cmbDepartment.Items(cmbDepartment.SelectedIndex).Value & ") "
'ElseIf radioGD.Items(3).Selected = True Then
' G_StrAdCriteria = G_StrAdCriteria & " and employee_main.EmpPayPeriodCd=" & cmbPayPeriod.Items(cmbPayPeriod.SelectedIndex).Value & " "
End If
'grid
RadGrid1.MasterTableView.GetColumn(
"Name").HeaderStyle.Width = Unit.Percentage(25)
RadGrid1.MasterTableView.GetColumn(
"SSN").HeaderStyle.Width = Unit.Percentage(25)
RadGrid1.MasterTableView.GetColumn(
"CODE").HeaderStyle.Width = Unit.Percentage(20)
RadGrid1.MasterTableView.GetColumn(
"Department").HeaderStyle.Width = Unit.Percentage(25)
RadGrid1.MasterTableView.GetColumn(
"KEYID").HeaderStyle.Width = Unit.Point(0)
SqlDataSourceGrid.ConnectionString = conString
SqlDataSourceGrid.SelectCommand =
"spFilterEmployee"
SqlDataSourceGrid.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
SqlDataSourceGrid.SelectParameters.Clear()
SqlDataSourceGrid.SelectParameters.Add(
"Mode", cmbMode.SelectedIndex)
SqlDataSourceGrid.SelectParameters.Add(
"gtxtEnhancedSQL", sEnhSQL)
SqlDataSourceGrid.SelectParameters.Add(
"Term", 0)
SqlDataSourceGrid.SelectParameters.Add(
"strAdditionalCriteria", G_StrAdCriteria)
SqlDataSourceGrid.SelectParameters.Add(
"NUMERICEMPNBR", sNumEmpNo)
SqlDataSourceGrid.SelectParameters.Add(
"EMPVALIDATION", sValidateEmp)
RadGrid1.DataSourceID =
"SqlDataSourceGrid"
Catch excep As Exception
DisplayError(excep)
Finally
'If (Not objDS Is Nothing) Then
' objDS.Dispose()
' objDS = Nothing
'End If
'If (Not objDS Is Nothing) Then
' objDV.Dispose()
' objDV = Nothing
'End If
'If (Not objEmp Is Nothing) Then
' objEmp.Dispose()
' objEmp = Nothing
'End If
'If (Not objIntegration Is Nothing) Then
' objIntegration.Dispose()
' objIntegration = Nothing
'End If
'If (Not objCombo Is Nothing) Then
' objCombo.Dispose()
' objCombo = Nothing
'End If
End Try
End Sub
<
telerik:AjaxSetting
AjaxControlID
=
"RadCategoriesTreeView"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"TextItemPanel"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadCategoriesTreeView
"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
protected
void
IncrementalSearchEvent(
object
sender, RadComboBoxItemsRequestedEventArgs e)
{
ClientBLL clientBLL =
new
ClientBLL();
var clients = clientBLL.IncrementalSearch(e.Text, Int32.Parse(rdoStatus.SelectedValue), 4);
foreach
(NameValuePair client
in
clients)
{
CachePerson obj = ObjectTools.GetObjectPerson(client.Value);
RadComboBoxItem item =
new
RadComboBoxItem();
item.Attributes[
"FirstName"
] = obj.FirstName;
item.Attributes[
"LastName"
] = obj.LastName;
item.Text = obj.FullName;
item.Value = obj.PersonId.ToString();
selSelectedClient.Items.Add(item);
}
selSelectedClient.DataBind();
}
<
telerik:RadComboBox
ID
=
"selSelectedClient"
runat
=
"server"
Skin
=
"Telerik"
EnableLoadOnDemand
=
"true"
onitemsrequested
=
"IncrementalSearchEvent"
>
<
HeaderTemplate
>
<
table
border
=
"0"
width
=
"590"
>
<
tr
>
<
td
width
=
"100"
>First Name</
td
>
<
td
width
=
"100"
>Last Name</
td
>
</
tr
>
</
table
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
table
border
=
"0"
width
=
"590"
><
tr
>
<
td
width
=
"100"
><%# DataBinder.Eval(Container, "Attributes['FirstName']")%></
td
>
<
td
width
=
"100"
><%# DataBinder.Eval(Container, "Attributes['LastName']")%></
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
telerik:RadComboBox
>