Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gridview EmptyDataText="No data" - how to add style to the text 'No data'

I have a gridview control in my C# program and have just added an 'EmptyDataText' control that (as you know) displays a message if no records were found. When I view this page in design, the 'No data found' text is in times new roman and no style. Is it possible to make this text Verdana and also centre the text rather than it being on the left?

Look forward to your reply!

like image 728
Mike Avatar asked Dec 22 '22 08:12

Mike


2 Answers

You can also use EmptyDateTemplate in your gridview

<EmptyDataTemplate>
        <label style="color:Red;font-weight:bold">No records found !</label>
        </EmptyDataTemplate>
like image 119
Zo Has Avatar answered Dec 29 '22 14:12

Zo Has


You can set EmptyDataRowStyle-CssClass attribute to the css class you want to use.

<asp:GridView EmptyDataRowStyle-CssClass="your-css-class" />
like image 30
Edison Chang Avatar answered Dec 29 '22 14:12

Edison Chang