如何在单元格网格中显示其他文本

时间:2018-06-21 18:51:28

标签: c# telerik

我有一个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;
            }
        }
    }

0 个答案:

没有答案