Autocomplete AJAX radcombobox in radgrid

2 posts, 0 answers
  1. Jason
    Jason avatar
    26 posts
    Member since:
    Nov 2006

    Posted 12 Apr 2011 Link to this post

    Hi,

    I have an autocomplete combobox within a radgrid. The combobox is fed directly from a Web service. When I move this combobox outside the grid it works fine. Is there some issue with having AJAX fed controls inside a grid?

    function OnClientItemsRequesting(sender, eventArgs)
       {
           var context = eventArgs.get_context();
           context["FilterString"] = eventArgs.get_text();       
       }
    <radG:RadGrid runat="server" AutoGenerateColumns="false" ShowFooter="true"  CssClass="bodyCopy" ID="RadGrid1" AllowPaging="True" AllowSorting="True" EnableAJAX="true"
                                  OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCreated="RadGrid1_ItemCreated"
                                  OnItemCommand="RadGrid1_ItemCommand" Width="800px" EditItemStyle-VerticalAlign="Top">
                              <PagerStyle Mode="NumericPages" />
                              <MasterTableView DataKeyNames="J_ID" Width="800px" CommandItemDisplay="Top" PageSize="18"
                                  EditMode="InPlace" >
                          <Columns>
                            
                              <radG:GridTemplateColumn UniqueName="Date" SortExpression="Date" HeaderText="Date">
                                  <ItemTemplate>
                                      <asp:Label ID="lblDate" runat="Server"></asp:Label>
                                  </ItemTemplate>
                                  <EditItemTemplate>
                                      <asp:DropDownList ID="ddlDateEdit" runat="Server"></asp:DropDownList>
                                  </EditItemTemplate>
                              </radG:GridTemplateColumn
                              <radG:GridTemplateColumn UniqueName="Description" SortExpression="Description" HeaderText="Description">
                                  <ItemTemplate>
                                      <asp:Label ID="lblDescription" ForeColor="black" runat="Server"></asp:Label>
                                  </ItemTemplate>
                                  <EditItemTemplate>
                                      <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Rows="2" Width="180px"></asp:TextBox
                                  </EditItemTemplate>
                              </radG:GridTemplateColumn
                               <radG:GridTemplateColumn UniqueName="Hours" SortExpression="Hours" HeaderText="Hours">
                                  <ItemTemplate>
                                      <asp:Label ID="lblHours" runat="Server"></asp:Label>
                                  </ItemTemplate>
                                  <FooterTemplate><asp:Label runat="server" ID="lblTotals"></asp:Label></FooterTemplate>
                                  <EditItemTemplate>
                                      <asp:TextBox ID="txtHours" runat="server" Width="30px"></asp:TextBox
                                  </EditItemTemplate>
                              </radG:GridTemplateColumn
                              <radG:GridTemplateColumn UniqueName="J_JobCode" SortExpression="Hours" HeaderText="Job">
                                  <ItemTemplate>
                                      <asp:Label ID="lblJobCode" runat="Server"></asp:Label>
                                  </ItemTemplate>
                                  <EditItemTemplate>
                                        <telerik:RadComboBox ID="radJCSearch" runat="server" DropDownWidth="300px" EnableLoadOnDemand="true"
                                                      Height="190px" OnClientItemsRequesting="OnClientItemsRequesting" Width="300px"
                                                      CausesValidation="False" ExpandDelay="500" HighlightTemplatedItems="True" OpenDropDownOnLoad="False"
                                                      DataValueField="JC_ID" EmptyMessage="Type code to start search"
                                                      EnableVirtualScrolling="True" ItemRequestTimeout="500" ShowDropDownOnTextboxClick="True"
                                                              ShowToggleImage="False" ShowWhileLoading="False" >
                                                  <WebServiceSettings Method="GetJobCodes" Path="JobCodes.asmx" />
                                                  <CollapseAnimation Duration="200" Type="OutQuint" />
                                      </telerik:RadComboBox>
                                       
                                  </EditItemTemplate>
                              </radG:GridTemplateColumn
                               <radG:GridTemplateColumn UniqueName="Date" ItemStyle-Width="25px" SortExpression="Date" HeaderText="Delete">
                                  <ItemTemplate>
                                      <asp:LinkButton ID="lnkNonEditDelete" ToolTip="Delete Job" runat="server" CausesValidation="false" ><img src="delete.gif" border="0" /></asp:LinkButton>
                                  </ItemTemplate>
                                  <EditItemTemplate>
                                        
                                  </EditItemTemplate>
                              </radG:GridTemplateColumn
                              <radG:GridEditCommandColumn  ItemStyle-Width="30px" UniqueName="UpdateColumn" ><ItemStyle CssClass="edit" /></radG:GridEditCommandColumn>                                                        
                                
                          </Columns>                                                
                          </MasterTableView
                                                                           
                        </radG:RadGrid>
  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 15 Apr 2011 Link to this post

    Hi Lourein,

    As I understand - you want to nest a RadComboBox control with Load On Demand feature enabled in the EditItemTemplate of a RadGrid.
    You can make this easily following the approach described in this online demo.

    Kind regards,
    Kalina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top