Tag Archives: GridView

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 … Continue reading

Posted in ASP.NET, Programming, VB.NET | Tagged , , | Leave a comment

Hide a GridView Column

If GridView1.Columns(0).Visible = False there will be an error: Index is out o range. Solution: GridView1.DataBind() If GridView1.Columns.Count > 0 Then         GridView1.Columns(0).Visible = False Else         GridView1.HeaderRow.Cells(0).Visible = False         For Each gvr As GridViewRow In GridView1.Rows                 gvr.Cells(0).Visible … Continue reading

Posted in ASP.NET, Programming | Tagged , , | Leave a comment