Hi @Jay O'Brien , Welcome to Microsoft Q&A.
I used combobox instead of textbox to get the selected month.
After clicking the button, perform a LinQ query on the Source to filter the data.
Can this help you?
private void button1_Click(object sender, EventArgs e)
{
if (int.TryParse(comboBox1.SelectedItem.ToString(), out int selectedMonth))
{
var filteredData = dataSource.Where(item => item.DateOn.Month == selectedMonth).ToList();
dataGridView1.DataSource = filteredData.ToList();
}
}
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.