• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 934
  • Last Modified:

GridView Hide Update Link

I am handling the updating of my gridview using a button below the gridview.

I want to be able to hide the update link when you are editing a record, but keep the cancel link.

any ideas ??
0
mpdalton
Asked:
mpdalton
  • 2
1 Solution
 
arif_eqbalCommented:
Just set the Visible Property of the Button to False
on the Row_Editing event of the Grid
and show it back again on Cnacel or Update event
0
 
mpdaltonAuthor Commented:
this is a link, not a button. i can see all of the controls and access them using their name, but cannot see the update and cancel links by id.

when i look at the source they don't seem to have names that i can refer to.

any ideas ?
0
 
arif_eqbalCommented:
Oh OK I got your point....You want to hide the Normal "Update" link that the Grid shows in each column when you edit the Row, because you would handle the Update from a separate button. Is it ?

Then try this...

On the Row_Created event of the Grid write this
       
        If (e.Row.RowState And DataControlRowState.Edit) Then
            e.Row.Cells(0).Controls.RemoveAt(0)
        End If

This assumes that the first row is where the "Update" and "Cancel" buttons in the same order
(otherwise you  might need to change the index in the code above)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now