2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
ZoomingYou can implement the zoom functionality in the GridControl by increasing or decreasing the font size, column widths and row heights proportionally. The following code example illustrates the Zoom down functionality in GridControl on button click. C# private void button2_Click(object sender, System.EventArgs e) { //down this.gridControl1.BeginUpdate(); this.gridControl1.BaseStylesMap["Standard"].StyleInfo.Font.Size *= down; this.gridControl1.DefaultColWidth = (int) (down * this.gridControl1.DefaultColWidth); this.gridControl1.ColWidths[0] = (int) (down * this.gridControl1.ColWidths[0]); this.gridControl1.DefaultRowHeight = (int) (down * this.gridControl1.DefaultRowHeight); this.gridControl1.RowHeights[0] = (int) (down * this.gridControl1.RowHeights[0]); this.gridControl1.EndUpdate(); this.gridControl1.Refresh(); } VB Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button2.Click 'down Me.gridControl1.BeginUpdate() Me.gridControl1.BaseStylesMap("Standard").StyleInfo.Font.Size *= down Me.gridControl1.DefaultColWidth = CInt(Fix(down * Me.gridControl1.DefaultColWidth)) Me.gridControl1.ColWidths(0) = CInt(Fix(down * Me.gridControl1.ColWidths(0))) Me.gridControl1.DefaultRowHeight = CInt(Fix(down * Me.gridControl1.DefaultRowHeight)) Me.gridControl1.RowHeights(0) = CInt(Fix(down * Me.gridControl1.RowHeights(0))) Me.gridControl1.EndUpdate() Me.gridControl1.Refresh() End Sub The following code example illustrates the Zoom up functionality in GridControl on button click. C# private void button1_Click(object sender, System.EventArgs e) { //up this.gridControl1.BeginUpdate(); this.gridControl1.BaseStylesMap["Standard"].StyleInfo.Font.Size *= up; this.gridControl1.DefaultColWidth = (int) (up * this.gridControl1.DefaultColWidth); this.gridControl1.ColWidths[0] = (int) (up * this.gridControl1.ColWidths[0]); this.gridControl1.DefaultRowHeight = (int) (up * this.gridControl1.DefaultRowHeight); this.gridControl1.RowHeights[0] = (int) (up * this.gridControl1.RowHeights[0]); this.gridControl1.EndUpdate(); this.gridControl1.Refresh(); } VB Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click 'up Me.gridControl1.BeginUpdate() Me.gridControl1.BaseStylesMap("Standard").StyleInfo.Font.Size *= up Me.gridControl1.DefaultColWidth = CInt(Fix(up * Me.gridControl1.DefaultColWidth)) Me.gridControl1.ColWidths(0) = CInt(Fix(up * Me.gridControl1.ColWidths(0))) Me.gridControl1.DefaultRowHeight = CInt(Fix(up * Me.gridControl1.DefaultRowHeight)) Me.gridControl1.RowHeights(0) = CInt(Fix(up * Me.gridControl1.RowHeights(0))) Me.gridControl1.EndUpdate() Me.gridControl1.Refresh() End Sub The following screenshots illustrate the Zoom up and Zoom down functionality of GridControl. Figure 1: Zoom up function of GridControl Figure 2: Zoom down function of GridControl Sample: Reference link: https://help.syncfusion.com/windowsforms/grid-control/zooming |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.