C# – Gridview EmptyDataText=”No data” – how to add style to the text ‘No data’

cemptydatatextgridview

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!

Best Answer

You can also use EmptyDateTemplate in your gridview

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