This is a migrated thread and some comments may be shown as answers.

GridImageColumn change image client side / js

2 Answers 167 Views
Grid
This is a migrated thread and some comments may be shown as answers.
KK60
Top achievements
Rank 1
KK60 asked on 05 Jun 2014, 06:31 PM
Is there a way to dynamically change the image in a GridImageColumn using javascript?  I have the row index and am able to:

var rowDataItem = grid.get_masterTableView().get_dataItems()[Index];

With this information, how can I access/change the image in one of several GridImageColumn columns of the row?

Thanks

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Jun 2014, 10:44 AM
Hi,

One suggestion is that you can update the innerHtml of the GridImageColumn from JavaScript as follows.

JavaScript:
var grid = $find("<%=radgrdOrders.ClientID%>").get_masterTableView();
var rowDataItem = grid.get_dataItems()[Index];
var cell = grid.getCellByColumnUniqueName(rowDataItem, "Photo");
cell.innerHTML = '<img src="../Images/3.png">';

Thanks,
Princy.
0
KK60
Top achievements
Rank 1
answered on 09 Jun 2014, 04:02 PM
Exactly what I needed, thank you!
Tags
Grid
Asked by
KK60
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
KK60
Top achievements
Rank 1
Share this question
or