I've got the item_command event firing fine but I'm looking for a way to invoke Telerik's "Automatic" edit form on the server side, does anyone have any ideas?
As a side note, when I do setup a datasource, automatic operations are fine, I'm just looking for a way to invoke automatic operations without a data source.
I'll post in some aspx and code behind so you can see sort of what I'm trying to do:
<
telerik:RadGrid runat="server" ID="radViews" AutoGenerateDeleteColumn="True"
AutoGenerateEditColumn="True" GridLines="None" AllowAutomaticUpdates="true"
Skin="Office2007" OnItemCommand="radViews_ItemCommand" >
<
HeaderContextMenu EnableTheming="True">
<
CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</
HeaderContextMenu>
<
MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top">
<
RowIndicatorColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
RowIndicatorColumn>
<
ExpandCollapseColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID"
SortExpression="ID" UniqueName="ID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Text" HeaderText="Text"
SortExpression="Text" UniqueName="Text">
</telerik:GridBoundColumn>
</Columns>
</
MasterTableView>
<
FilterMenu EnableTheming="True">
<
CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</
FilterMenu>
</telerik:RadGrid>
protected
void radViews_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.InitInsertCommandName) //"Add new" button clicked
{
e.Canceled =
true;
//Prepare an IDictionary with the predefined values
System.Collections.Specialized.
ListDictionary newValues = new System.Collections.Specialized.ListDictionary();
newValues[
"Tag"] = user.UserName;
//Insert the item and rebind
e.Item.OwnerTableView.InsertItem(newValues);
}
// Pass to MVP
if (e.CommandName == RadGrid.DeleteCommandName)
{
this.OnDeleteView(this, e);
}
if (e.CommandName == RadGrid.EditCommandName)
{
"Go Go Gadget editable Grid!!!!"
}
}