RadGrid with modal popup

2 Answers 6 Views
Grid
Wayne
Top achievements
Rank 1
Iron
Iron
Wayne asked on 07 Jun 2025, 05:22 PM

I have a radgrid with a standard modal popup for making entries.  Everything works as it should.  However, I have been trying to modify the field in the popup window so the user would see a multiline box to make entries. 

I've tried css, asp:textbox,  and other ideas. but they all failed.  Here is my code..... 

any help would be appriciated. 


<div style="width:95%; margin:2%; display:inline-block">
                        <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" AutoGenerateColumns="False"
                            CellSpacing="-1" GridLines="Both" RenderMode="Lightweight" OnItemCommand="RadGrid1_ItemCommand" MasterTableView-ExpandCollapseColumn-CommandName="Insert">
                        <GroupingSettings CollapseAllTooltip="Collapse all groups" />
                        <MasterTableView CommandItemDisplay="Top" EditFormSettings-PopUpSettings-Modal="true" EditMode="PopUp" DataKeyNames="Line">
                            <CommandItemSettings ShowSaveChangesButton="False" />
                            <RowIndicatorColumn ShowNoSortIcon="False" Visible="False">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn Created="True" ShowNoSortIcon="False">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="Line" ReadOnly="true" FilterControlAltText="Filter Line column" HeaderText="Line" ShowNoSortIcon="False" UniqueName="Line">
                                    <HeaderStyle Width="15px" HorizontalAlign="Center" /> 
                                    <ItemStyle CssClass="lineNo" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Description" ReadOnly="false" FilterControlAltText="Filter Description column" HeaderText="Description" ShowNoSortIcon="False" UniqueName="Description">
                                    <HeaderStyle Width="50%" />
                                    <ItemStyle CssClass="description" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Created_by" ReadOnly="true" FilterControlAltText="Filter Created_by column" HeaderText="Created By" ShowNoSortIcon="False" UniqueName="Created_by">
                                    <HeaderStyle Width="10%" />
                                    <ItemStyle CssClass="empNo" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Created_Name" ReadOnly="true" FilterControlAltText="Filter Created_by column" HeaderText="Created Name" ShowNoSortIcon="False" UniqueName="Created_Name">
                                    <HeaderStyle Width="20%" />
                                    <ItemStyle CssClass="empName" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Created_Date" ReadOnly="true" FilterControlAltText="Filter Created_Date column" HeaderText="Created Date" ShowNoSortIcon="False" UniqueName="Created_Date">
                                    <HeaderStyle Width="15%" />
                                </telerik:GridBoundColumn>
                            </Columns>
                            <EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit Line: {0}" CaptionDataField="Line">
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                                <PopUpSettings Modal="True" />
                            </EditFormSettings>
                        </MasterTableView>
                        <FilterMenu RenderMode="Lightweight">
                        </FilterMenu>
                        <HeaderContextMenu RenderMode="Lightweight">
                        </HeaderContextMenu>
                    </telerik:RadGrid>

                    </div>

 

2 Answers, 1 is accepted

Sort by
0
Vasko
Telerik team
answered on 09 Jun 2025, 08:28 AM

Hi Wayne,

To display a multiline textbox in the popup edit form of your RadGrid, you'll need to use a GridTemplateColumn with a RadTextBox control set to multiline mode. Here’s how you can modify your RadGrid to achieve this:

  1. Replace the GridBoundColumn for the field you want to make multiline with a GridTemplateColumn.
  2. Define the EditItemTemplate within the GridTemplateColumn and use a RadTextBox with TextMode set to MultiLine.

Below is an example of how you can modify the Description column to use a multiline textbox: 

<telerik:GridTemplateColumn HeaderText="Description" UniqueName="Description">
    <HeaderStyle Width="50%" />
    <ItemTemplate>
        <%# Eval("Description") %>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadTextBox ID="txtDescription" runat="server" Text='<%# Bind("Description") %>' TextMode="MultiLine" Rows="5" Width="100%" />
    </EditItemTemplate>
</telerik:GridTemplateColumn>

By implementing the above changes, your modal popup should now display a multiline textbox for the specified column. If you need further customization or run into any issues, feel free to reach out for more assistance!

    Regards,
    Vasko
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    0
    Wayne
    Top achievements
    Rank 1
    Iron
    Iron
    answered on 09 Jun 2025, 12:35 PM

    That wokred beautifully

    thank you

    Tags
    Grid
    Asked by
    Wayne
    Top achievements
    Rank 1
    Iron
    Iron
    Answers by
    Vasko
    Telerik team
    Wayne
    Top achievements
    Rank 1
    Iron
    Iron
    Share this question
    or