Hi,
You can use a StaticColumn for that case. Follow these steps:
1. Make sure you have a unique key field in your data source. This field, instead of item index will be used to identify which row has been clicked;
2. Set the StaticColumn's DataField to the name of your key field. For example, if the name of the key field is "rec_id", then you can set DataField to "rec_id";
3. Set the StaticColumn's DataFormat to something like this:
Code: HTML/ASPX
<a href="raisesGridEvent('cmd1', {0})">Command 1</a>
<a href="raisesGridEvent('cmd2', {0})">Command 1</a>
The above code will display two HTML links inside the Grid cell. The Grid will replace {0} with your data field value. So for example, for a row with "rec_id" as 10, the Grid will display two links in the cell and call:
Code: JavaScript
raisesGridEvent('cmd1', 10);
When the first link is clicked, And
Code: JavaScript
raisesGridEvent('cmd2', 10);
when the second link is clicked.
4. You will need to implement raisesGridEvent to perform whatever action you need based the arguments passed in. Note this part no longer has anything to do with the Grid. For example, you can implement the function like this:
Code: JavaScript
function raisesGridEvent(cmd, rec_id)
{
alert("performing " + cmd + " on record " + rec_id);
}
If you need it to raise a server event, you can place a ScriptEvent control in the form and then call global function eo_TriggerServerEvent to trigger the ScriptEvent's server side Command event and then handle that event (make sure you pass your "cmd" and "rec_id" in). Note this event is not related to Grid's ItemCommand event in any way. You can find more information on how to use eo_TriggerServerEvent here:
http://doc.essentialobjects.com/library/1/eo.web.scriptevent.aspxHope this helps. Please feel free to let us know if you have any more questions.
Thanks!