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

problem with radgrid..

2 Answers 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
md
Top achievements
Rank 1
md asked on 27 Jul 2011, 09:11 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 please? 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Jul 2011, 10:01 AM
Hello md,

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

Thanks,
Shinu.
0
Arjun
Top achievements
Rank 1
answered on 27 Jul 2011, 02:22 PM
but i dont need to navigate to any other page.Its just that when i enter the filename, in the radwindow and click on ok data has to get copied to new file.
Tags
Grid
Asked by
md
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Arjun
Top achievements
Rank 1
Share this question
or