Hi Haneef,
Thanks a lot for your pointer. I have modified my code like this:
Label customLabel = new Label();
customLabel.Anchor = AnchorStyles.Left | AnchorStyles.Top;
customLabel.Text = "777777888";
customLabel.Font = new Font("verdana", (float)8.0);
float width;
using (Graphics g = CreateGraphics())
{
width = g.MeasureString(customLabel.Text, customLabel.Font).Width;
}
customLabel.Location = new Point(gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[4].Bounds.X, 0);
gridRecordNavigationControl1.NavigationBar.Controls.Add(customLabel);
gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[4].Bounds = new Rectangle(gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[4].Bounds.X - 20, gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[4].Bounds.Y, (int)width, gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[4].Bounds.Height);
But now I lost ‘Last’ and ‘AddNew’ buttons on the navigation bar. If I reduce width of Buttons[4], I get ‘Last’ and ‘AddNew’ buttons back. Attached is the sample.
Our requirement is to display “Record” in NavigationBar.ButtonBarChild.Buttons[2], current record position in NavigationBar.ButtonBarChild.Buttons[3], and “ of n” (where “n” is ‘total number of records’) in NavigationBar.ButtonBarChild.Buttons[4]. Currently, when total number of records is in more than 2 digits, I can not see the last digits of this number in many of my grids.
Is it possible that we can increase size of Buttons[4] without loosing any buttons on the navigation bar? I guess we will have to increase size of the ButtonBarChild as well. Do you think that is the right solution? If yes, how can that be achieved?
Thanks in advance,
Ranu
GridRecordNavControlButtonSize2.zip