Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
310 views
Which could be a simple way to limit the AutoCompleteColumn suggestion to say 10 or 50 or whatever on a large dataset and how to apply this filtering for the AutoCompleteColumn server side so that the "TOP n" clause is injected in the SELECT retrieving data for the autocomplete column? (with an objectdatasource for example or other method)
I think this is quite a common scenario together with the minimum character required to trigger suggestion.

Another question is if it is possible to retrieve an bind an IQueryable(of String) to the AutoCompleteColumn thus avoid specifying data text and data value. Let's say I'm filtering a user name, I would just retrieve the UserName field in my datasource and passa back an array/iqueryable/list of string and not a complex object.

Thanks in advance.
Massimiliano
Top achievements
Rank 1
 answered on 19 Jul 2013
0 answers
123 views
Hi guys,

Please examine the following poll and cast your vote in order to make the choice whether this change should be implemented: http://feedback.telerik.com/Project/108/Feedback/Details/53978-poll-the-default-value-of-the-newlinemode-property-in-radeditor-should-be-p.

The RadEditor team
Telerik Admin
Top achievements
Rank 1
Iron
 asked on 19 Jul 2013
1 answer
55 views
Hi,


I'm using RadComboBox  while typing the letter it pull out exact match it is working in Firefox but it will not support IE .

Example type In - >populate India working in Firefox not in IE .



<telerik:RadComboBox ID="radSpeakerAlignment1" EmptyMessage="Please select ..." OnClientDropDownClosing="onSpeakerAlignment1Closing"
                                    HighlightTemplatedItems="true" AllowCustomText="true" TabIndex="-1" OnClientBlur="onMultiSelectBlur"
                                    SkinID="combo" runat="server" Width="180px" Height="120px"  Style="display: block !important;" MarkFirstMatch="true">
                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                    <ItemTemplate>
                                        <div onclick="StopPropagation(event)">
                                            <asp:CheckBox Width="100%" ID="chkSpeakerAlignment1" runat="server" onclick="onSpeakerAlignment1CheckBoxClick(this)"
                                                Text='<%#DataBinder.Eval(Container.DataItem, "UserName")%>' />
                                           <asp:Label ID="lblchkAlignment1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "FirstNameLastName")%>'  style="display:none"/>
                                        </div>
                                    </ItemTemplate>
                                </telerik:RadComboBox>
Kate
Telerik team
 answered on 19 Jul 2013
1 answer
187 views
Hi,
  
We are using Radgrid and defining columns along with widths at design time like this:
  
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" GroupingEnabled="False" Height="215px" Width="99%" OnItemCommand=" RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound" OnPreRender="RadGrid1_PreRender" OnUnload="RadGrid1_Unload" OnBiffExporting="RadGrid1_BiffExporting">
            <ExportSettings ExportOnlyData="True" HideStructureColumns="True" OpenInNewWindow="True" FileName="TransactionSummary">
                <Excel Format="Biff" AutoFitImages="True" />
            </ExportSettings>
            <ClientSettings AllowExpandCollapse="False" AllowGroupExpandCollapse="False">
                <Selecting EnableDragToSelectRows="False" />
                <Scrolling AllowScroll="True" />
                <Resizing AllowColumnResize="True" ShowRowIndicatorColumn="False" />
            </ClientSettings>
            <MasterTableView DataKeyNames="TransactionID" AllowNaturalSort="false">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>                 
                <Columns>
                    <telerik:GridBoundColumn AllowFiltering="False" DataField="TransactionID" Groupable="False" HeaderText="ID" ReadOnly="True" Reorderable="False" ShowFilterIcon="False" UniqueName="TransactionID" HeaderStyle-Width="5%" HeaderTooltip="Transaction ID Number" HeaderButtonType="None">
                        <HeaderStyle Width="5%" />
                        <ItemStyle HorizontalAlign="Left" Wrap="false" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AllowFiltering="False" DataField="Status" Groupable="False" HeaderText="Status" ReadOnly="True" Reorderable="False" ShowFilterIcon="False" UniqueName="Status" HeaderStyle-Width="8%" HeaderTooltip="Status" HeaderButtonType="None">
                        <HeaderStyle Width="8%" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
  
