Hi all
I have datagridview with columns 1.task 2.taskdetail 3.Priority etc
Now i want that if a task have high priority it should show high priority icon and if low priority:may show low priority icon.Icons are saved in images folder of the project.How can i show icons to the tasks according to its priorty.Grid shoul look something lilke ths:

Task Task Detail Othercolumns
[Icon]TaskName .......... ..............

Hi...Let me try to help you...
I have the same case with you, but this is not 100% perfect like you want, because I still use CommandField

<asp:GridView ID="GVFunding" runat="server" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged ="GVFunding_SelectedIndexChanged" AutoGenerateColumns="False" BackColor="White"  BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CaptionAlign="Top" CellPadding="0" CellSpacing="1" DataSourceID="SDSFunding" Font-Size="12px" Font-Strikeout="False" Font-Underline="False" Height="1px" HorizontalAlign="Left" Style="left: 3px;top: 132px"  Width="140%">
            <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
            <Columns>
                <asp:TemplateField>
                     <itemTemplate>
                     <anthem:Image ID="Img" runat="server" BackColor="Transparent" Height="17px" ImageUrl='~/Transactions/BBS/Images/Reply.gif' Width="17px" />                     
                    </itemTemplate>
                </asp:TemplateField>
                <asp:CommandField HeaderText="Read &amp; Comment" SelectText="Read &amp; Comment" ShowSelectButton="True" >
                    <itemstyle forecolor="Blue" />
                </asp:CommandField>
                <asp:BoundField dataField="TransNo" HeaderText="Trans. No." SortExpression="TransNo" />
                <asp:BoundField dataField="TransactionDate" HeaderText="Trans. Date" SortExpression="TransactionDate" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False"/>
                <asp:BoundField dataField="CustomerName" HeaderText="Cust. Name" SortExpression="CustomerName" />              
       </Columns>
            <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
            <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" Font-Italic="False" Font-Underline="False"
                ForeColor="#E7E7FF" />
            <EmptyDataRowStyle BackColor="Black" ForeColor="Red" Height="1px" />
        </asp:GridView>




 Protected Sub GVFunding_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVFunding.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim NewImg As Image = CType(e.Row.FindControl("Img"), Image)
            Dim I As Byte
            Dim IsRead As String = GetFieldValue("TrxBulletinBoardUser", "TransNo", e.Row.Cells(2).Text.Trim, "UserID", Session("UserID"), "IsRead")
            If IsRead = "" Or IsRead = "0" Then              
                NewImg.ImageUrl = "~/BBS/Images/New.gif"
            ElseIf IsRead = 1 Then
                Dim IsReplied As String = GetFieldValue("TrxBuleltinBoardUser", "TransNo", e.Row.Cells(2).Text.Trim, "UserID", Session("UserID"), "IsReplied")
                If IsReplied = "1" Then
                    NewImg.ImageUrl = "~/BBS/Images/Reply.gif"
                Else
                    NewImg.ImageUrl = "~/BBS/Images/Read.gif"
                End If
            End If 
        End If
    End Sub

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.