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

Google like combobox in details table for hierarchy grid

1 Answer 29 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
illumination
Top achievements
Rank 2
illumination asked on 23 Nov 2010, 02:46 PM
I would like to know how to create google like radcombobox in the details table for insert and edit mode in the hierarchical grid.
Please help.
    <telerik:RadGrid ID="RadGridFunding" runat="server" AllowPaging="True" AllowSorting="True" GridLines="None"  
        PageSize="10" AutoGenerateColumns="False" AllowMultiRowSelection="False" DataSourceID="SqlDsLineItem" ShowFooter="true">
        <MasterTableView HierarchyDefaultExpanded="false" InsertItemPageIndexAction="ShowItemOnFirstPage" 
            HierarchyLoadMode="Client" DataKeyNames="LineItemNumber" Name="Main" Width="100%" 
            DataSourceID="SqlDsLineItem" ShowGroupFooter="true">
            <DetailTables>
                <telerik:GridTableView runat="server" DataKeyNames="FundingID, LineItemNumber" CommandItemDisplay="Top" 
                    Name="Detail" DataSourceID="SqlDsFunding" AllowAutomaticUpdates="true" AllowAutomaticInserts="true" ShowFooter="true" >
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="LineItemNumber" MasterKeyField="LineItemNumber" />
                    </ParentTableRelation>
                    <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True">
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <CommandItemSettings ExportToPdfText="Export to Pdf" />
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                            <HeaderStyle Width="20px" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn HeaderText="Line Item Number" SortExpression="LineItemNumber" UniqueName="LineItemNumber" Aggregate="Count" FooterText="Total Line Items: " FooterStyle-Font-Bold="true">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblLineItemNumber" Text='<%# Eval("LineItemNumber") %>' ></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <span><telerik:RadTextBox runat="server" ID="txtRadLineItemNumber" Text='<%# Bind("LineItemNumber") %>' Skin="Default" ReadOnly="true" ></telerik:RadTextBox></span>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Operating Unit" SortExpression="OperatingUnit" UniqueName="OperatingUnit" >
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblOperatingUnit" Text='<%# Eval("OperatingUnit") %>' ></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <span>
                                            <telerik:RadComboBox ID="cboRadOpUnit" runat="server" Height="200px" DropDownWidth="400px" 
                                                MarkFirstMatch="true" DataSourceID="SqlDsOpUnit" EnableLoadOnDemand="true" SelectedValue='<%# Bind("OperatingUnit") %>'
                                                HighlightTemplatedItems="true" DataTextField="OperatingUnitID" DataValueField="OperatingUnitID"
                                                OnItemsRequested="cboRadOpUnit_ItemsRequested" ToolTip="Select Operating Unit" EmptyMessage="Select..."
                                                OnSelectedIndexChanged="cboRadOpUnit_OnSelectedIndexChangedHandler" AppendDataBoundItems="true">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" Selected="True" Text="Select..." Value="0" />
                                                </Items>
                                                <HeaderTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 50px;">ID</td>
                                                            <td style="width: 300px;">OPERATING UNIT</td>
                                                        </tr>
                                                    </table>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 50px;"><%#DataBinder.Eval(Container.DataItem, "OperatingUnitID")%></td>
                                                            <td style="width: 300px;"><%#DataBinder.Eval(Container.DataItem, "OperatingUnit")%></td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </telerik:RadComboBox></span>                                        
                                <span style="color: Red; font-size: x-small">
                                            <asp:RequiredFieldValidator runat="server" ID="rfvOpUnit" ControlToValidate="cboRadOpUnit"
                                            InitialValue="Select..." ErrorMessage="Required" Display="Dynamic" /></span>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Account#" SortExpression="AccountNumber" UniqueName="AccountNumber" >
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblAccountNumber" Text='<%# Eval("AccountNumber") %>' ></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <span>
                                            <telerik:RadComboBox ID="cboRadAcctNum" runat="server" Height="200px" DropDownWidth="400px" 
                                                MarkFirstMatch="true" DataSourceID="SqlDsAcctNum" EnableLoadOnDemand="true" SelectedValue='<%# Bind("AccountNumber") %>'
                                                HighlightTemplatedItems="true" DataTextField="AccountNum" DataValueField="AccountNum"
                                                OnItemsRequested="cboRadAcctNum_ItemsRequested" ToolTip="Select Account Number" 
                                                OnSelectedIndexChanged="cboRadAcctNum_OnSelectedIndexChangedHandler" AppendDataBoundItems="true">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" Selected="True" Text="Select..." Value="0" />
                                                </Items>
                                                <HeaderTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 70px;">ACCT NUM</td>
                                                            <td style="width: 300px;">DESCRIPTION</td>
                                                        </tr>
                                                    </table>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 70px;"><%#DataBinder.Eval(Container.DataItem, "AccountNum")%></td>
                                                            <td style="width: 300px;"><%#DataBinder.Eval(Container.DataItem, "AccountDesc")%></td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </telerik:RadComboBox></span>
                                <span style="color: Red; font-size: x-small">
                                            <asp:RequiredFieldValidator runat="server" ID="rfvRadAcctNum" ControlToValidate="cboRadAcctNum"
                                            InitialValue="Select..." ErrorMessage="Required" Display="Dynamic" /></span>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Department" SortExpression="Department" UniqueName="Department" >
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblDept" Text='<%# Eval("Department") %>' ></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <span>
                                            <telerik:RadComboBox ID="cboRadDept" runat="server" Height="200px" DropDownWidth="400px" 
                                                MarkFirstMatch="true" DataSourceID="SqlDsDept" EnableLoadOnDemand="true" SelectedValue='<%# Bind("Department") %>'
                                                HighlightTemplatedItems="true" DataTextField="DepartmentID" DataValueField="DepartmentID"
                                                OnItemsRequested="cboRadDept_ItemsRequested" ToolTip="Select Department" 
                                                OnSelectedIndexChanged="cboRadDept_OnSelectedIndexChangedHandler" AppendDataBoundItems="true">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" Selected="True" Text="Select..." Value="0" />
                                                </Items>
                                                <HeaderTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 70px;">ID</td>
                                                            <td style="width: 300px;">DEPT</td>
                                                        </tr>
                                                    </table>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 70px;"><%#DataBinder.Eval(Container.DataItem, "DepartmentID")%></td>
                                                            <td style="width: 300px;"><%#DataBinder.Eval(Container.DataItem, "DepartmentName")%></td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </telerik:RadComboBox></span>
                                <span style="color: Red; font-size: x-small">
                                            <asp:RequiredFieldValidator runat="server" ID="rfvRadDept" ControlToValidate="cboRadDept"
                                            InitialValue="Select..." ErrorMessage="Required" Display="Dynamic" /></span>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                   </Columns>
                <EditFormSettings>
                    <EditColumn ButtonType="ImageButton"/>
                </EditFormSettings>
                </telerik:GridTableView>
            </DetailTables>
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <CommandItemSettings ExportToPdfText="Export to Pdf" />
            <ExpandCollapseColumn Visible="True">
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="LineItemNumber" DataType="System.Int64" 
                    HeaderText="Line Item Number" SortExpression="LineItemNumber" 
                    UniqueName="LineItemNumber" Aggregate="Count" FooterText="Total Item: " FooterStyle-Font-Bold="true">
                </telerik:GridBoundColumn>
           </Columns>
        </MasterTableView>
        <ClientSettings AllowExpandCollapse="true" EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
    </telerik:RadGrid>
</td>
Thank you.

1 Answer, 1 is accepted

Sort by
0
illumination
Top achievements
Rank 2
answered on 24 Nov 2010, 03:35 PM
Solved it myself! Thanks!
Tags
ComboBox
Asked by
illumination
Top achievements
Rank 2
Answers by
illumination
Top achievements
Rank 2
Share this question
or