tags:

views:

45

answers:

2

Is there a way to put icons for each row in a DataGrid in c #?

A: 

On WinForms, you could add a DataGridViewImageColumn and populate it with images for each row.

Anna Lear
ok, and can i hide only the ColumnHeader of the DataGridViewImageColumn?
You can't hide the column header entirely, but you can set the header text to an empty string and set column's sizing to AllCells. That'll basically size the column down to the dimensions of your biggest image.
Anna Lear
A: 

I'm going to assume ASP.Net. Here's an example with an image button. If you can provide more information, a better answer can be provided.

<asp:GridView ID="gridView1" runat="server">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:ImageButton ID="imageButton1" runat="server" ImageUrl="some_image.jpg" /></ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
Germ