diff --git a/TelegramBotBase/Controls/ButtonGrid.cs b/TelegramBotBase/Controls/ButtonGrid.cs index ed71393..a8aad43 100644 --- a/TelegramBotBase/Controls/ButtonGrid.cs +++ b/TelegramBotBase/Controls/ButtonGrid.cs @@ -496,6 +496,9 @@ namespace TelegramBotBase.Controls bf = bf.FilterDuplicate(this.SearchQuery); } + if (bf.Rows == 0) + return 1; + return (int)Math.Ceiling((decimal)(bf.Rows / (decimal)(MaximumRow - 3))); } }