My grid has around 13 columns, but only 10 are set to display true. Out of 3 (display – false), one column gets to be shown when user clicks on button to show it.
Some of the column’s display property is set to false. So, initially when grid is loaded which ever the columns are displayed, we made sure their total width comes to 99%. At run time based on some conditions, we are setting one of the column to be displayed. In order to display, we are adjusting the widths of columns by taking total visible columns like this:
  
double colPercentChange = (double)13 / colCnt;
  
 foreach (GridColumn col in pRgdTrans.Columns)
                    {
     if (col.Display == true)
     {
        double colWidthPercent = (double)col.HeaderStyle.Width.Value; // gridWidth;
        col.HeaderStyle.Width = Unit.Percentage(colWidthPercent - colPercentChange);
        col.ItemStyle.Width = Unit.Percentage(colWidthPercent - colPercentChange);
     }
  }
  
For all the columns it is working fine except TrnsactionID which is DataKey. The column width is getting doubled every time I click on button to make that column visible. All the columns are gridbound columns or template columns.
  
I appreciate your response.
Thanks,
Katta
Venelin
Telerik team
 answered on 19 Jul 2013
10 answers
208 views
When I create a one hour appointment on a single day in scheduler, in Day and Week Views it shows up correctly. In Month and Timeline Views however, it shows the appointment extending past it's actual date into the next day - as if it were an appointment from 9/3/08 10:30 AM to 9/4/08 10:30 AM for example. I've tried several different skins and they all have this problem. Is this a bug in the Scheduler control? 

Thanks,

Kevin Sanborn
Hall Data Inc. 
Boyan Dimitrov
Telerik team
 answered on 19 Jul 2013
3 answers
99 views
hai
  i have donunt chart in that i use seriesitems for pieseries ,seriesitems is common for all chart ,but in vs2010 if open in code behind it will show error with underline green color .if i move cursor to seriesitem it show error like " SeriesItems not support in Donutchart in telerik radhtml chart...." like that it show.
The error is comming when i use upgrade wizard in vs2101.
why? in vs2012 if i open code behind it not show any error.

in both visual studio i try upgrade wizard also ,both are same telerik version.

pls reply me asap
   Aravind
Danail Vasilev
Telerik team
 answered on 19 Jul 2013
1 answer
112 views
Hi,

I have an issue where radgrid skin overlaps the border (see image attached). As per my observation, this happens when grid loads for the first time. Please find the markup for grid below.

