RadDropDownList in RadGrid EditItemTemplate

2 posts, 0 answers
  1. ChangJun
    ChangJun avatar
    4 posts
    Member since:
    Sep 2013

    Posted 27 Sep 2013 Link to this post

    hi.

    i'm making RadDropDownList in RadGrid EditItemTemplete. 

    I works in case modify exsit rows.

    But, in case 'Add Row'. a dropdownlist is disappeared after i select item and change focus.

    I tried some. and i found  it happends when the text and value of the DropDownListItem is same. 

    Please let me know, what's wrong with it.

    Thank you.

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" CellSpacing="0"
                GridLines="None" Skin="Office2010Silver" HeaderStyle-HorizontalAlign="Center" AllowAutomaticInserts="true" AllowAutomaticDeletes="true"
                AllowAutomaticUpdates="True" AutoGenerateColumns="False" OnBatchEditCommand="RadGrid1_BatchEditCommand"
                OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource = "RadGrid1_NeedDataSource">
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                    <Resizing AllowColumnResize="true" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="True" ScrollHeight/>
                </ClientSettings>
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="PLNT_CD,DM_NO" CommandItemDisplay="Top"
                    EditMode="Batch" BatchEditingSettings-OpenEditingEvent="Click">
     
                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="P_CODE"
                        HeaderStyle-Width="80px"
                        FilterControlAltText="Filter PLNT_CD column"
                        UniqueName="PLNT_CD" DataField="PLNT_CD">
                                <%# Eval("PLNT_CD")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadDropDownList runat="server" ID="PlntCodeDropDown" OnPreRender="PlntCodeDropDown_OnPreRender" Width="80px">
                                </telerik:RadDropDownList>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="DM NO" HeaderStyle-Width="150px" FilterControlAltText="Filter DM_NO column" UniqueName="DM_NO" DataField="DM_NO">
                            <ItemTemplate>
                                <%# Eval("DM_NO")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="tx_dm_no" runat="Server" MaxLength="20"></asp:TextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="CloseYN" HeaderStyle-Width="80px" FilterControlAltText="Filter CLOSE_YN column"
                        UniqueName="CLOSE_YN" DataField="CLOSE_YN">
                            <ItemTemplate>
                                <%# Eval("CLOSE_YN")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadDropDownList runat="server" ID="CloseYNDropDown" Width="50px"  >
                                    <Items>
                                        <telerik:DropDownListItem Text="Y" Value="Y" />
                                        <telerik:DropDownListItem Text="N" Value="N" />
                                    </Items>
                                </telerik:RadDropDownList>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <NoRecordsTemplate>
                    </NoRecordsTemplate>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                    </EditFormSettings>
     
                </MasterTableView>
     
                <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
     
                <FilterMenu EnableImageSprites="False"></FilterMenu>
            </telerik:RadGrid>
  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 02 Oct 2013 Link to this post

    Hello ChangJun,

    I am afraid, that I was unable to replicate the issue locally. After an attempt of insert of a new record in the RadGrid, the RadDropDownList maintains its visibility state. Here is a video,demonstrating the behavior at my end. Would you specify the version of our controls that you are using and if you had applied any custom styles?

    Regards,
    Nencho
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top