Apply Bootstrap icons to GridView CommandField Buttons in ASP.Net

Last Reply 10 months ago By pandeyism

Posted 10 months ago

Hi all,

With reference to below link.

https://www.aspsnippets.com/Articles/Simple-Insert-Select-Edit-Update-and-Delete-in-ASPNet-GridView-control.aspx

Is it possible to show custom buttons or bootstrap icon buttons in gridview to edit ,update ,delete the data.

Thanx in Advance.

 

Posted 10 months ago

Hi Waghmare,

Please use below code.

HTML

<asp:CommandField ButtonType="Link" ShowEditButton="true" ShowDeleteButton="true"
EditText="<i aria-hidden='true' class='glyphicon glyphicon-pencil'></i>" DeleteText="<i aria-hidden='true' class='glyphicon glyphicon-trash'></i>"
CancelText="<i aria-hidden='true' class='glyphicon glyphicon-remove'></i>" UpdateText="<i aria-hidden='true' class='glyphicon glyphicon-floppy-disk'></i>" />