I am relatively knew to the Telerik controls but have been a developer for several years. I want to implement a load on demand combo box for my newest project(well several really), the control will load from a page method. I got the control to load initially, but as you type the dropdown just bounces a little without narrowing the search or showing any type of error. Below is the code that is currently being used for the control, and page method.
private const int ItemsPerRequest = 20;
[WebMethod]
public static RadComboBoxData GetContributors(RadComboBoxContext context)
{
DataTable data = GetContributors();
RadComboBoxData comboData = new RadComboBoxData();
int itemOffset = context.NumberOfItems;
int endOffSet = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
comboData.EndOfItems = endOffSet == data.Rows.Count;
List<RadComboBoxItemData> results = new List<RadComboBoxItemData>(endOffSet - itemOffset);
for (int i = itemOffset; i < endOffSet; i++)
{
RadComboBoxItemData itemData = new RadComboBoxItemData();
itemData.Text = data.Rows[i]["Contributor"].ToString();
itemData.Value = data.Rows[i]["ContributorID"].ToString();
results.Add(itemData);
}
comboData.Message = GetStatusMessage(endOffSet, data.Rows.Count);
comboData.Items = results.ToArray();
return comboData;
}
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> <div style="display: none;"> <telerik:RadEditor runat="server" ID="MasterEditor" SkinID="DefaultSetOfTools" EnableViewState="false" Height="100px" ContentAreaMode="Div"> <Tools> <telerik:EditorToolGroup DockingZone="divToolbar"> <telerik:EditorTool Name="Bold" /> <telerik:EditorTool Name="Italic" /> <telerik:EditorTool Name="Underline" /> <telerik:EditorSplitButton Name="ForeColor" /> </telerik:EditorToolGroup> </Tools> </telerik:RadEditor> </div> <div id="divToolbar" style="background-color: Silver; height: 100px;"> </div> <div> <telerik:RadEditor ID="RadEditor1" runat="server" ToolProviderID="MasterEditor" Height="50" Width="100" ContentAreaMode="Div" EditModes="Design" EnableViewState="false" BorderStyle="None" AutoResizeHeight="True" OnClientLoad="RadEditorLoad" /> </div> <div> <telerik:RadEditor ID="RadEditor2" runat="server" ToolProviderID="MasterEditor" Height="50" Width="100" ContentAreaMode="Div" EditModes="Design" EnableViewState="false" BorderStyle="None" AutoResizeHeight="True" OnClientLoad="RadEditorLoad" /> </div> <script type="text/javascript"> function RadEditorLoad(editor, args) { editor.removeShortCut("InsertTab"); } </script><telerik:RadContextMenu ID="grdContextMenu" runat="server" EnableRoundedCorners="true" EnableShadows="true" OnClientItemPopulating="FetchUserList_Pre" EnableAutoScroll="true" OnClientItemPopulationFailed="ServiceFailure" > <WebServiceSettings Path="../Services/TimeSchedule.asmx" Method="FetchUserList" /> <LoadingStatusTemplate> <div style="padding-top:100px;text-align:right;width:120px;float:left;"> <asp:Image runat="server" ID="LoadingImage" ImageUrl="../Images/Working.gif" ToolTip="Loading..." Width="50px" Height="50px" /> <br /> Loading Users... </span> </LoadingStatusTemplate> <Items> <telerik:RadMenuItem Text="Add" ToolTip="Add a new record" /> <telerik:RadMenuItem Text="Delete" ToolTip="Delete this record"/> <telerik:RadMenuItem Text="Copy To Day" ToolTip="Copy this shift to the selected day" GroupSettings-Height="165" GroupSettings-ExpandDirection="Auto" > <Items> <telerik:RadMenuItem Text="Sunday" Value="Sunday"></telerik:RadMenuItem> <telerik:RadMenuItem Text="Monday" Value="Monday"></telerik:RadMenuItem> <telerik:RadMenuItem Text="Tuesday" Value="Tuesday"></telerik:RadMenuItem> <telerik:RadMenuItem Text="Wednesday" Value="Wednesday"></telerik:RadMenuItem> <telerik:RadMenuItem Text="Thursday" Value="Thursday"></telerik:RadMenuItem> <telerik:RadMenuItem Text="Friday" Value="Friday"></telerik:RadMenuItem> <telerik:RadMenuItem Text="Saturday" Value="Saturday"></telerik:RadMenuItem> </Items> </telerik:RadMenuItem> <telerik:RadMenuItem Text="Copy Shift (Open)" ToolTip="Copy this shift as open or to another user" GroupSettings-Height="250" GroupSettings-Width="200" GroupSettings-ExpandDirection="Auto" ExpandMode="WebService" > </telerik:RadMenuItem> </Items> </telerik:RadContextMenu><telerik:RadAjaxManager ID="ajaxManager" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" onajaxrequest="ajaxManager_AjaxRequest" UpdatePanelsRenderMode="Inline"> <ClientEvents OnRequestStart="centerLoadingPanel"></ClientEvents> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="ajaxManager"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="infoBar" /> <telerik:AjaxUpdatedControl ControlID="errorPanel" /> <telerik:AjaxUpdatedControl ControlID="contentScreenPanel" /> <telerik:AjaxUpdatedControl ControlID="tabStrip" /> <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="errorPanel"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="errorLabel" /> <telerik:AjaxUpdatedControl ControlID="editMode" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="infoBar"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="screenOverviewPanel" /> <telerik:AjaxUpdatedControl ControlID="toolBarPanel" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="ToolBarControl1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="contentScreenPanel" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="screenOverviewPanel"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="lblScreenTitle" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager><telerik:RadPane runat="Server" ID="lowerContentPane" Scrolling="Both" Width="100%" Height="542"> <asp:Panel ID="errorPanel" runat="server"> <asp:Label ID="errorLabel" ForeColor="Red" runat="server"></asp:Label> <asp:HiddenField runat="server" ID="editMode" /> </asp:Panel> <asp:Panel ID="contentScreenPanel" runat="server"></asp:Panel> </telerik:RadPane>public Dictionary<string, object> GetAllUsersGrid(int startRowIndex, int maximumRows, List<GridSortExpression> sortExpression, List<GridFilterExpression> filterExpression)Hello.
I use RadGrid and ObjectDataSource (ods) to fill the grid with data.
I used to make insert, update and delete from code behind (using RadGrid events: UpdateCommand, DeleteCommand , etc) - so, i used to create my objects using FindControl(string id) and then manipulate with them.
Now, I decide to do this using ods, but i cannot work it out while i have nested objects.
(in case of single object it works fine - i mean if i Insert, Update or Delete only Person class - see below)
Here is my example:
class User{ class Person{ int ID int ID; int PersonID; string FirstName; string UserName; string LastName; } }My ods methods are:
SelectMethod: iList<User> GetUsers(); InsertMethod, UpdateMethod: void SaveUser(User u); DeleteMethod: void DeleteUser(User u);In my EditFormTemplate i bind these like this (binding works fine):
<telerik:RadTextBox ID="txtUserName" runat="server" Text='<%# Bind("UserName") %>'/> <telerik:RadTextBox ID="txtFirstName" runat="server" Text= '<%# DataBinder.Eval(Container.DataItem, "Person.FirstName") %>' /> <telerik:RadTextBox ID="txtLastName" runat="server" Text= '<%# DataBinder.Eval(Container.DataItem, "Person.LastName") %>' />So, when i am trying to update user object, updates only UserName, update does not cause to FirstName and LastName (User.Person properties). I guess ods cannot recognize them at all...
Is there any solution for this?
Or is there any alternative way to act situations lake this?
P.S. the same problem is when i use LinqDataSource
thanks.