Hiding a hyperlink field if another field has a certain value

Hello all,

I have a GridView and in it is have a bound data field and a hyperlink field.  The data field provides status information on data and when that data reaches a certain stage i want a hyperlink to be available in the hyperlink field.  The hyperlink cannot be there any other time.

This is what I have tried already...

 

Protected Sub grdvCPBatches_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdvCPBatches.RowDataBound
        If e.Row.Cells(4).Text = "Not Uploaded" Then
            e.Row.Cells(5).TemplateControl.Controls.Item(0).Visible = False
        Else
            e.Row.Cells(5).TemplateControl.Controls.Item(0).Visible = True
        End If
End Sub
 

I have also tried using...

e.Row.Cells(5).TemplateControl.Visible = True/False 

 
I have tried hiding the cell but my formatting makes it obvious that I have done so.

 

Any ideas? 

 

 

0
adjones1980
5/10/2007 8:19:16 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies
614 Views

Similar Articles

[PageSpeed] 59

Anyone?
0
adjones1980
5/10/2007 12:34:46 PM

Hi,

You can use the Inline IIF function to control for the visible property of your hyperlink based on another column.

Here is a sample:

<asp:TemplateField HeaderText="mylink1">

<ItemTemplate>

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Host", "yourpage.aspx?host={0}") %>'

Text='<%# Bind("Host") %>' Visible='<%#IIF(CONVERT.ToString(Eval("linkFlag"))="Not Uploaded",False,True) %>'></asp:HyperLink>

</ItemTemplate>

</asp:TemplateField>
Limno

0
limno
5/10/2007 2:18:19 PM
Reply:

Similar Artilces:

Selecting value in one field then causes value in another field to be selected.
I have a web form which contains a date field, the date is populated using a DatePicker which is Javascript based. The form also has a drop down box containing 3 values. What I want to do is when a date has been selected that this will cause the dropdown list value to change to dated which is one of its 3 values. i.e. when the date field is not blank then the value will be selected in the dropdown. What I also want to happen is when the date has been selected and the dropdown value is dated then the date field and the dropdown field will be set to read only.Anyone any ideas how to this usin...

how to pass field value to another field
how can i take an id field value from one table and insert it to a field in another table? my insert for document is this: const string sql = "INSERT INTO document(doc_id, doc_name) VALUES(doc_id, doc_name)"; my insert for staff data: success = (int)ApplicationBLL.InsertData(staff_name, staff_loc); each staff must be linked to one document. therefore i have staff_id in both tables. staff_id (pk with identity seed) in staff table and staff_id in document table. But when i run application it says cannot insert null into staff_id in document. could I hardcode it to pass staff_id f...

Custom field controlled by other fields value
Hi i want to create a custom field with values shared by only 2 or 3 products for example. the only way i found is to duplicate this value 3 times (numbers of products having this field value). this is impossible because there is a constraint on the value of the custom field on the database. do you think that i can drop the constraint concerning this field from the database? Thanks a lot Fida On 10/22/2010 07:32 AM, fida wrote: > do you think that i can drop the constraint > concerning this field from the database? No, Bugzilla will not function properly with dupl...

adding a field and hiding another field
Hi I am trying to customize bugzilla. I have to add a field called Build in query and enter bug. It should populate all the builds for that product and version in query page and enter_bug page. I could able to populate builds when I select version but when I select product the builds are not populating. I have made changes in the following files. Global.pl query.cgi form.html.tmpl I have to hide the field Platform because we don't want to use it. I made changes in enter_bug.cgi show_bug.cgi post_bug.cgi edit.html.tmpl I am getting an error , legal platform not selected Can...

