or
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RecordSelect.ascx.cs" Inherits="RecordSelect" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
script
type
=
"text/javascript"
>
var call = 0;
function SetValue<%=XmlHttpPanel1.ClientID %>(count) {
var panel = $find("<%=XmlHttpPanel1.ClientID %>");
//you can pass any kind of object to the GetHTML method
//right now we will pass an array
var array = [];
if (document.getElementById('<%=txtSearchString.ClientID %>').value.length > 1 && count == call) {
array[0] = document.getElementById('<%=txtSearchString.ClientID %>').value;
array[1] = "<%=XmlHttpPanel1.ClientID %>";
array[2] = document.getElementById('<%= hidANE.ClientID %>').value;
call = 0;
//you can pass any kind of object to the GetHTML method
//right now we will pass an array
panel.set_value(array);
}
}
function GetData<%=XmlHttpPanel1.ClientID %>() {
call++;
setTimeout('SetValue<%=XmlHttpPanel1.ClientID %>(' + call + ')', 200);
}
function RecordClicked<%=XmlHttpPanel1.ClientID %>(Name, ID) {
document.getElementById('<%= hidId.ClientID %>').value = ID;
document.getElementById('<%= txtSearchString.ClientID %>').value = Name;
var panel = $find("<%=XmlHttpPanel1.ClientID %>");
// this will clear the xmlhttp panel.
//document.getElementById('divTypeAheadOptions').parentNode.innerHTML = '';
$find('<%= txtSearchString.ClientID %>').updateDisplayValue();
__doPostBack('<%= cmdHid.ClientID %>','');
}
function AddNewClicked<%=XmlHttpPanel1.ClientID %>() {
document.getElementById('<%= hidId.ClientID %>').value = -1;
__doPostBack('<%= cmdHid.ClientID %>','');
}
</
script
>
<
telerik:RadTextBox
ID
=
"txtSearchString"
runat
=
"server"
EmptyMessage
=
""
Width
=
"300px"
>
</
telerik:RadTextBox
>
<
telerik:RadXmlHttpPanel
runat
=
"server"
ID
=
"XmlHttpPanel1"
WebMethodPath
=
"~/services/TypeAhead.asmx"
WebMethodName
=
""
RenderMode
=
"Block"
EnableClientScriptEvaluation
=
"true"
>
</
telerik:RadXmlHttpPanel
>
<
asp:HiddenField
runat
=
"server"
ID
=
"hidId"
/>
<
asp:HiddenField
runat
=
"server"
ID
=
"hidANE"
/>
<
asp:Button
runat
=
"server"
ID
=
"cmdHid"
CausesValidation
=
"false"
style
=
"display: none;"
/>
<
telerik:RadAjaxPanel
ID
=
"radAjaxPanel1"
runat
=
"server"
>
<
uc1:RecordSelect
runat
=
"server"
ID
=
"selCompany"
Type
=
"Companies"
EnabledAddNew
=
"True"
/>
...
<
oscarcontrols:OscarGrid
runat
=
"server"
ID
=
"grdProcessOrders"
AutoGenerateColumns
=
"false"
Visible
=
"true"
PageSize
=
"20"
AllowPaging
=
"true"
ShowHeader
=
"true"
Width
=
"100%"
AllowSorting
=
"true"
EnableEmbeddedSkins
=
"false"
DataKeyNames
=
"OrdID"
OnPageIndexChanged
=
"grdProcessOrders_PageIndexChanged"
OnPageSizeChanged
=
"grdProcessOrders_PageSizeChanged"
OnItemCommand
=
"grdProcessOrders_ItemCommand"
OnSelectedIndexChanged
=
"grdProcessOrders_SelectedIndexChanged"
OnItemDataBound
=
"grdProcessOrders_ItemDataBound"
OnDataBound
=
"grdProcessOrders_DataBound"
Skin
=
"OSCARGridStyle1"
OnSortCommand
=
"grdProcessOrders_SortCommand"
OnItemCreated
=
"grdProcessOrders_ItemCreated"
>
<
ClientSettings
EnableRowHoverStyle
=
"true"
EnableAlternatingItems
=
"false"
EnablePostBackOnRowClick
=
"true"
>
<%--<
ClientEvents
OnGridCreated
=
"ProcOrdGridCreate"
/> --%>
<
Selecting
AllowRowSelect
=
"True"
/>
<%-- <
ClientEvents
OnRowContextMenu
=
"RowContextMenu"
/> --%>
</
ClientSettings
>
<
PagerStyle
Position
=
"TopAndBottom"
Mode
=
"NumericPages"
Width
=
"100%"
AlwaysVisible
=
"false"
/>
<
MasterTableView
OnPreRender
=
"grdProcessOrders_PreRender"
DataKeyNames
=
"OrdID"
>
<
NoRecordsTemplate
>
<
oscarcontrols:OscarPanel
runat
=
"server"
ID
=
"pnlNoRecords"
Width
=
"100%"
CssClass
=
"procOrdersNoRecordsFound"
>
<
h2
>
<
oscarcontrols:OscarLabel
runat
=
"server"
ID
=
"lblSorry"
Text
=
"Sorry. Try Again."
/></
h2
>
<
oscarcontrols:OscarLabel
runat
=
"server"
ID
=
"lblNoRecords"
Text
=
"There were no records found that matched your search criteria."
/><
br
/>
<
br
/>
</
oscarcontrols:OscarPanel
>
</
NoRecordsTemplate
>
<
PagerTemplate
>
<
table
width
=
"100%"
>
<
tr
>
<
td
style
=
"padding-left: 5px"
>
<
oscarcontrols:OscarLabel
runat
=
"server"
ID
=
"lblResultsFoundValue"
Text='<%# DataBinder.Eval(Container, "Paging.DataSourceCount")%>'
Font-Bold="true" />
<
b
>
<
oscarcontrols:OscarLabel
runat
=
"server"
ID
=
"lblResultsFound"
Text
=
"Results Found."
Font-Bold
=
"true"
/></
b
>
</
td
>
<
td
align
=
"right"
style
=
"padding-right: 5px"
>
<
table
>
<
tr
>
<
td
>
<
oscarcontrols:OscarLabel
runat
=
"server"
ID
=
"lblResultPerPage"
Text
=
"Results per Page:"
/>
<
oscarcontrols:OscarComboBox
ID
=
"ProcOrdRadComboBox1"
DataSource="<%# new object[]{10, 20, 30, 40, 50} %>"
SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>' Style="margin-right: 20px;"
Width="40px" runat="server" OnClientSelectedIndexChanged="ProcOrdRadComboBox1_SelectedIndexChanged">
</
oscarcontrols:OscarComboBox
>
</
td
>
<
td
>
<
oscarcontrols:OscarImageButton
ID
=
"Button1"
runat
=
"server"
ImageUrl
=
"~/Images/PagingFirst.gif"
OnClientClick
=
"ProcOrdchangePage('first'); return false;"
CommandName
=
"Page"
CommandArgument
=
"First"
/>
<
oscarcontrols:OscarImageButton
ID
=
"Button2"
runat
=
"server"
ImageUrl
=
"~/Images/PagingPrev.gif"
OnClientClick
=
"ProcOrdchangePage('prev'); return false;"
CommandName
=
"Page"
CommandArgument
=
"Prev"
/>
</
td
>
<
td
>
<
oscarcontrols:OscarPanel
runat
=
"server"
ID
=
"NumericPagerPlaceHolder"
/>
</
td
>
<
td
>
<
oscarcontrols:OscarImageButton
ID
=
"ImageButton1"
runat
=
"server"
ImageUrl
=
"~/Images/PagingNext.gif"
OnClientClick
=
"ProcOrdchangePage('next'); return false;"
CommandName
=
"Page"
CommandArgument
=
"Next"
/>
<
oscarcontrols:OscarImageButton
ID
=
"ImageButton2"
runat
=
"server"
ImageUrl
=
"~/Images/PagingLast.gif"
OnClientClick
=
"ProcOrdchangePage('last'); return false;"
CommandName
=
"Page"
CommandArgument
=
"Last"
/>
</
td
>
</
tr
>
</
table
>
</
td
>
</
tr
>
</
table
>
</
PagerTemplate
>
grdProcessOrders.DataSource = GetSortedOrders(
false
);
grdProcessOrders.DataBind();
function
if
var buttonID = document.getElementById('<%=HiddenField1.ClientID %>'
document.getElementById(buttonID).click(); /// not being supported by non i.e like Safari and firefox
IsChecked =
false ;
}
}
Thanks
<
telerik:RadGrid
ID
=
"gvPreview"
AutoGenerateColumns
=
"true"
AllowPaging
=
"True"
PageSize
=
"10"
runat
=
"server"
GridLines
=
"vertical"
Width
=
"99%"
AllowSorting
=
"true"
OnPreRender
=
"gvPreview_PreRender"
Font-Bold
=
"true"
EnableViewState
=
"true"
EnableTheming
=
"false"
Height
=
"380px"
AllowFilteringByColumn
=
"true"
OnPageIndexChanged
=
"gvPreview_PageIndexChanged"
OnNeedDataSource
=
"gvPreview_NeedDataSource"
OnPageSizeChanged
=
"gvPreview_PageSizeChanged"
>
<
ExportSettings
HideStructureColumns
=
"true"
IgnorePaging
=
"true"
OpenInNewWindow
=
"true"
ExportOnlyData
=
"true"
>
</
ExportSettings
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
ItemStyle
CssClass
=
"grid-content-Maintext"
HorizontalAlign
=
"Left"
ForeColor
=
"Black"
VerticalAlign
=
"Middle"
BackColor
=
"#f4fdff"
></
ItemStyle
>
<
AlternatingItemStyle
CssClass
=
"grid-content-Alttext"
HorizontalAlign
=
"Left"
ForeColor
=
"Black"
VerticalAlign
=
"Top"
BackColor
=
"White"
/>
<
HeaderStyle
CssClass
=
"background_dbf7ff lineHeight_25px"
Font-Bold
=
"True"
HorizontalAlign
=
"Left"
Wrap
=
"true"
ForeColor
=
"Black"
VerticalAlign
=
"Middle"
BackColor
=
"#f4fdff"
Font-Names
=
"Arial"
Font-Size
=
"11px"
/>
<
PagerStyle
CssClass
=
"background_dbf7ff lineHeight_25px"
/>
<
SelectedItemStyle
CssClass
=
"background_dbf7ff lineHeight_25px"
/>
<
GroupHeaderItemStyle
CssClass
=
"background_dbf7ff lineHeight_25px"
/>
<
ActiveItemStyle
CssClass
=
"background_dbf7ff lineHeight_25px"
/>
<
CommandItemStyle
CssClass
=
"background_dbf7ff lineHeight_25px"
/>
<
SortingSettings
EnableSkinSortStyles
=
"False"
/>
<
FilterItemStyle
BackColor
=
"#DBF7FF"
BorderStyle
=
"Solid"
/>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
AlwaysVisible
=
"true"
/>
<
MasterTableView
Width
=
"100%"
CommandItemDisplay
=
"Top"
CommandItemStyle-HorizontalAlign
=
"Right"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
CommandItemSettings
ShowExportToExcelButton
=
"true"
ShowAddNewRecordButton
=
"false"
ShowRefreshButton
=
"false"
/>
</
MasterTableView
>
<
ClientSettings
AllowDragToGroup
=
"true"
AllowColumnsReorder
=
"true"
ReorderColumnsOnClient
=
"true"
ColumnsReorderMethod
=
"Reorder"
>
<
Animation
AllowColumnReorderAnimation
=
"true"
AllowColumnRevertAnimation
=
"true"
/>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
SaveScrollPosition
=
"True"
>
</
Scrolling
>
</
ClientSettings
>
<
PagerStyle
AlwaysVisible
=
"true"
></
PagerStyle
>
</
telerik:RadGrid
>