0

我将如何在 gridmaskedcolumn 中输入可变长度。对于这种情况,网格是一个密码,必须至少有 4 个字符,但可以长于 4 个字符,并且这些字符只能是数字。也不能显示字符。

<telerik:GridMaskedColumn DataField="Pin" UniqueName="Pin" HeaderText="Pin" Visible="false" Mask="<0..9>" DisplayMask="******" >
            </telerik:GridMaskedColumn>    

我尝试在线阅读解决方案,但似乎没有关于可变加长输入的解决方案。

4

1 回答 1

0

From what I have been reading, GridMaskedColumn is not designed for variable-length input and therefore passwords are not ideal for GridMaskedColumns.

An alternative would be to use a normal GridBoundColumn and set the column mode to password.

if (e.Item is GridDataItem && e.Item.IsInEditMode)
{
    GridDataItem edititem = (GridDataItem)e.Item;
    TextBox txtpwd = (TextBox)edititem["Pin"].Controls[0];
    txtpwd.TextMode = TextBoxMode.Password;
    txtpwd.Visible = true;
}
于 2013-03-22T09:41:13.760 回答