Copy Cell in GridView

In GridView add this column: 

<asp:CommandField ButtonType=”Button” SelectText=”” ShowSelectButton=”True” />

[\sourcecode]

Then in code-behind:


Protected Sub GridViewHandLinks_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)

 

If e.CommandName.Equals(Select) Then

 

Dim index As Integer = Convert.ToInt32(e.CommandArgument)

 

Dim row As GridViewRow = TryCast(GridViewHandLinks.Rows(index), GridViewRow)

 

TextBox1.Text = row.Cells(5).Text

End If

 

End Sub

[\sourcecode]

 

Advertisements

About Ahmed

Software craftsman, programmer, developer, system/business analyst, DBA and PM.
This entry was posted in ASP.NET, Programming, VB.NET and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s