Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
16664 | Jul 21,2004 03:16 PM UTC | Dec 21,2004 08:38 AM UTC | WinForms | 10 |
![]() |
Tags: GridControl |
//set up the label
private Label myLabel;
private void Form1_Load(object sender, System.EventArgs e)
{
myLabel = new Label();
Rectangle rect = this.gridRecordNavigationControl1.NavigationBar.ClientRectangle;
int width = this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Bounds.Width;
myLabel.Bounds = new Rectangle(rect.Left, rect.Top, width, rect.Height);
myLabel.TextAlign = ContentAlignment.MiddleCenter;
this.gridRecordNavigationControl1.NavigationBar.Controls.Add(myLabel);
//..... continue on with the existing code...
}
//handler
private void grid_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
{
GridControl grid = sender as GridControl;
if(grid.CurrentCell.MoveToRowIndex != grid.CurrentCell.MoveFromRowIndex
if(this.myLabel != null )
{
this.myLabel.Text = string.Format("{0} of {1}", grid.CurrentCell.MoveToRowIndex, grid.Model.RowCount);
}
}
}
myLabel = new Label();
Rectangle rect = this.gridRecordNavigationControl1.NavigationBar.ClientRectangle;
Syncfusion.Windows.Forms.InternalButton but = this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[2];
int width = this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Bounds.Width;
myLabel.Bounds = new Rectangle(rect.Left + but.Bounds.Left, rect.Top, but.Bounds.Left + but.Bounds.Width, rect.Height);
myLabel.TextAlign = ContentAlignment.MiddleCenter;
this.gridRecordNavigationControl1.NavigationBar.Controls.Add(myLabel);
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.