开发者

Adding icons in DataGrid

Is 开发者_JAVA百科there a way to put icons for each row in a DataGrid in c #?


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


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