Dotnetdreamer's Weblog

SharePoint, Silverlight and Azure

  • Top Posts

  • Categories

  • Recent Posts

  • Archives

  • RSS My Tweets

    • An error has occurred; the feed is probably down. Try again later.
  • February 2018
    M T W T F S S
    « Feb    
  • Advertisements

Posts Tagged ‘DataGrid’

Silverlight 2 DataGrid – Frozen Columns

Posted by Ramprasad Navaneethakrishnan on January 31, 2009

Not long ago, we had a requirement in our project where a datagrid should hold 14 columns, out of which the first column should be static and the remaining should be scrollable.

ASP.NET datagrid does not support such requirements or for that matter no control in ASPNET toolbox. So ultimately we had to deal with multiple tables and messy javascripts to satisfy that requirement. Now that piece of code is difficult to manage and not friendly for change.

Now, Silverlight 2 DataGrid is released which comes with new in-built features like Auto-Sizing, Multiple-Column Sorting, Frozen Columns etc..

Frozen Column:

Forzen Column makes the column to freeze(remain static while other columns are scrolling). When you have 14, 15 columns in a datagrid, you might want the first column or the first two column to remain static while scrolling thorough the other columns.


The FrozenColumnCount property of the Silverlight 2 DataGrid takes the number of columns the user want to freeze starting from the left most column.


This is my Silverlight 2 DataGrid..

<my: DataGrid
</my: DataGrid>

It has 10 columns and by default all the columns are scrollable..

Silverlight 2 DataGrid

Silverlight 2 DataGrid

When FrozenColumnCount is set to 1, the first column will remain static and the scroll bar appears only for the remaining 9 columns.

<my: DataGrid
</my: DataGrid>

this is how the DataGrid looks

Silverlight 2 DataGrid with Frozen Column

Silverlight 2 DataGrid with Frozen Column

In case, if we want to make the first two columns to remain static, then the FrozenColumnCount should be set to 2.

<my: DataGrid
</my: DataGrid>

Silverlight 2 DataGrid with Frozen Columns

Silverlight 2 DataGrid with Frozen Columns


Posted in Silverlight | Tagged: , , , , , , , , , | 1 Comment »