This is a migrated thread and some comments may be shown as answers.

Autocomplete AJAX radcombobox in radgrid

1 Answer 114 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 13 Apr 2011, 01:07 AM

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>

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 15 Apr 2011, 03:05 PM
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.

Tags
ComboBox
Asked by
Jason
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or