Showing posts from November, 2012

Silverkight 5 datagrid image size

Normally our image can be different size when we upload the. if we want to fixed that all image size will be fixed in Silver light 5 Data this

XAML Binding for image:

<sdk:DataGridTemplateColumn Header="Color image" Width="6*" IsReadOnly="True" > <sdk:DataGridTemplateColumn.CellTemplate > <DataTemplate> <Image Source="{Binding Path=ColorImageFile}" Stretch="Fill" Width="100" Height="60" Visibility="Visible"/> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn>
on datagrid onloading event. set the image column with your class image attribute. here it is ColorImageFile

private void DgReceiveBuyerComment_OnLoadingRow(object sender, DataGridRowEventArgs e) { try { BO.LAB_LDCommentReceipt…

Silverlight multiline textbox

For multiline text box you have to use just 2 property for text box AcceptsReturn="True" TextWrapping="Wrap". consider the datagrid.

the xaml code for the

<sdk:DataGridTemplateColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False" Width="Auto" Header="Remarks" > <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox AcceptsReturn="True" TextWrapping="Wrap"></TextBox> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn>
thank you.

Silverlight application Life cycle

Quick review how a silverlight application work in browser
1. The user requests the HTML entry page in the browser.
2. The browser loads the Silverlight plug-in. It then downloads the XAP file that contains your application.
3. The Silverlight plug-in reads the AppManifest.xml file from the XAP to find out what assemblies your application uses. It creates the Silverlight runtime environment and then loads your application assembly (along with any dependent assemblies).
4. The Silverlight plug-in creates an instance of your custom application class (which is defined in the App.xaml and App.xaml.cs files).
5. The default constructor of the application class raises the Startup event.
6. Your application handles the Startup event and creates the root visual object for your application.

Silverlight 5 Datagrid xaml binding

Let see how to look our datagrid

it is very simple, as a data source  i just use a _listObj of my class. and bind the grid column with my class attribute.

<sdk:DataGrid SelectedItem="{Binding Path=SelectedStudent,Mode=TwoWay}" ItemsSource="{Binding Path= StudentList,Source={StaticResource OutSouceItemList}, Mode=TwoWay}" CanUserResizeColumns="False" AutoGenerateColumns="False" ColumnWidth="*" Name="dgStudentList" VerticalScrollBarVisibility="Visible" MaxHeight="Infinity" > <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Visibility="Collapsed" Binding="{Binding StudentId}" CanUserReorder="False" CanUserResize="False" CanUserSort="False" Width="*" /> <sdk:DataGridTextColumn Header="First name" Binding="{Binding FirstName}" CanUserReorder="True" CanUserResi…

Silverlight 5 Development environment

Install the software step by step.

1. Install VS-2010

2. Install SQL Server 2008 R2 or other

3. Install VS Service Pack 1


4. Install Silverlight Toolkit

5. install Prism4.1_Source

6. Install Blend_UltimateTrial_en(silverlight-5)

Now your PC is ready for Silverlight 5 development Environment.