472,352 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Need to dynamically add or remove the EditButton on a Editable DataList in VB.NET

Hello,

I have a editable DataList, and would like the Edit Button to be appear or
not appear dynamically based on the access the logged in person has.

I have tried to use the visible=false, with no luck.

Any help would be great an example in VB.NET would be the most helpful.

Thanks in advance for your time and help,

Jack
Nov 18 '05 #1
1 1316
You can accomplish this in the itemcreated event of the DataList. Use a
template, so you can give your controls a recognizable ID. Here is an
example of how to find a particular control:

Dim itm As DataListItem = e.Item
Select Case itm.ItemType

Case ListItemType.EditItem
tb = DirectCast(itm.FindControl("txtStartDate"), TextBox)

Then, you can set the .visible property as needed.

"jack" <ja**@mrolinux.com> wrote in message
news:Or**************@tk2msftngp13.phx.gbl...
Hello,

I have a editable DataList, and would like the Edit Button to be appear or
not appear dynamically based on the access the logged in person has.

I have tried to use the visible=false, with no luck.

Any help would be great an example in VB.NET would be the most helpful.

Thanks in advance for your time and help,

Jack

Nov 18 '05 #2

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

Similar topics

1
by: Josh | last post by:
Hi Guys, I have been having a big problem with trying to pass parameters into a user control when the user control is dynamically loaded into a...
2
by: stb | last post by:
Hi. Is it possible to write inline Templates for a DataList dynamically in the HTML code, based on the DataSet that is bound to the DataList? ...
0
by: Gaurav Gargate | last post by:
Hi Group, I am creating a ASP.NET (C#) project. I am creating a datalist with some dynamically generated text boxes in the edit template. I...
0
by: yjh0914 | last post by:
hi guys! so im basically editting my post i made earlier as it wznt as specific.. i have to make a program that basically ranks students by their...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.