Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3475
WebHierarchicalDataGrid using RowEditingTemplate in the Child row
posted

I have a WHDG that is using the RowEditingTemplate to populate the child row (one band).  The template contains a DropDownList.  I need to populate the DDL in code with the values.  I cannot find the DDL in the grid in the code behind.  I have done this successfully before with a WebDataGrid using the following code.

Dim dropDownList As DropDownList

dropDownList = CType(wdgLoanEstimate.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer.FindControl("ddlLoanCostGroupValue"), DropDownList)

 

For the WHDG I am using the following.  There are no controls in the TemplateContainer even though by RowEditTemplate contains my ClientBindings and the controls are visible on the template when executed.

dropDownList = CType(whdgLoanEstimate.GridView.Bands(0).Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer.FindControl("ddlLoanCostGroupValue"), DropDownList)

 

    <ig:WebHierarchicalDataGrid ID="whdgLoanEstimate" runat="server"

        DataKeyFields="LoanCostTypeValue"

        InitialDataBindDepth="1"

        InitialExpandDepth="1"

        Style="z-index: 102; left: 0px; position: absolute; top: 26px"

        Width="760px">

        <Bands>

                  <ig:Band  Key="LoanAppEstimateCostRecID"

                DataMember="LoanCostItemChild"

                DataKeyFields="LoanAppEstimateCostRecID"

                AutoGenerateColumns="false"

                ExpansionColumnCss="GridExpandColumnNone">

                <Behaviors >

                    <ig:EditingCore >

                        <Behaviors >

                            <ig:CellEditing Enabled ="true"  ></ig:CellEditing>

                            <ig:RowAdding AddNewRowCssClass ="hideRowTemplate"></ig:RowAdding>

                            <ig:RowEditingTemplate CancelButton ="buttonCancel" OKButton ="buttonOK">

                                <EditModeActions MouseClick ="Single" />

                                <ClientBindings >

                                    <ig:RowEditingClientBinding ColumnKey ="LoanCostGroupValue" ControlID ="ddlLoanCostGroupValue"  

                                        GetValueJavaScript="$get({ClientID}).value"

                                        SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />

                                </ClientBindings>

                                <Template>

                                    <div style="background-color:white;border:1px solid black;  ">

                                        <table border="0" >

                                    <tr>

                                        <td>

                                            <asp:Label ID="lblLoanCostGroupValue" runat="server" Text="Group" />

                                        </td>

                                        <td>

                                            <asp:DropDownList ID="ddlLoanCostGroupValue" runat="server"

                                                style="z-index: 100000;"></asp:DropDownList>

                                        </td>

                                    </tr>

                                    <tr>

                                        <td>

                                            <asp:Button ID="buttonOK" runat="server"

                                                OnClientClick="return"

                                                Text="OK"

                                                UseSubmitBehavior="False" />

                                            <asp:Button ID="buttonCancel" runat="server"

                                                CausesValidation="False"

                                                Text="Cancel"

                                                UseSubmitBehavior="False" />

                                        </td>

                                    </tr>

                                </table>

                                    </div>

                                </Template>

                            </ig:RowEditingTemplate>

                        </Behaviors>

                    </ig:EditingCore>

                </Behaviors>

           </ig:Band>

        </Bands>

    </ig:WebHierarchicalDataGrid>

Parents Reply Children
No Data