Why click? The DataGridView has a Sort method, which accepts a DataGridViewColumn to sort by:
private void MyButton_Click(object sender, EventArgs e)
{
if (int.TryParse(MyTextBox.Text, out int colNo))
{
myDataGridView.Sort(myDataGridView.Columns[colNo], ListSortDirection.Ascending);
}
}
private void MyOtherButton_Click(object sender, EventArgs e)
{
if (int.TryParse(MyTextBox.Text, out int colNo))
{
myDataGridView.Sort(myDataGridView.Columns[colNo], ListSortDirection.Descending);
}
}