If I have a template which uses databinding:-
<NodeTemplate>
<%# DataBinder.Eval(Container.DataItem, "Column1") %>
</NodeTemplate>
can I also use ExpandMode="WebService"? If so, how?
Thanks,
Martin


I'm trying to convert my ASP.Net windows to AJAX windows, and running into an AJAX problem. The base page (the one that opens the Window) has a Grid that I want to refresh when the window is closed. Previously, it was using the refreshGrid(arg) that seems to be popular, but I'm trying to convert it to an AJAX call using the OnClientClose event.
My Javascript function looks like this:
function OnClientClose(sender, eventArgs)
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
And the server-side event looks like:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument == "Rebind")
{
RadGrid2.Rebind();
}
}
I can see the server-side event firing in debug mode, but the grid never updates and I get a Javascript error "Object doesn't support this property or method". What am I doing wrong?
Bill
I am trying to create fuctionality which will allow the user to see the preview/ReadOnly mode by clicking on a row in the Grid. The user will be able to expand/collapse the row to show/hide the preview mode. In the javascript function
I am using the fireCommand() function passing in the "Preview" commandName and the selected Index:
function RowSelected(sender, eventArgs)
{
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
masterTable.fireCommand("Preview",eventArgs.get_itemIndexHierarchical());
}
Although this will raise the correct event, the itemIndex is getting lost. The result is that only the first row expands to display the Preview mode no matter which row is clicked. Instead, I need the selected row to display it's preview mode.
I am using webcontrols for edit and insert (EditFormType="WebUserControl"). In the server side code I am checking for the "preview" command.
protected void RadGrid1_ItemCommand1(object source, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.InitInsertCommandName)
{
e.Canceled = true;
RadGrid1.EditIndexes.Clear();
e.Item.OwnerTableView.EditFormSettings.UserControlName = "InsertContactForm.ascx";
e.Item.OwnerTableView.InsertItem();
}
else if (e.CommandName == RadGrid.EditCommandName)
{
e.Item.OwnerTableView.IsItemInserted = false;
e.Item.OwnerTableView.EditFormSettings.UserControlName = "EditContactForm.ascx";
}
else if (e.CommandName == "Preview")
{
e.Item.Edit = true;
e.Item.OwnerTableView.Rebind();
GridDataItem editItem = e.Item.OwnerTableView.Items[e.Item.ItemIndex];
e.Item.OwnerTableView.EditFormSettings.UserControlName = "EditContactForm.ascx";
string sUcID = GridEditFormItem.EditFormUserControlID;
UserControl MyUserControl = (UserControl)editItem.EditFormItem.FindControl(sUcID);
ASP.contacts_editcontactform_ascx eForm = (ASP.contacts_editcontactform_ascx)MyUserControl;
eForm.SetPreviewMode();
}
}
Any ideas of how I can get the correct row to expand?
Also, Since I will need to cancel out of the preview mode once the user clicks the same row again, can you tell me how to check (on the client side) if the selected row is in "Preview" mode?
Thanks!