ButtonEdit
버튼 Edit에 Masking!
if (_edittype == ButtonEditEx_EditType.Tel)
{
Properties.Mask.EditMask = @"[0-9]{2,3}-[0-9]{3,4}-[0-9]{4}";
Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.RegEx;
Properties.Mask.UseMaskAsDisplayFormat = true;
}
else if (_edittype == ButtonEditEx_EditType.Email)
{
Properties.Mask.EditMask = @"[a-zA-Z0-9.-]+@[a-zA-Z0-9-]+(\.[A-Za-z]{2,6}){1,2}";
Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.RegEx;
Properties.Mask.UseMaskAsDisplayFormat = true;
}
else if (_edittype == ButtonEditEx_EditType.Money)
{
Properties.Mask.EditMask = GetMoneyMasking();
Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
Properties.Mask.UseMaskAsDisplayFormat = true;
}
private string GetMoneyMasking()
{
string editmask = "N0";
if (Properties.MaxLength > 0)
{
string masking = "";
for (int loop = 0; loop < Properties.MaxLength; loop++)
{
masking = "#" + masking;
if (loop % 3 == 2)
{
masking = "," + masking;
}
}
editmask = masking;
}
return editmask;
}
Number의 자리수 제한은 maxlength 로 제한 할때 #,###,###으로 표기하기 위해...
'# 4) .Net ( Vs 2010 ) > DevExpress' 카테고리의 다른 글
Grid (0) | 2015.01.25 |
---|---|
TreeList (0) | 2015.01.25 |