Adding paging/search example

This commit is contained in:
FlorianDahn
2020-08-09 17:22:19 +02:00
parent ad6cf9539c
commit 183e89c36f
6 changed files with 97 additions and 2 deletions
+9 -1
View File
@@ -188,6 +188,7 @@ namespace TelegramBotBase.Controls
if (this.SearchQuery != null && this.SearchQuery != "")
{
this.CurrentPageIndex = 0;
this.Updated();
}
@@ -480,7 +481,14 @@ namespace TelegramBotBase.Controls
if (this.ButtonsForm.Count == 0)
return 1;
return (int)Math.Ceiling((decimal)(this.ButtonsForm.Rows / (decimal)(MaximumRow - 3)));
var bf = this.ButtonsForm;
if (this.EnableSearch && this.SearchQuery != null && this.SearchQuery != "")
{
bf = bf.FilterDuplicate(this.SearchQuery);
}
return (int)Math.Ceiling((decimal)(bf.Rows / (decimal)(MaximumRow - 3)));
}
}