I am creating an SPGridView dynamically and adding to my page. It is encased in a web part. How do I access the ClientID of the grid from the javascript on the page?
function openCommentsDialog( id) {
try {
**fails-->**var grid = document.getElementById("_grid");
//variable to contain the cell of the grid
var cell;
var options = SP.UI.$create_DialogOptions();
options.url = "SRPChange.aspx" + "?Type=" + type + "&ItemID=" + id;
options.height = 600;
options.width = 800;
options.allowMaximize = false;
options.Title = "SRP Change Dialog";
options.args = { Type: type, ItemID: id };
SP.UI.ModalDialog.showModalDialog(options);
}
catch (Err) {
}
}