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

Mike picture Mike · Oct 22, 2009 · Viewed 13.8k times · Source

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!

Answer

Zo Has picture Zo Has · Jan 12, 2012

You can also use EmptyDateTemplate in your gridview

<EmptyDataTemplate>
        <label style="color:Red;font-weight:bold">No records found !</label>
        </EmptyDataTemplate>