Skip to content

Commit ac67e75

Browse files
YezhicongNaBian
authored andcommitted
fix:分页按钮GroupName固定为1,同一界面存在两个分页按钮时,会导致按钮状态不对;
1 parent 55d7d98 commit ac67e75

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public class Pagination : Control
4848

4949
private bool _appliedTemplate;
5050

51+
private readonly string groupName = Guid.NewGuid().ToString("N");
52+
5153
#endregion Data
5254

5355
#region Public Events
@@ -284,6 +286,9 @@ public override void OnApplyTemplate()
284286
_buttonLast = GetTemplateChild(ElementButtonLast) as RadioButton;
285287
_jumpNumericUpDown = GetTemplateChild(ElementJump) as NumericUpDown;
286288

289+
_buttonFirst.GroupName = groupName;
290+
_buttonLast.GroupName = groupName;
291+
287292
CheckNull();
288293

289294
_appliedTemplate = true;
@@ -395,7 +400,8 @@ private RadioButton CreateButton(int page)
395400
return new()
396401
{
397402
Style = PaginationButtonStyle,
398-
Content = page.ToString()
403+
Content = page.ToString(),
404+
GroupName = groupName
399405
};
400406
}
401407

0 commit comments

Comments
 (0)