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

making a button not visible in a datagrid

Ok I would expect this to be easy but am running into some problems.

I have a templete column in my datagrid with a button.

<asp:TemplateColumn HeaderText="E-Mail Proposal"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<input type="button" name="email" value="EMail"
onclick="OpenOutlookDoc('IPM.Note.FormA', '<%#
(DataBinder.Eval(Container.DataItem, "FilenameURL").ToString().Replace("\\",
"\\\\")) %>')" />
</ItemTemplate>
</asp:TemplateColumn>
Now I want to make this button visible at times and not visible at other
times. As you can see the on click called some java script. To get the
visible property to work I have tried to set the runat ="server" but I get
an error when I do this "The server tag is not well formed" Any idea how I
can get this to work?

TIA,
Brett

May 24 '07 #1
1 1767
Hi,

You can modify the style of the button, basically you set the "visibility"
to either "hidden" or "visible" , you can do it from a script in the client

button1.style.visibility = "hidden";

You can do a similar thing in the server side.

"Brett Wesoloski" <br*********@pai.comwrote in message
news:uY**************@TK2MSFTNGP03.phx.gbl...
Ok I would expect this to be easy but am running into some problems.

I have a templete column in my datagrid with a button.

<asp:TemplateColumn HeaderText="E-Mail Proposal"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<input type="button" name="email" value="EMail"
onclick="OpenOutlookDoc('IPM.Note.FormA', '<%#
(DataBinder.Eval(Container.DataItem,
"FilenameURL").ToString().Replace("\\", "\\\\")) %>')" />
</ItemTemplate>
</asp:TemplateColumn>
Now I want to make this button visible at times and not visible at other
times. As you can see the on click called some java script. To get the
visible property to work I have tried to set the runat ="server" but I get
an error when I do this "The server tag is not well formed" Any idea how
I can get this to work?

TIA,
Brett

May 24 '07 #2

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

Similar topics

1
by: PCB | last post by:
Hi all, Not sure if this is possible, but can I change the controls of a command button on a per record bases in a subform. In my case, I would like to make a command button visible only if...
1
by: Marc Lefebvre | last post by:
Why I was unable to hide the previous button in the following code ? private void ButtonClick(Object sender, System.EventArgs e) { Button button = (Button)sender; Button previousButton =...
8
by: sumit | last post by:
Hi, I want to add one java script function on the click of page button of datagrid. But how to get UI control of page button so that i should be able to add attribute for onClick event. ...
6
by: tshad | last post by:
I have 2 buttons: <asp:ImageButton ID="ExpandButton" runat="server" Font-Size="2" ImageUrl="../images/expand.jpg" Width="16" Height="16" CommandName="Select" AlternateText="Click here to see...
5
by: Jeff User | last post by:
Hello ..NET 1.1, VS 2003, C# & asp.net I have tried to follow msdn instructions and samples but I can not get an event to fire for this button on the datagrid. There has to be something obvious...
1
by: jodyblau | last post by:
I have a form that is in Continuous form. In each record there is a button next to the a date box. When the button is pushed, the calendar control is set to visible (rather than in a seperate pop...
0
by: Dan | last post by:
Issue making textbox visible based on specific input from a radio button list in an EditItemTemplate I want to setup a gridview that when in edit mode and when the user selects "Other" from a...
5
by: Doogie | last post by:
Hi, I am trying to access the visible property of an ASP button inside javascript to no avail. Here's what my button control looks like: <asp:Button id="btnAcceptTrips" name="btnAcceptTrips"...
4
by: peerraghu | last post by:
hi I am creating travels project, in left part of my datagrid of my default page i placed all the products such as india tour ,world tour etc and if v click any product it will redirect to...
4
by: shalini166 | last post by:
I place command button in datagrid. When i click one button in the column.Another form or other datagrid will open. i don't how to make click event for column in the datagrid.please help me. ...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
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...
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...

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.