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
1175
Binding on DropDown does not work how intended
posted

Hello there,

a new day, new problems: On a row I have label with text, when the users wants to edit this row, I want to show a webdropdown and set the text in the dropdown as selected item.

I Found a example how to make this work and tinkered this:

In the RowEditTemplate

                                                <td>
                                                    <%--<div style="width: 160px; z-index: 1000000">--%>
                                                        <stgwc:DropDown ID="ddlRoleTypeEdit" ClientIDMode="Static" DisplayMode="DropDownList"
                                                            TextField="RoletypeDescription"
                                                            DropDownItemBinding-TextField="RoletypeDescription"
                                                            ValueField="RoleTypeCode"
                                                            DropDownItemBinding-ValueField="RoletypeDescription"
                                                            EnableLoadOnDemand="false"runat="server"
                                                            Width="150px"
                                                            EnableDropDownAsChild="true"
                                                            OnInit="DropDown_OnPreRender"
                                                            >
                                                        </stgwc:DropDown>
                                                    <%--</div>--%>
                                                </td>

At the binding I set this:

                                    <ig:RowEditingClientBinding ColumnKey="RoleType" ControlID="ddlRoleTypeEdit"
                                        SetValueJavaScript="$find({ClientID}).set_currentValue(cell.get_element().innerText,true)" />

When I debug I see this works not bad so far, I guess the problem is the clientstate list, which doesnt seem filled at this time.

Is there anything else I have to look at to make this work proper?

Thanks for your response

Matthias

Parents
No Data
Reply
  • 15979
    posted

    Hello Matthias,

    Can you elaborate on this scenario a little bit more?

    What kind of label you have on the row – is this template column with ASP label or this is simple string column?

    Also what type of Data Source you use for the dropdown, on what event you bind it and is the value from the label present in this Data Source?

    If you can setup a small sample with this code that we can test on our side this will help us to research for solution faster.

Children