我有一个RadDataGridView(Telerik),其中有一列必须隐藏一半的文本。数字123456789显示为***** 6789。你怎么做到的?
private void gvMyGrid_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo.Name == "colNumber")
{
if (e.CellElement.RowInfo.Cells["colNumber"].Value != null)
{
string number = e.CellElement.RowInfo.Cells["colNumber"].Value.ToString();
number = new string('*', number.Length - 4) + number.Substring(number.Length - 4);
e.CellElement.RowInfo.Cells["colNumber"].{DisplayText (or something)} = number;
}
}
}