Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Button in grid sometimes
Message
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01349499
Message ID:
01349590
Views:
13
Here is a link I found http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23243328.html

>I can access the visible property of the cell but it is readonly.
>
>Con_campDataGridView.Item(e.ColumnIndex, e.RowIndex).Visible = False
>
>
>>>I have a Datagrid where I would like to have a button show if a field has a value and not show if no value is present.
>>>
>>>I currently change the button's caption with the code below.
>>>
>>>
>>>
>>>
>>>  Private Sub Con_campDataGridView_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles Con_campDataGridView.CellFormatting
>>>
>>>        Dim i As Integer
>>>        i = Me.Con_campDataGridView.Columns("file_loc").Index
>>>
>>>        If e.ColumnIndex = i And e.RowIndex > -1 Then
>>>            e.FormattingApplied = True
>>>            If IsDBNull(e.Value) Or e.Value Is Nothing Then
>>>                e.Value = ""
>>>                ' I would like to hide the button if not file is available
>>>
>>>            Else
>>>                e.Value = "Show Image"
>>>            End If
>>>        End If
>>>
>>>    End Sub
>>>
>>
>>Can you access the button through Controls array? If yes, then just set its visible property to false.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform