silverlight datagrid popup window:

silverlight datagrid popup window:

     In this way you no need to create a template or anything.Based on your clicked cell,you can open child window or a popup window.

Step 1:

   
         Create  CurrentCellChanged  event for your datagrid.With in the event use the following code to show your popup or child window

C# Code(Column wise):

 Here we popup based on clicked cell column index value.

  private void datagridName_CurrentCellChanged(object sender, EventArgs e)
        {       
            //  (0 ForstRow,1 SecondRow,3 ThirdRow...)
            if (datagridName.CurrentColumn.DisplayIndex == 0)
            {
                //To get selected cell value
                string selected = ((TextBlock)datagridName.CurrentColumn.GetCellContent(datagridName.SelectedItem)).Text;
                //do..(Your code for open popup or child window)
            }
        
        }

C# Code(Row wise):

 Here we popup based on clicked cell Row index value.
 
  private void datagridName_CurrentCellChanged(object sender, EventArgs e)
        {          
            //(0 ForstRow,1 SecondRow,3 ThirdRow...)
            if (datagridName.SelectedIndex==0)
            {
                //To get selected cell value
                string selected = ((TextBlock)datagridName.CurrentColumn.GetCellContent(datagridName.SelectedItem)).Text;
                //do..(Your code for open popup or child window)
            }
        }



Comments

Popular posts from this blog

Upload Single/Multiple file by using the REST API and jQuery SharePoint 2013

Add content type to SharePoint List/Library using REST API

A type named 'SP.Data. could not be resolved by the model error