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

"add new record" popup in lightbox type screen

1 Answer 206 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pride
Top achievements
Rank 1
Pride asked on 27 Nov 2012, 10:02 PM
Has anyone found the best way, when using a radgrid, to have the "add new record" page popup in a lightbox type screen overlay?  Perhaps the asp popupmodal?

I found a tutorial that is dead on, but way outdated here: here


Ok, so after working all day on getting the window popup to work when the user clicks the edit/double click/add new record, I ran into another problem.  I can't seem to get the ID from the dataitem of the e argument.

So here's the code (from the tutorial above.  The tutorial works, but not my project)

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
 
         
            HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
            editLink.Attributes["href"] = "#";
            editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["jobID"], e.Item.ItemIndex);
        }
    }

When I use the path  e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["jobID"] there is nothing there.  I can see that the jobID is 
at the path  e.Item.DataItem, all the columns are listed there, but I can't access them.  e.Item.DataItem.jobID doesn't work like I think it should.  The only thing is I am using a sql database, and the tutorial is using access.  That must be the difference.  I changed the access database in their tutorial, and it doesn't work.


1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 30 Nov 2012, 01:29 PM
Hello Pride,

Thank you for contacting us.

In case you want to use an external edit form, please check out the following demos and choose which implementation best matches your requirements:
 Grid / PopUp Edit Form
 Grid / Editing with External Form 
 Window / Use as controls container
 Window / Edit Dialog for RadGrid
 Grid / Insert with Tooltip

I hope this will prove helpful. Please let us know if you need further assistance.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Pride
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or