Posts

Showing posts from January, 2013

How to call a silverlight xap file from server object model in sharepoint

Image
How to call a silverlight xap file from server object model in sharepoint We can call the silverlight xap file from server object model using sand box solution in sharepoint Step-1     Open visuvalstudio->new->click sharepoint(left side)->empty Sharepoint Poject->(give project name)->Deploy as a sand box solution-finish Step-2         In solution explorer->(Right click your project)->Add->New itme->Visual Web Part(Sandboxed)->(give name,eg-SandBoxExample)->(click add) Step-3     Add the follwing code on your sand box webpart design page(SandBoxExample.ascx) < object id =" speedsilverlight "              data =" data:application/x-silverlight-2, " style =" z-index:0" type="application/x-silverlight-2 " width =" 320 " height =" 270 ">            < param name =" source " value =" http://sample.com/samplexap/sample.xap" />            <

How To Insert FieldUser Value in Sharepoint using silverlight(Client object model)

How To Insert FieldUser Value in Sharepoint using silverlight use following code to insert fielduser value in sharepoint C# code: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.SharePoint.Client; using Microsoft.SharePoint; namespace users { public partial class MainPage : UserControl { string user; GroupCollection G roupcoll; ClientContext site; List listobj; User userna me               //This one is for the field user name     public  MainPage() { InitializeComponent(); site = new ClientContext(ApplicationContext.Current.Url); site.Load(site.Web); listobj = cc.Web.Lists.GetByTitle("your list name"); cc.Load(listobj);   G roupcoll = site.Web.SiteGr

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.