This is a migrated thread and some comments may be shown as answers.

copy functionality with radgrid using radwindow

1 Answer 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arjun
Top achievements
Rank 1
Arjun asked on 27 Jul 2011, 07:02 AM
Hi,

I have the below itemcommand event of radgrid for copying a record based on ID.

if (e.CommandName == "Copy")
            {
                SHTemplateUI copyTemplate = new SHTemplateUI();
                copyTemplate.CopyTemplateByIdUI(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["StudentHistoryTemplateID"]));
                this.LoadTemplateList();
            }
This copies the record with the same name.

Now i want to make some changes.when i click on copy it should popup a radwindow and ask for the new file name.Once i enter the file name it should check whether the file name already exists.If not copy record with the new file name.

Can anybody help me please?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Jul 2011, 08:12 AM
Hello Arjun,

Try the following code snippet to open a RadWindow in ItemCommand event.
C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
  {
    if (e.CommandName == "Copy")
       {
          //opening window
          RadWindow newWindow = new RadWindow();
          newWindow.ID = "RadWindow1";
          newWindow.NavigateUrl = "RadWindow1.aspx";
          newWindow.VisibleOnPageLoad = true;
          RadWindowManager1.Windows.Add(newWindow);
          //check for the condition here
       }
  }

Thanks,
Princy.
Tags
General Discussions
Asked by
Arjun
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or