We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to pin/freeze a specific row?

I need to freeze the first row of my grid while I scroll, is it possible? Ie, I want my first row always visible even if my scroll is in the end.

6 Replies

VK Vinish Kumar K Syncfusion Team February 6, 2013 06:54 PM UTC

Hi Cristiano,

 

Thank you for your interest in Syncfusion products.

 

Query

Make first row always visible

We have analyzed your query ‘ pin the first row always visible’. We have an property to make the row always visible. You can handle his behavior using the FrozenCount property. Please refer the following codes.

 

 

this.gridControl1.RowHeights.SetRange(1,0,0);

this.gridControl1.ColWidths.SetRange(1,0,0);

 

//Freeze the rows and columns with respect to current cell

this.gridControl1.Model.Rows.FrozenCount = row;

this.gridControl1.Model.Cols.FrozenCount = col;

this.gridControl1.Focus();

 

We have an sample in our dashboard. We hope this sample will helps you to get  an better experience about this query. Please refer the sample from following path

 

<install location>\Syncfusion\EssentialStudio\<Version>\Windows\Grid.Windows\Samples\2.0\MS Excel-Style Features\Freeze Pane Demo\

 

 

Please let me know if you have further concerns.

 

Regards,

Vinish.



AD Administrator Syncfusion Team February 7, 2013 05:27 PM UTC

Hello, I'm using grid grouping control, not grid control.


VK Vinish Kumar K Syncfusion Team February 8, 2013 10:59 AM UTC

Hi Cristiano,

 

Thanks for your update.

 

You can Froze the top rows in gridGrpoupingControl using the FrozenCount. Please refer the following codes which is used to freeze the top row.

 

int toprow = this.gridGroupingControl1.Table.Records[0].GetRowIndex() ;

            this.gridGroupingControl1.TableModel.Rows.FrozenCount = toprow;

 

Please refer our dashboard sample for your reference <installed_Folder>\Syncfusion\EssentialStudio\<Version>\Windows\Grid.Grouping.Windows\Samples\2.0\Layout Customization\Frozen Column Demo\

 

Please let me know if you have further concerns.

 

Regards,

Vinish.



VK Vinish Kumar K Syncfusion Team February 8, 2013 10:59 AM UTC

Hi Cristiano,

 

Thanks for your update.

 

You can Froze the top rows in gridGrpoupingControl using the FrozenCount. Please refer the following codes which is used to freeze the top row.

 

int toprow = this.gridGroupingControl1.Table.Records[0].GetRowIndex() ;

            this.gridGroupingControl1.TableModel.Rows.FrozenCount = toprow;

 

Please refer our dashboard sample for your reference <installed_Folder>\Syncfusion\EssentialStudio\<Version>\Windows\Grid.Grouping.Windows\Samples\2.0\Layout Customization\Frozen Column Demo\

 

Please let me know if you have further concerns.

 

Regards,

Vinish.



AD Administrator Syncfusion Team March 8, 2013 06:18 PM UTC

I don't see any difference using this frozen count. What is it supposed to do?

I need to a specific row at top or bottom to be pinned.
grid = new GridGroupingControl();
grid.Location = new Point(3, 3);
grid.Size = new Size(800, 600);
this.Controls.Add(grid);
 
 
grid.DataSource = AddData2();
 
// this does nothing? all rows still scroll
this.grid.TableModel.Rows.FrozenCount = 5; 


VK Vinish Kumar K Syncfusion Team March 13, 2013 10:15 AM UTC

Hi Cristiano Venancio Conte,

 

Thanks for your update.

 

We have analyzed your query with the different scenarios to freeze the row  in Grid Grouping Control. Currently we don’t have any direct support to freeze the rows in GGC. but you can implement the tree grid in Grid control and you can freeze the rows instead of GGC.  Please refer the below code.

 

this.gridControl1.Cols.FreezeRange(1, 8);

            int frozencolumn = this.gridControl1.Cols.FrozenCount;

            this.gridControl1.Rows.FrozenCount = 0;

            this.gridControl1.Rows.FrozenCount = 1;

            this.gridControl1.Cols.FrozenCount = frozencolumn;

            this.gridControl1.Refresh();

 

 

Here is the new sample for this implementation (attached).

 

Please let me know if you have any concerns.

 

Regards,

Vinish



simpleSample619000711_3ce1a425.zip

Loader.
Live Chat Icon For mobile
Up arrow icon