How to add a label next to GridBoundColumn

1 Answer 111 Views
Grid Label
Brandon Ian
Top achievements
Rank 1
Brandon Ian asked on 16 Nov 2022, 02:13 PM | edited on 16 Nov 2022, 02:16 PM

Is it possible to add a label next to a GridBoundColumn, similar to what I want on the image below that I've modified using inspect element?

The restriction is that I am not using nor going to use FormEditTemplate.

My current code is this, but I cannot find a way to insert label next to it:

<telerik:GridBoundColumn DataField="Email" FilterControlAltText="Filter Email column" HeaderText="Email" SortExpression="Email" UniqueName="Email" ColumnEditorID="Email">           
                    <HeaderStyle Width="250px" />
                </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Name" SortExpression="Name" UniqueName="Name" ColumnEditorID="Name">           
                    <HeaderStyle Width="250px" />
                </telerik:GridBoundColumn>

1 Answer, 1 is accepted

Sort by
1
Accepted
Attila Antal
Telerik team
answered on 21 Nov 2022, 09:42 AM

Hi Brandon,

The easiest way to achieve the desired look is by using Templates (e.g. GridTemplateColumns). This does not require the use of EditForm Templates

<telerik:GridTemplateColumn DataField="ShipName"
    FilterControlAltText="Filter ShipName column" HeaderText="ShipName"
    SortExpression="ShipName" UniqueName="ShipName">
    <ItemTemplate>
        <%# Eval("ShipName") %>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("ShipName") %>'></telerik:RadTextBox>
        <telerik:RadLabel ID="RadLabel1" runat="server" Text="This is a label"></telerik:RadLabel>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

Result

 

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid Label
Asked by
Brandon Ian
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or