Hi, I'm trying to insert records into my database from code behind in my itemcommand.
I have the form setup in the No Records Template in a nested RADGrid, but the GridNoRecordsItem does not have a Controls collection. What am I missing?
Here is some of the pertinent code:
protected void RadGrid2_ItemCommand1(object sender, GridCommandEventArgs e)
{
switch (e.CommandName)
{
case "InsertSubGoal":
string GoalID = string.Empty;
string SubGoal = string.Empty;
if (e.CommandArgument.ToString() == "Empty")
{
var insertedItem = (GridNoRecordsItem)e.Item;
GoalID = insertedItem.OwnerTableView.ParentItem.GetDataKeyValue("GoalID").ToString();
SubGoal = (insertedItem["SubGoal"].Controls[0] as TextBox).Text;
any help or sample code would be appreciated.
Thanks
Tom