473,563 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:TemplateCo lumn>
<ItemTemplate >
<asp:Panel id="pnlDocument DetailsGrid" runat="server"
Visible="False" >
<TABLE id="Table112" cellSpacing="0" cellPadding="0"
width="100%" border="0">
<TR bgColor="#1d407 6">
<TD width="1%"> </TD>
<TD align="left">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff" >
<%# Container.DataI tem("descriptio n")%>
</FONT>
</TD>
<TD align="right">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff" >
Bulletin: <%# Container.DataI tem("uploaddate ")%>
</FONT>
</TD>
<TD>
<IMG src="../images/Curly.jpg"></TD>
</TR>
</TABLE>
</asp:Panel>
</ItemTemplate>
</asp:TemplateCol umn>

Here is my codebehind itemdatabound event:
Sub dGridAvailableD ocuments_Bound( ByVal sender As Object, ByVal e As
DataGridItemEve ntArgs)
If cBoxDocDetails. Checked Then
e.Item.FindCont rol("pnlDocumen tDetailsGrid"). Visible = True
End If

End Sub

Thanks

Manny

Nov 19 '05 #1
1 1572
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.visibilit y properties. You will want
to pass the panel ClientId from the server to the checkbox's onclick event
handler.

Eliyahu

"Manny Chohan" <Ma*********@di scussions.micro soft.com> wrote in message
news:A6******** *************** ***********@mic rosoft.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:TemplateCo lumn>
<ItemTemplate >
<asp:Panel id="pnlDocument DetailsGrid" runat="server"
Visible="False" >
<TABLE id="Table112" cellSpacing="0" cellPadding="0"
width="100%" border="0">
<TR bgColor="#1d407 6">
<TD width="1%"> </TD>
<TD align="left">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff" >
<%# Container.DataI tem("descriptio n")%>
</FONT>
</TD>
<TD align="right">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff" >
Bulletin: <%# Container.DataI tem("uploaddate ")%>
</FONT>
</TD>
<TD>
<IMG src="../images/Curly.jpg"></TD>
</TR>
</TABLE>
</asp:Panel>
</ItemTemplate>
</asp:TemplateCol umn>

Here is my codebehind itemdatabound event:
Sub dGridAvailableD ocuments_Bound( ByVal sender As Object, ByVal e As
DataGridItemEve ntArgs)
If cBoxDocDetails. Checked Then
e.Item.FindCont rol("pnlDocumen tDetailsGrid"). Visible = 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
840
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 controlling the visibility of columns in the DataGrid control. The problem usually comes down to one fact. The DataGrid has a property called...
4
1349
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 visibility is set to 'false', and so the UC depCal is not rendered on the page. Hence the following code in the InitializeComponent() method...
3
1772
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
1860
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 controls). I control the visibility of the panels according to what mode the ascx is in.
1
1717
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 from code-behind file? -------------------------------- From: Mia Williams ----------------------- Posted by a user from .NET 247...
2
1924
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 page load the panel works as expected but when I load the datagrid the panel expands off the side of the page to accomidate the new grid size. Does...
8
3010
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 way I'm going about doing this might be a little off. I'd appreciate some help. Below is the code I have thus far but I'm not sure how to...
7
3233
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. After that...the datagrid will show.I would like to control the height for datagrid after generate... but i only can control the width....any one have...
7
6640
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 tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: ...
0
7583
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.