In the GridView area, put this in as
<asp:TemplateField HeaderText="Status" SortExpression="IP">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("IP") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Image ImageUrl='<%# getPing(DataBinder.Eval(Container.DataItem,"IP")) %>' runat="server" Width="30" >
</asp:Image>
</ItemTemplate>
</asp:TemplateField>
On the aspx.cs area, put this in:
Public Function getPing(ByVal sender As String) As String
Dim pingSender As New Ping()
Dim options As New PingOptions()
' Use the default Ttl value which is 128,
' but change the fragmentation behavior.
options.DontFragment = True
' Create a buffer of 32 bytes of data to be transmitted.
Dim data As String = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Dim buffer() As Byte = Encoding.ASCII.GetBytes(data)
Dim timeout As Integer = 1200
Dim reply As PingReply = pingSender.Send(Trim(sender), timeout, buffer, options)
If reply.Status = IPStatus.Success Then
Return "true.png"
Else
Return "false.png"
End If
End Function
As you can see, the field will show a result returned from the VB method as a png.