edit form data in visual webpart

Hi All,

I  have one visual webpart in that webpart i needs to enter some controls values and i clicked on the submit button the data is binded in the gridview.Now in the grid view i have one edit button for all rows when i click on the edit button on particular grid view row  it navigates to the visual webpart page and the corresponding  row data needs to be in read only mode.How to implement this functionality.Please help.Thanks in advance.

Regards,

Praveen

July 29th, 2015 2:46am

Hi Praveen,

Add a Image Link Button or Template Control to bind the Link in your gridview.

The piece of code will construct the Display form to that Item.

string GetDisplayFormUrl(SPListItem ListItem)
        {
            return (ListItem.Web.Url + "/" + ListItem.ParentList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url + "?ID=" + ListItem.ID);
        }

Free Windows Admin Tool Kit Click here and download it now
July 30th, 2015 12:29am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics