473,382 Members | 1,392 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,382 software developers and data experts.

Control panel visibility inside datagrid

Hi,
i have a template column in datagrid. Inside template column i have panel. I
want to control the visibility of the panel with checkbox. can this be done?

<asp:TemplateColumn>
<ItemTemplate>
<asp:Panel id="pnlDocumentDetailsGrid" runat="server"
Visible="False">
<TABLE id="Table112" cellSpacing="0" cellPadding="0"
width="100%" border="0">
<TR bgColor="#1d4076">
<TD width="1%"> </TD>
<TD align="left">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff">
<%# Container.DataItem("description")%>
</FONT>
</TD>
<TD align="right">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff">
Bulletin: <%# Container.DataItem("uploaddate")%>
</FONT>
</TD>
<TD>
<IMG src="../images/Curly.jpg"></TD>
</TR>
</TABLE>
</asp:Panel>
</ItemTemplate>
</asp:TemplateColumn>

Here is my codebehind itemdatabound event:
Sub dGridAvailableDocuments_Bound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs)
If cBoxDocDetails.Checked Then
e.Item.FindControl("pnlDocumentDetailsGrid").Visib le = True
End If

End Sub

Thanks

Manny

Nov 19 '05 #1
1 1567
Manny,

It's a client-side task. In ItemDataBound event add "onclick" attribute to
the checkbox. It will be your client-side onclick event handler. In the
handler you will need to find the panel by it's id and control it's
visibility via style.display or style.visibility properties. You will want
to pass the panel ClientId from the server to the checkbox's onclick event
handler.

Eliyahu

"Manny Chohan" <Ma*********@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
Hi,
i have a template column in datagrid. Inside template column i have panel. I want to control the visibility of the panel with checkbox. can this be done?
<asp:TemplateColumn>
<ItemTemplate>
<asp:Panel id="pnlDocumentDetailsGrid" runat="server"
Visible="False">
<TABLE id="Table112" cellSpacing="0" cellPadding="0"
width="100%" border="0">
<TR bgColor="#1d4076">
<TD width="1%"> </TD>
<TD align="left">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff">
<%# Container.DataItem("description")%>
</FONT>
</TD>
<TD align="right">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff">
Bulletin: <%# Container.DataItem("uploaddate")%>
</FONT>
</TD>
<TD>
<IMG src="../images/Curly.jpg"></TD>
</TR>
</TABLE>
</asp:Panel>
</ItemTemplate>
</asp:TemplateColumn>

Here is my codebehind itemdatabound event:
Sub dGridAvailableDocuments_Bound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs)
If cBoxDocDetails.Checked Then
e.Item.FindControl("pnlDocumentDetailsGrid").Visib le = True
End If

End Sub

Thanks

Manny

Nov 19 '05 #2

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

Similar topics

1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
4
by: Iain Porter | last post by:
Hi all, I have a usercontrol (a textbox with dropdown calendar that fills the textbox with the selected date) that I implement in a datagrid in a webform. On first loading the page, the datagrid's...
3
by: Fre | last post by:
Hi, Someone who can give me a tip how i can use a panel inside a datagrid? Thx in advance! Frederik
2
by: Martin | last post by:
Hi, I want to create a number of ascx controls with edit and view modes. Previously I have put two panels in the ascx - one for view (with label subcontrols), and one for edit (with text box...
1
by: Mia Williams via .NET 247 | last post by:
(Type your message here) I have user control (listpanel control) and I ahve to display the search results inside the list panel user control.. how can I do that? Can i access the list panel control...
2
by: tjfdownsouth | last post by:
I am using a panel inside an asp.net 2.0 page so that I can have the scrolling capabilities. Inside the panel I have a datagrid that I would like to stay within a certain area. On the initial...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
7
by: Localbar | last post by:
hi all, my problem is...i have 2 textbox for user input no. of row and no.of column. After user input, the datagrid will show what user input....for example: user input 5 rows and 6 column....
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.