Posted by: ayhan | 13/06/2011

Stok Kontrol Grid View TemplateField

ASP.Net gridtte gelen bir alana göre stokta var ya da stokta yok aktif pasif yazdırmak istiyorsanız.  Grid’in “OnRowDataBound” Event’ını kullanmak yerine aşağıdaki basit çözümü de kullanabiliriz.           

           <asp:TemplateField HeaderText="IsUsed">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblIsActive" Text="Kullanıldı" ForeColor="Red" Visible=<%#Eval("IsUsed").ToString()=="True" %>></asp:Label>
                    <asp:Label runat="server" ID="Label1" Text="Kullanılmadı" ForeColor="Green" Visible=<%#Eval("IsUsed").ToString()!="True" %>></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: