468,556 Members | 2,387 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,556 developers. It's quick & easy.

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 1243
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Gaurav Gargate | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.