Click here to Skip to main content
15,914,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a gridview in which auto generate columns are true.
Now I have a edit command field and I want that it comes on right hand side of gridview.

How should it be done?

Help me please
Posted
Updated 14-Nov-10 18:11pm
v2

1 solution

You can try like bellow,
VB
Protected Sub Load_GridView(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.Load
      Try
          GridView1.Columns.Clear()
          'Dim col As New BoundField
          'col.DataField = "ProfileId"
          'col.HeaderText = "ID"
          'GridView1.Columns.Add(col)
          Dim colf As CommandField = New CommandField
          colf.EditText = "Edit"
          'colf.UpdateText = "Update"
          'colf.CancelText = "Cancel"
          'colf.ShowCancelButton = True
          'colf.ShowEditButton = True
          'colf.ShowSelectButton = True
          'GridView1.Columns.Add(colf)
          GridView1.Columns.Insert(0, colf)
      Catch ex As Exception
      End Try
  End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900