<asp:Panel ID="GridPanel" runat="server" EnableViewState="true" Visible="false"
    Height="80%" Width="100%" ScrollBars="Auto"  >
    <telerik:RadGrid ID="Grid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"
        EnableViewState="true" AllowAutomaticInserts="True" Skin="Outlook" ShowHeader="true" 
        CssClass="GridStyle" AllowPaging="true" PageSize="10"
        OnDeleteCommand="Grid1_DeleteCommand" OnPageIndexChanged="Grid1_PageIndexChanged"
        Height="100%" HorizontalAlign="Center"
        OnItemDataBound="Grid1_ItemDataBound" 
        OnItemCommand="Grid1_ItemCommand" ShowGroupPanel="true" OnItemCreated="Grid1_ItemCreated">
        <PagerStyle AlwaysVisible="true" />
        <ItemStyle HorizontalAlign="Center" />
        <AlternatingItemStyle HorizontalAlign="Center" />
        <MasterTableView CommandItemDisplay="Bottom" EnableViewState="true"
            NoMasterRecordsText="" EditMode="InPlace" HorizontalAlign="Center" AutoGenerateColumns="False"
            Caption="Manual Assignment" TableLayout="Auto" GroupLoadMode="Server">

            <GroupByExpressions>
                <telerik:GridGroupByExpression>
                                    <SelectFields>
                        <telerik:GridGroupByField  FieldName="Seq" 
                            HeaderValueSeparator=":"></telerik:GridGroupByField>
                    </SelectFields>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldName="Seq" SortOrder="Ascending"></telerik:GridGroupByField>
                    </GroupByFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>

            <Columns>
                <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmDialogType="RadWindow"
                    ConfirmText="Delete this Element?" CommandName="Delete" Text="Delete" ConfirmTitle="Delete"
                    UniqueName="DeleteColumn" ItemStyle-Width="50px" HeaderStyle-Width="50px">
                    <ItemStyle CssClass="MyImageButton" HorizontalAlign="Center" />
                </telerik:GridButtonColumn>
                <telerik:GridTemplateColumn ItemStyle-Width="125px" UniqueName="ManElementTypeCol"
                    HeaderText="Element Type" HeaderStyle-Width="125px">
                    <ItemTemplate>
                        <telerik:RadComboBox ID="ddlElementTypeEdit" runat="server" AutoPostBack="true" DataSourceID="SqlDataSource2"
                            DataTextField="Description" DataValueField="ID" Width="110px" EnableViewState="false" Height="150"
                            OnSelectedIndexChanged="ddlElementTypeEdit_SelectedIndexChanged" NoWrap="true" OnDataBound="ddlElementTypeEdit_DataBound">
                        </telerik:RadComboBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn ItemStyle-Width="225px" UniqueName="ManCOIDColumn" HeaderText="Element Location" HeaderStyle-Width="225px">
                    <ItemTemplate>
                        
                        <telerik:RadComboBox ID="ddlCOIDEdit" runat="server" AutoPostBack="true" Width="200px" Height="150"
                            OnSelectedIndexChanged="ddlCOIDEdit_SelectedIndexChanged" EnableViewState="false" NoWrap="true" OnDataBound="ddlCOIDEdit_DataBound">
                        </telerik:RadComboBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn ItemStyle-Width="225px" UniqueName="ManElementColumn"
                    HeaderText="Element" HeaderStyle-Width="225px">
                    <ItemTemplate>
                        <telerik:RadComboBox ID="ddlElementEdit" runat="server" AutoPostBack="true" Width="200px" Height="150"
                            EnableViewState="false" OnSelectedIndexChanged="ddlElementEdit_SelectedIndexChanged" NoWrap="true" OnDataBound="ddlElementEdit_DataBound" 
                             EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnItemsRequested="ddlElementEdit_ItemsRequested"  
                             OnClientItemsRequesting="GetSelectedItem">
                        </telerik:RadComboBox>
                        
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn ItemStyle-Width="125px" UniqueName="ManStatusColumn"
                    HeaderText="Status" HeaderStyle-Width="125px">
                    <ItemTemplate>
                        <telerik:RadComboBox ID="ddlStatusEdit" runat="server" AutoPostBack="true" DataSourceID="SqlDataSource4"
                            DataTextField="Description" DataValueField="ID" Width="110px" EnableViewState="false"
                            OnSelectedIndexChanged="ddlStatusEdit_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                 <telerik:GridTemplateColumn HeaderText="Linecard Sequence" ItemStyle-Width="150px"
                    UniqueName="ManLinecardSeqColumn" HeaderStyle-Width="150px">
                    <ItemTemplate>
                        <telerik:RadComboBox ID="ddlManLinecardSeq" runat="server" EnableViewState="true" AppendDataBoundItems="true"
                            Width="100px" AutoPostBack="true" OnSelectedIndexChanged="ddlManLinecardSeq_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="ManViewButton" Text="View" CommandName="ViewElement"
                    ItemStyle-Width="100px" HeaderStyle-Width="50px">
                </telerik:GridButtonColumn>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="ManMapButton" Text="Find on Map" CommandName="FindOnMap" ItemStyle-Width="100px" HeaderStyle-Width="50px">
                </telerik:GridButtonColumn>
                <telerik:GridTemplateColumn ItemStyle-Width="50px" UniqueName="ManHiddenListOrder" Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lblManListOrder" runat="server">
                        </asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
            <CommandItemTemplate>
                <asp:Button ID="Button1" Text="Add new item" OnClick="Button1_Click" runat="server">
                </asp:Button>
                <asp:Button ID="AddLinecard" Text="Add new linecard" OnClick="AddLinecard_Click" runat="server">
                </asp:Button>
            </CommandItemTemplate>
        </MasterTableView>
        <ClientSettings>
        </ClientSettings>
        
    </telerik:RadGrid>
    <telerik:GridDropDownListColumnEditor ID="GridDropDownListColumnEditor1" runat="server"
        DropDownStyle-Width="110px" />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="select ID, Description from ElementType order by Description">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="select ID,Description from Status">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
    <asp:HiddenField ID="hdnManListOrder" runat="server" />
    <asp:HiddenField ID="hdnManLinecardSeq" runat="server" />
