Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Posted in Uncategorized | 1 Comment

Talking about Top 10 steps to optimize data access in SQL Server. Part IV (Diagnose database performance problems)

Posted in Computers and Internet | Leave a comment

WCF: Data Service vs RIA Service

WCF, Data Services and RIA Services Alignment Questions and Answers

Windows Communication Foundation (WCF) is the heart of the Microsoft Developer story around services. WCF is the unified programming model for working with services in the enterprise and across the Internet in .NET applications.

As highlighted in sessions at this year’s PDC, .NET Framework 4 makes it easier for developers to work with services from their managed code applications. With .NET 4, the WCF technology provides several different types of services to start from, based on your particular needs, but they all share the same underlying infrastructure

Posted in Computers and Internet | Leave a comment

How to set checkbox column read only in Silverlight data grid

In most of the LOB application, data grid is used to view the data. For now, we will consider sample entity {Person: Name, Age and IsSingle}.  Below is the XAML code to bind the data in the data grid view only mode.

<data:DataGrid x:Name="dataGridView" >

                    <data:DataGrid.Columns>

                        <data:DataGridCheckBoxColumn Header="Single"  Binding="{Binding IsSingle, Mode=OneWay}" IsReadOnly="True" />

                        <data:DataGridTextColumn Header="Name"  Binding="{Binding Name, Mode=OneWay}" IsReadOnly="True" />

                        <data:DataGridTextColumn Header="Age"  Binding="{Binding Age, Mode=OneWay}" IsReadOnly="True"  />

                </data:DataGrid>

 

Guess what; will the checkbox column read only? Yes, if you use mouse but using the keyboard, the checkbox state can be toggled though IsReadOnly is set to true. You are right; the cell is read only but not the checkbox. How? Press tab to navigate the control. As soon as the focus set on first row, press tab. Now notice the checkbox will have the focus; press the space bar to check/uncheck the state.

You have to disable the checkbox to set the control read only by using the template column. Below is the XAML code to disable the checkbox column in the data grid.

<data:DataGrid x:Name="dataGridView" >

                    <data:DataGrid.Columns>

                        <data:DataGridTemplateColumn Header="Single" IsReadOnly="True">

                            <data:DataGridTemplateColumn.CellTemplate>

                                <DataTemplate>

                                    <Grid >

                                        <CheckBox IsEnabled="False" IsChecked="{Binding IsSingle, Mode=OneWay}"/>

                                    </Grid>

                                </DataTemplate>

                            </data:DataGridTemplateColumn.CellTemplate>

                        </data:DataGridTemplateColumn>

                        <data:DataGridTextColumn Header="Name"  Binding="{Binding Name, Mode=OneWay}" IsReadOnly="True" />

                        <data:DataGridTextColumn Header="Age"  Binding="{Binding Age, Mode=OneWay}" IsReadOnly="True"  />

                  </data:DataGrid.Columns>

</data:DataGrid>

 

Use the checkbox control inside the cell template so utilize the checkbox properties. Setting IsEnabled=”false” will disable the checkbox hence the control will not get the focus.

Hope you learnt the technique to make the checkbox column read only.

Posted in Computers and Internet | Leave a comment

VS 2008: Multilpe menu entries in data for DB Pro

When you see the duplicate menu entries for data menu, try the steps documented in the below link
Posted in Computers and Internet | Leave a comment

TFS 2008: Team Build doesn’t get subfolders of team build type folder by default

Posted in Uncategorized | Leave a comment

Media Center and your set-top box

Posted in Uncategorized | Leave a comment