or
| <asp:ObjectDataSource ID="dsEmplTable" runat="server" DataObjectTypeName="TableObjects.EmplTable" |
| TypeName="TableObjects.EmplTableAdapter" DeleteMethod="DeleteEmplTable" |
| InsertMethod="InsertEmplTable" SelectMethod="SelectEmplTable" UpdateMethod="UpdateEmplTable" |
| OldValuesParameterFormatString="original_{0}" EnableCaching="true" CacheDuration="10" |
| SortParameterName="sortExpression" SelectCountMethod="SelectCount" |
| EnablePaging="true" StartRowIndexParameterName="startRow" MaximumRowsParameterName="pageSize" |
| > |
| [DataObjectMethod(DataObjectMethodType.Select, true)] |
| public EmplTableList SelectEmplTable(string sortExpression, int startRow, int pageSize) |
| { |
| //If we use RadComboBox then the values of the startRow and the pageSize variables are 0 |
| //If we use RadGrid then these parameters filled properly by default |
| //Here we want select only a range of employees from a tons of employee |
| DataAccessLayer.GetEmployees(emplTableCollection, startRow, pageSize); |
| SelectCount = emplTableCollection.Count; |
| _empltableData = empltableCollection; |
| return _empltableData; |
| } |
| public int SelectCountEmplTable() |
| { |
| return SelectCount; |
| } |
| <telerik:RadComboBox runat="server" ID="RadComboBox2" DataTextField="EmplId" |
| DataValueField="EmplId" HighlightTemplatedItems="true" Height="190px" Width="220px" |
| DropDownWidth="420px" DataSourceID="dsEmplTable" EnableVirtualScrolling="true" |
| EnableAutomaticLoadOnDemand="True" ItemsPerRequest="10" ShowMoreResultsBox="true" |
| OnItemsRequested="RadComboBox2_ItemRequested" |
| OnItemDataBound="RadComboBox2_ItemDataBound" |
| OnSelectedIndexChanged="RadComboBox2_SelectedIndexChanged" |
| OnDataBinding="RadComboBox2_DataBinding" |
| > |
| <HeaderTemplate> |
| <ul> |
| <li class="col1">Employee Id</li> |
| </ul> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <ul> |
| <li class="col1"><%# DataBinder.Eval(Container.DataItem, "EmplId") %></li> |
| </ul> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| this.dsEmplTable.Selecting += new ObjectDataSourceSelectingEventHandler(dsEmplTable_Selecting); |
| if (Session["RADCOMBOBOX2_STARTROW"] == null) |
| { |
| Session.Add("RADCOMBOBOX2_STARTROW", 1); |
| } |
| } |
| void dsEmplTable_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) |
| { |
| e.Arguments.StartRowIndex = (int)Session["RADCOMBOBOX2_STARTROW"]; |
| e.Arguments.MaximumRows = (int)Session["RADCOMBOBOX2_MAXIMUMROWS"]; |
| } |
<
telerik:RadToolTip Title="Help" runat="server" ID="RadToolTipPassword" HideEvent="ManualClose"
ShowEvent="OnClick" TargetControlID="imgPassword" IsClientID="false" Width="150" Height="300" />