Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify Asp gridview boundfield

I want to add some text to a boundfield build in the code behind without writing any code in the code behind.

example I receive "overflow" in a specific field, and i'd like to display "stack overflow" and if i receive "house" i want to display "stack house"

is there a property to put text behind or after whatever comes in the boundfield ?

like image 527
Marcelo Avatar asked Aug 31 '26 08:08

Marcelo


1 Answers

Use a custom column.

  <asp:TemplateField HeaderText="MyColumn">
    <ItemTemplate> 
         stack <asp:Literal runat="server" Text="<%#Eval("myField")%>" />
    </ItemTemplate>
  </asp:TemplateField>  
like image 141
Jan Jongboom Avatar answered Sep 02 '26 21:09

Jan Jongboom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!