Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds row number display for queue and subscription messages #717

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions src/ServiceBusExplorer/Controls/HandleQueueControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2748,6 +2748,29 @@ private void dataGridView_RowsRemoved(object sender, DataGridViewRowsRemovedEven
CalculateLastColumnWidth(sender);
}

private void dataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
var grid = sender as DataGridView;
var rowIdx = (e.RowIndex + 1).ToString();

var centerFormat = new StringFormat()
{
Alignment = StringAlignment.Far,

LineAlignment = StringAlignment.Center
};

Size textSize = TextRenderer.MeasureText(rowIdx, this.Font);

if (grid.RowHeadersWidth < textSize.Width + 20)
{
grid.RowHeadersWidth = textSize.Width + 20;
}

var headerBounds = new Rectangle(e.RowBounds.Left, e.RowBounds.Top, grid.RowHeadersWidth - 4, e.RowBounds.Height);
e.Graphics.DrawString(rowIdx, this.Font, SystemBrushes.ControlText, headerBounds, centerFormat);
}

private void dataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
//var textBox = (TextBox)e.Control;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions src/ServiceBusExplorer/Controls/HandleSubscriptionControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,29 @@ private void dataGridView_RowsRemoved(object sender, DataGridViewRowsRemovedEven
CalculateLastColumnWidth(sender);
}

private void dataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
var grid = sender as DataGridView;
var rowIdx = (e.RowIndex + 1).ToString();

var centerFormat = new StringFormat()
{
Alignment = StringAlignment.Far,

LineAlignment = StringAlignment.Center
};

Size textSize = TextRenderer.MeasureText(rowIdx, this.Font);

if (grid.RowHeadersWidth < textSize.Width + 20)
{
grid.RowHeadersWidth = textSize.Width + 20;
}

var headerBounds = new Rectangle(e.RowBounds.Left, e.RowBounds.Top, grid.RowHeadersWidth - 4, e.RowBounds.Height);
e.Graphics.DrawString(rowIdx, this.Font, SystemBrushes.ControlText, headerBounds, centerFormat);
}

private void dataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
//var textBox = (TextBox)e.Control;
Expand Down