I am trying to update a grid that is bound. When I hit the javascript code that does the close and rebind the args are undefined (see code snippet 1. As I step through the server side code all looks good. I tried using both ScriptManager and ClientScript. Any thoughts??? thanks...
code snippet 1....
function CloseAndRebind(args) {
alert('args ' + args);
GetRadWindow().BrowserWindow.refreshGrid(args);
GetRadWindow().close();
}
code snippet 2...
protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
{
if (e.CommandName == "Update")
{
//ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true);
ScriptManager.RegisterStartupScript(this,Page.GetType(), "mykey", "CloseAndRebind();", true);
}
}
protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
//logic to truncate long string to prevent SQL error
for (int i = 1; i < 6; i++)
{
string val = e.NewValues[i - 1].ToString();
int maxLength = i * 10;
if (val.Length > maxLength) e.NewValues[i - 1] = val.Substring(0, maxLength);
}
}