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

RadDropDownList in RadGrid EditItemTemplate

1 Answer 144 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
ChangJun
Top achievements
Rank 1
ChangJun asked on 27 Sep 2013, 08:16 AM
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>

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 02 Oct 2013, 08:32 AM
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.
Tags
DropDownList
Asked by
ChangJun
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or