473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

datagrid and template

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 ?
Nov 19 '05 #1
1 1017
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
el********@hotmail.com

-----Original Message-----
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 thatdescription 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 ?
.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrea Trevisan | last post by:
That's a revival of a known thing I suppose.I hope it's useful. My problem was: I want to have a DataGrid with two Template columns: first with TextBox,second with Button.I want to fire an event...
4
by: | last post by:
I have a datagrid with a template column that has a hyperlink and a label. The hyperlink text is bound to Title from my dataset and the label text is bound to Author in the dataset. The grid...
4
by: Richard Roche | last post by:
Is it possible to use a drop combo instead of a text box when using the EditCommand in the Datagrid? Many table columns are bound to 'lookup' tables, user's don't care about the foreign keys,...
2
by: damonf | last post by:
I'm currently trying to add an ASP hyperlink to a template column in a datagrid. The normal hyperlink column doesn't give me the ability to add attributes to the item. In my grid there are four...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
4
by: Stephan Bour | last post by:
Hi, I have a datagrid databound to a SQL query. I'd like to allow editing of some columns but not all. Is there a way to turn off the conversion of the datagrid cells to textboxes for some columns...
2
by: CW | last post by:
In an earlier thread, I was asking for help on "Invalid attempt to FieldCount when reader is closed" error when I was using a dataset rather than a datareader to bind to a datagrid. After...
1
by: Ken Varn | last post by:
I have a problem where my DataGrid would not maintain the ViewState of my databound rows. I finally narrowed down the problem. If my first column is a template column, the view state for the...
2
by: Santosh | last post by:
Dear all i want to bind data to datagrid header template i am wrtting follwing code it is displaying data with in item template not but it is display data in header template <asp:DataGrid...
8
by: Matt | last post by:
Guys I could really use some help with this. I think that it's probably a simple solution but I haven't been able to find anything. I have a datagrid on my form that I populate via code like...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.