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

I have a gridview control in my C # program and just added an EmptyDataText control that (as you know) displays a message if no records are found. When I look at this page in design, the text "No data" in the days of the new Roman style and style. Is it possible to make this text Verdana, as well as the center of the text, and not on the left?

Looking forward to your reply!

+3
source share
3 answers

You can also use EmptyDateTemplate in gridview

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

-: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.emptydatatext.aspx

: EmptyDataText = <div style=\"width:100%;color:red;\">No data found </div>" → .

+1

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

<asp:GridView EmptyDataRowStyle-CssClass="your-css-class" />
+1
source

Source: https://habr.com/ru/post/1720762/


All Articles