Tuesday, December 20, 2011

Creating SharePoint UI Modal Popup window using JavaScript. Here I have an gridview with data I am extracting the cell value from it and send this into URL as querystring.
 function OpenDialog(URL) {
        
         var NewPopUp = SP.UI.$create_DialogOptions();
         NewPopUp.url = URL;
         NewPopUp.width = 700;
         NewPopUp.height = 350;
         SP.UI.ModalDialog.showModalDialog(NewPopUp);
     }
GridView:

            
            
            
            
            
            
            
            
             
                 
                 
                 
              
                 
                 ');">Show Page

                 
                                        
                                        
                                        
            


        
On RowCommand method of GridView extracting the first and second value
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            
                int index = Convert.ToInt32(e.CommandArgument.ToString());
                GridViewRow selectedRow = GridView1.Rows[index];
                TableCell  docType = selectedRow.Cells[1];
                TableCell documentName = selectedRow.Cells[2];
                ListItem item = new ListItem();
                item.Text = Server.HtmlDecode(selectedRow.Cells[2].Text);
                
            
            
        }