Field that controls the values that appear in this field...
SGVsbG8gRXZlcnlib2R5IQ0KDQpJJ20gd29ya2luZyBvbiBpbXBsZW1lbnRpbmcgYSBuZXcgaW5z dGFuY2Ugb2YgQlogNC40LjIgSSBuZWVkIHRvIGFkZCB0aGUgZm9sbG93aW5nIGZpZWxkczoNCg0K MS4gRGlzdHJpY3QNCjIuIFNjaG9vbCBEZXBlbmRzIG9uIERpc3RyaWN0DQozLiBUZWFjaGVyICBE ZXBlbmRzIG9uIFNjaG9vbA0KDQpJIGNvdWxkIGRvIHRoZSBSZWxhdGlvbnNoaXAgYmV0d2VlbiB0 aGVtLCBidXQgdGhlIGlzc3VlIGlzIEkgaGF2ZSBsaWtlIDUwMCsgdGVhY2hlcnMsIHNvIHdoZW4g SSB0cmllZCB0byBjcmVhdGUgYSBidWcgaXQgdGFrZXMgYSBsb25nIHRpbWUgYW5kIEkgaGF2ZSBl cnJvciBvbiB0aGUgY2hyb21lLCBJIGd1ZXNzIGlzIGZvciB0aGUgYW1vdW50IG9mIGluZm8gb24g Y2ZfdGVhY2hlciB0YWJsZS4NCg0KSXMgdGhlcmUgYSB3YXkgSSBjYW...

Field that controls the values that appear in this field
--_009_EEA7F24FEA5EDC42BC3FD72846A5D8F84138437CAMSPRD0711MB593_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Can I use the option of "Field that controls the values that appear in this= field" for non-custom fields? Thanks, Shalom. Shalom Shevach | QA Manager Comigo Ltd. O: +972- 9-771-5090 Ext. 119 | F: +972- 9-771-5091 | www.comigo.com<http= ://www.comigo.com/> E-mail: shalom.shevach@comigo.com<mailto:shalom.shevach@comigo.com> [Description: Description: Comigo]<http://comigo.com/&...

Gridview Hyperlink Field needs to include value from a previous gridview and a field value
Hi all Hope you can help, here is what I'm trying to do. I have a gridview on a page that contains a value (PracticeCode) I use this value as a parameter to filter an additional GridView (Gridview2). Now what I also want to do is take that value (PracticeCode) and use it in as part of the URL for a hyperlink field in GridView2 concatenatint it with the value of a Gridview field called Documentname so that: Hyperlink field URL Is "/store/" & PracticeCode & "/" and DocumentName Anyone know how to do this  regards chubsterit wasn't me, ...

DetailsView: conditionally hide field if value == null, but can't update the value of other fields
Hi, I need help please. I have made some fields hidden if their value is null by setting visible to false on the DetailsView1_Itemcreated event. I put the field's to the DataKeyNames, so that I can check the value is null or not when detailsview is at the readOnly mode.But, when I tried to edit, it throws an error: must declare a scalar for @...  so, i add some code in the DetailsView1_ItemUpdating: e.newValues["color"] = null; then the error is gone. but, the values for other fields are not updated. I already check the e.newValues["other fields"] , they all are ...

populate a field with another field value onclick event
On ButtonClick, I want the hidden field orderValue to read the value from Amount. The above alert statement is correct but when I write the document.Test.orderValue.value tot he database it inserts a blank field. When I view source files, the value from OrderValue is still blank. Pls assis in how i resolve this function ClickEvent() { if (document.getElementById('btn').onclick) { document.Test.orderValue.value = document.Amount.value; alert(document.Test.orderValue.value); } } <form name="Test"> <input type="hidden" name="o...

HT do a simple field update based on value in another field...
All- Please help with what must be a simple SQL INSERT solution (VB please): Supposing I have detailsview that is the interface for a table that has at least these fields: record_id (smallint, autofilled by db)some_boolean (int)id_copy (smallint) Of these fields, the user is prompted only for a value for the some_boolean field. The functionality I'm looking for: If the user sets some_boolean to true (eg, checking a checkbox) and then clicks Submit, I would like SQL INSERT to copy the record_id that is assigned to the record to the id_copy field. If some_boolean ...

linking a sql field to point to the value of another sql field
is it possible to create hyperlinks in powerbuilder such that if you retrieve two fields from a database.. and want to display the first field on the screen and have it link to the value of the other field (when clicked) which is actually a URL address, you can? any help will be appreciated. thank you! ...

Can a field in Gridview be a Hyperlink field as well as Template field?
I have to add Template field  to Gridview and use data binding statement such as "<%# GetData(Eval("DType").ToString())%>" in the ItemTemplate. so that column retrieve/shows GetData("DType") values. When user clicks on this column it should redirect the user to another page, showing selected/clikced datarow . I think it is to do with Dynamic Hyperlink Field. I like to know can a column be a Hyperlink field as well as Template field so that i can use data binidng statement as above and do hyperlink task as well. your quick suggestion ...

Compare a field to what a value would be if it were in that field
We have been caught more than once with an error that's easy to fall into, described below. What I would like is something like is a way to treat a value as it would be if it were assigned to an existing database column, e.g. WHERE field = CAST(value AS TYPEOF(field)) or maybe some field matching operator that implicitly casts the value to the fields type before the comparison, e.g. WHERE field MATCHES value The problem we hit can be happen in SQL or in the invoking application, but it goes something like: <pseudocode GripeAboutSyntax="OFF">...

Dynamically Creating Controls On Postback in response to another field value
Hi,I Need to create a number of controls (dropdownlist) on postback in response to the value in another field.   Most of the page controls are added dynamically as I don't know what fields to display at design time and I have these working except for this. Example Senario: I have a database table to store a list of masterpages and a related table to store the Content Placeholders.  In my page the user selects the masterpage and then for each Content Placeholder I add a drop list of modules for the user to choose from and this is set to AutoPostback. (This bit is working)...

Web resources about - Hiding a hyperlink field if another field has a certain value - asp.net.presentation-controls

Hyperlink - Wikipedia, the free encyclopedia
A hyperlink points to a whole document or to a specific element within a document. Hypertext is text with hyperlinks. A software system for viewing ...

SA Supreme Court rules Dr Janice Duffy was defamed by Google through its hyperlinks, auto-complete and ...
A FORMER SA Health researcher has won a six-year legal battle against Google, proving she was defamed by the internet giant due to the way it ...

Banned hyperlinks could cost you $11,000 a day
The Australian communications regulator says it will fine people who hyperlink to sites on its blacklist, which continues to be controversially ...

ANALYSIS - Supreme Court hyperlink decision a victory for free speech
A hyperlink by itself should never be seen as 'publication' of other content, the Supreme Court said. But when it comes to libel the court did ...

Review: HyperLink is a great, inexpensive steel bracelet for the Apple Watch
Apple's own stainless steel link bracelet is too expensive for many of us to consider. HyperLink, however, is a less expensive alternative that ...

Apple's 'audio hyperlink' tech can control devices with inaudible sonic pulses
An Apple patent filing published by the U.S. Patent and Trademark Office on Thursday describes a method of encoding hyperlinks into an audio ...

Patent troll sending out invoices for image hyperlinks
A company named Vuestar thinks everyone who links images to pages on the Web …

How Effective Hyperlinks Can Help Your Blog
... link text explain exactly where the link is leading you or does it say something generic like click here ? When I saw Writing Effective Hyperlinks ...

Gmail's Shortcut for Inserting Hyperlinks
... doesn't mean Google shouldn't improve them. Many people complained that Gmail's rich text editor doesn't have a shortcut for inserting hyperlinks ...

Scientology loss keeps hyperlinks legal
The Church of Scientology loses a courtroom battle to compel a Dutch writer and her ISP to remove postings from a Web site, in a ruling that ...

Resources last updated: 11/24/2015 10:23:49 PM