</asp:Panel>
Venelin
Telerik team
 answered on 19 Jul 2013
2 answers
196 views
Hi all,

I have a RadGrid inside the FormTemplate of another RadGrid.  My markup looks like this at the moment:

<telerik:RadGrid ID="CollectionsRadGrid" runat="server"
    OnNeedDataSource="CollectionsRadGrid_NeedDataSource"
    OnItemCommand="CollectionsRadGrid_ItemCommand"
    OnItemCreated="CollectionsRadGrid_ItemCreated">
    <MasterTableView DataKeyNames="CollectionID" AutoGenerateColumns="false" CommandItemDisplay="Top" EditMode="EditForms">
        <CommandItemTemplate>
            <telerik:RadToolBar ID="CollectionsRadToolBar" runat="server" AutoPostBack="true">
                <Items>
                    <telerik:RadToolBarButton Text="Add a new collection" ImageUrl="/Public/Images/icon-add.png" CommandName="InitInsert" />
                </Items>
            </telerik:RadToolBar>
        </CommandItemTemplate>
        <Columns>
            <telerik:GridBoundColumn HeaderText="Reference" DataField="Reference" ReadOnly="true" />
            <telerik:GridTemplateColumn HeaderText="Site">
                <ItemTemplate>
 
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn HeaderText="Collection Date" />
            <telerik:GridTemplateColumn HeaderText="Items">
                <ItemTemplate>
 
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Options">
                <ItemTemplate>
 
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <asp:Panel ID="InnerContainerPanel" runat="server" CssClass="innerContainer">
                    <div class="nonTabPage">
                        <telerik:RadToolBar ID="RadToolBar1" runat="server" AutoPostBack="true" Width="100%">
                            <Items>
                                <telerik:RadToolBarButton
                                    Text='<%# (this.GetGridEditFormItem(Container) is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    CommandName='<%# (this.GetGridEditFormItem(Container) is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                                <telerik:RadToolBarButton Text="Cancel" CommandName="Cancel" />
                            </Items>
                        </telerik:RadToolBar>
                        <p>
                            <table cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                    <td valign="bottom">
                                        <asp:Label runat="server" Text="Site: " />
                                        <telerik:RadComboBox ID="SiteListBox" runat="server" EmptyMessage="Please Select" />
                                    </td>
                                    <td align="right">
                                        <asp:Label runat="server" Text="Collection Date: " />
                                        <asp:Label ID="CollectionDateLabel" runat="server" Text='<%#(string.IsNullOrEmpty(Eval("CollectedDate").ToString()) ? "TBC" : Eval("CollectedDate", "dd/MM/yyyy")) %>' />
                                    </td>
                                </tr>                  
                            </table>
                        </p>
                        <p>
                            <telerik:RadGrid ID="CollectionItemsRadGrid" runat="server"
                                OnItemCommand="CollectionItemsRadGrid_ItemCommand"
                                OnInsertCommand="CollectionItemsRadGrid_InsertCommand"
                                OnNeedDataSource="CollectionItemsRadGrid_NeedDataSource">
                                <MasterTableView DataKeyNames="InItemID" AutoGenerateColumns="false" CommandItemDisplay="Top" EditMode="InPlace">
                                    <CommandItemTemplate>
                                        <telerik:RadToolBar ID="RadToolBar1" runat="server" AutoPostBack="true">
                                            <Items>
                                                <telerik:RadToolBarButton Text="Add a new item"  ImageUrl="/Public/Images/icon-add.png" CommandName="InitInsert" />
                                            </Items>
                                        </telerik:RadToolBar>
                                    </CommandItemTemplate>
                                    <Columns>
                                        <telerik:GridTemplateColumn HeaderText="Item Type">
                                            <ItemTemplate>
                                                <%# Eval("tblItemType.Description") %>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <telerik:RadComboBox ID="ItemTypeCombo" runat="server"
                                                    EmptyMessage="Please Select" />
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridNumericColumn DataField="PlannedQty" HeaderText="Quantity" NumericType="Number" />
                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                                            <%--<ItemStyle CssClass="MyImageButton"></ItemStyle>--%>
                                        </telerik:GridEditCommandColumn>
                                        <telerik:GridButtonColumn ConfirmText="Delete this item?" ConfirmDialogType="RadWindow"
                                            ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                            UniqueName="DeleteColumn">
                                            <%--<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>--%>
                                        </telerik:GridButtonColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </p>
                    </div>
                </asp:Panel>
 
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

