kristenk Posted March 31, 2003 Posted March 31, 2003 I have created a hyperlink column in my datagrid using the property builder of the grid. I have also bound that hyperlink to a field in my dataset. I would like to, based on the user's security, enable the link for some records in my dataset and disable others. How do I do this? Quote
bungpeng Posted April 1, 2003 Posted April 1, 2003 You can use your SQL statement to control before you bound data into DataGrid Quote
CraigB Posted September 18, 2003 Posted September 18, 2003 KristenK, Did you ever figure this out? I am need of the same exact thing! Any help would be appreciated! Quote
Disco_gal_1 Posted March 16, 2006 Posted March 16, 2006 Same problem KristenK, Did you ever figure this out? I am need of the same exact thing! Any help would be appreciated! I am trying to do the same thing. I am able to disable the column using the itemdatabound event but the link can still be clicked. Any ideas? Quote
ashutosh9910 Posted March 21, 2006 Posted March 21, 2006 I am trying to do the same thing. I am able to disable the column using the itemdatabound event but the link can still be clicked. Any ideas? Private Sub DataGrid_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid.ItemDataBound If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then If Trim(e.Item.Cells(4).Text) = "P" Then'''''''THis was my condition Use your security condition here e.Item.Cells(5).Text = "" ' don't show Data link End If End If End Sub Replace e.Item.Cells(4) & (5) by appropriate cell numbers HTH Ashutosh Quote http://vyasashutosh.blogspot.com
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.