We help IT Professionals succeed at work.

How to Change the Look & feel of Gridview?

867 Views
Last Modified: 2008-07-16
Hi Experts,

How can i change the EmptyDatatemplate background color in a gridview.

Thanks for the help.
Comment
Watch Question

Commented:
       
           
             Empty data message here.   You can adjust the height and width to make it auto or a predefined number.

<!-- the border from the main style will be applied here so you might want to remove the border from teh style of the main grid if you do not want it on the emptydatatemplate -->
           
       
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
you may also change the EmptyDataRowStyle BackColor="Blue" on the main gridview control properties
    <asp:GridView ID="GridView1" runat="server" BackColor="#DEBA84" 
        BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
        CellSpacing="2" DataSourceID="dsID">
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        <EmptyDataRowStyle BackColor="Blue" />
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        <EmptyDataTemplate> 
        this is empty........
        </EmptyDataTemplate>
    </asp:GridView>

Open in new window

Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.