and my code behind is as follows:
The function at the very bottom (in bold) is where I am having the problem.  It is not being executed.

/// <summary>
/// Gets or sets the quote object from session
/// </summary>
protected tblQuote CurrentQuote
{
    get { return this.Session["CurrentQuote"] as tblQuote; }
    set { this.Session["CurrentQuote"] = value; }
}
 
/// <summary>
/// Gets or sets the current collection object from session
/// </summary>
protected tblCollection CurrentCollection
{
    get { return this.Session["CurrentCollection"] as tblCollection; }
    set { this.Session["CurrentCollection"] = value; }
}
 
#region Collections
 
/// <summary>
/// The collections radgrid need data source event
/// </summary>
/// <param name="sender">The sender</param>
/// <param name="e">The event args</param>
protected void CollectionsRadGrid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    this.CollectionsRadGrid.DataSource = CurrentQuote.tblJob.tblCollection.ToList();
}
 
/// <summary>
/// Collections radgrid item command event
/// </summary>
/// <param name="sender">The sender</param>
/// <param name="e">The event args</param>
protected void CollectionsRadGrid_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.InitInsertCommandName)
    {
        this.CurrentCollection = new tblCollection()
        {
            JobID = this.CurrentQuote.JobID,
            CreateDate = DateTime.Now,
            tblItemsIn = new List<tblItemsIn>()
        };
    }
 
    if (e.CommandName == RadGrid.EditCommandName)
    {
        int collectionId = (int)this.CollectionsRadGrid.MasterTableView.Items[e.Item.ItemIndex].GetDataKeyValue("CollectionID");
        this.CurrentCollection = this.CurrentQuote.tblJob.tblCollection.Single(o => o.CollectionID == collectionId);
    }
}
 
/// <summary>
/// Collections radgrid item created event
/// </summary>
/// <param name="sender">The sender</param>
/// <param name="e">The event args</param>
protected void CollectionsRadGrid_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        RadGrid collectionItemsRadGrid = (RadGrid)e.Item.FindControl("CollectionItemsRadGrid");
        collectionItemsRadGrid.Rebind();
    }
}
 
#endregion
 
#region Collection Items
 
/// <summary>
/// The collection items radgrid need datasource event
/// </summary>
/// <param name="sender">The sender</param>
/// <param name="e">The event args</param>
protected void CollectionItemsRadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    ((RadGrid)sender).DataSource = this.CurrentCollection.tblItemsIn.ToList();
}
 
protected void CollectionItemsRadGrid_ItemCommand(object sender, GridCommandEventArgs e)
{
}
 
#endregion
 
/// <summary>
/// Gets the grid data item by traversing up the control hierarchy
/// </summary>
/// <param name="sender">The object contained in the FormTemplate</param>
/// <returns>The GridEditFormItem</returns>
protected GridEditFormItem GetGridEditFormItem(Control sender)
{
    Control currentItem = sender;
    while (!(currentItem is GridEditFormItem))
    {
        if (currentItem.Parent == null)
        {
            return null;
        }
 
        currentItem = currentItem.Parent;
    }
 
    return (GridEditFormItem)currentItem;
}
 
