Prasad S M

Prasad S M

  • NA
  • 22
  • 0

How to change an image/icon in datagrid

Nov 4 2008 6:11 AM

Hi All

How to change an image/icon in datagrid when a button (External/outside tha datagrid) is clicked.

let be more precise..
Here I am Using Template Column to do Edit , Update and Cancel Actions.
when i click on AddNew Row Button..The datagrid displays a new blank row along with Update and Cancel Icons(including tooltips).But I need to change Update Icon to Insert Icon..

How Can this be done???...

I have tried with following code...

Dim enable As ImageButton = DirectCast(StatusGrid.FindControl("btnUpdate"), ImageButton)
enable.ImageUrl = "<img border = 0 src = ./Icons/add.jpg>"
enable.ToolTip = "Insert"

but I got "Object reference not set to an instance of an object." error

Please Guide...

Thank you.





 


Answers (1)