datagrid and template

V

ven

HELLO
i have datagrid with template column


<asp:TemplateColumn HeaderText="nazwa">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<P>
<asp:LinkButton id=LinkButton1 runat="server"
CausesValidation="False" Text='<%# DataBinder.Eval(Container,
"DataItem.name") %>' CommandName="szczegol" CommandArgument='<%#
Container.DataItem("id_artykulu") %>'>
</asp:LinkButton></P>
<P>
<asp:Label id=Label2 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.description") %>'>
</asp:Label></P>
</ItemTemplate>
</asp:TemplateColumn>

where i have name of the item and description of item....
Now i wanna to add selection on page that will allow selecting that
description is visible or not visible
i wanna use dropdownlist with two values - visible and not visible then :

if dropdownlist1.selectedvalue="visible" then
?????????????
else
?????????????
end if

How can i do that ?
 
E

Elton Wang

Hi Ven,

Do something like:

dim visible as boolean
if dropdownlist1.selectedvalue="visible" then
visible = true
else
visible = false
end if

for each item as datagriditem in datagrid.Items
CType(item.FindControl("lblID"), Label).Visible =
visible
next


HTH

Elton Wang
(e-mail address removed)

-----Original Message-----
HELLO
i have datagrid with template column


<asp:TemplateColumn HeaderText="nazwa">
<HeaderStyle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top