protected void CollectionItemsRadGrid_InsertCommand(object sender, GridCommandEventArgs e)
{
    GridEditableItem item = (GridEditableItem)e.Item;
    tblItemsIn newItem = new tblItemsIn();
    item.UpdateValues(newItem);
    this.CurrentCollection.tblItemsIn.Add(newItem);
}

Many thanks
Stephen
Top achievements
Rank 1
 answered on 19 Jul 2013
8 answers
627 views
Load data on demand in telerik grid using pagination

Is it possible to load data on demand using pagination as like in ordinary asp grid controls? .It doesnot use any ajax and scrolling things.Initially it will load only 10 records.And if the records is more than 10,it will have paging control and display records based on the page index and page size.Can i do the load data on demand in grid, only based on the paging in grid?.

Thanks in advance
Margret
Eyup
Telerik team
 answered on 19 Jul 2013
3 answers
144 views
Hi,

I've set up a grid with Batch editing enabled and in one of the columns (TemplateColumn) I use a usercontrol as and editor. This usercontrol contains three cascading comboboxes with the following definition:

<table class="layout">
    <tr>
        <td>
          <telerik:RadComboBox ID="Family" runat="server" Width="150" EmptyMessage="Família"
                EnableLoadOnDemand="True" ShowMoreResultsBox="true"  EnableVirtualScrolling="true"
                OnItemsRequested="FamilyItemsRequested" AutoPostBack="True">
            </telerik:RadComboBox>
        </td>
        <td>
           <telerik:RadComboBox ID="Genus" runat="server" Width="150"  EmptyMessage="Género"
                EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                OnItemsRequested="GenusItemsRequested" AutoPostBack="True">
            </telerik:RadComboBox>
        </td>
        <td>
            <telerik:RadComboBox ID="Species" runat="server" Width="150" EmptyMessage="Espécie"
                EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                OnItemsRequested="SpeciesItemsRequested" AutoPostBack="True">
            </telerik:RadComboBox>
        </td>
    </tr>
</table>
<asp:HiddenField ID="SelectedTaxonId" runat="server" />
<asp:HiddenField ID="SelectedTaxonName" runat="server" />

Besides that the control contains an ajaxmanager proxy:
   <telerik:RadAjaxManagerProxy ID="ajaxProx" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Family">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Genus" UpdatePanelCssClass="" />
                    <telerik:AjaxUpdatedControl ControlID="Species" UpdatePanelCssClass="" />
                    <telerik:AjaxUpdatedControl ControlID="SelectedTaxonId"
                        UpdatePanelCssClass="" />
                    <telerik:AjaxUpdatedControl ControlID="SelectedTaxonName"
                        UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Genus">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Species" UpdatePanelCssClass="" />
                    <telerik:AjaxUpdatedControl ControlID="SelectedTaxonId"
                        UpdatePanelCssClass="" />
                    <telerik:AjaxUpdatedControl ControlID="SelectedTaxonName"
                        UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Species">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="SelectedTaxonId"
                        UpdatePanelCssClass="" />
                    <telerik:AjaxUpdatedControl ControlID="SelectedTaxonName"
                        UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
</telerik:RadAjaxManagerProxy>

When testing this control on a form, not in a grid, in works fine, even when putting hundreds of them on one page.

However as soon as I put this control in a grid, weird things start to happen:

First selecting an item of the Family Combobox works fine, all events are events are fired correctly
When selecting an item of the next combo (Genus), for some reason a SelectedIndexChanged event is fired for the Family combo while it is not clicked or changed in anyway. Random javascript errors apear as well, but I cannot reproduce those and in another grid, selecting an item from the Family combox will hide the usercontrol, not letting me choose an item from Genus or Especies. All in all, the behaviour becomes very erratic.

When using the control in an ItemTemplate it works fine, however it causes the page to be very unresponsive when using a grid of 100 rows

Any ideas what might be going wrong? Or an example of how to accomplish what I'm trying to do? Thanks in advance for any help!

Ioish



Angel Petrov
Telerik team
 answered on 19 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?