In addition to solution#1 by
Gerry Schmitz[
^], i'd like to provide C# example, how to create masked column ;)
dt.Columns.Add("MaskedNumber", typeof(string));
dt.Columns["MaskedNumber"].Expression = "'XXX-XX-'+SUBSTRING(CONVERT(Number, System.String),6,4)";
result:
Number FName LastName MaskedNumber
781637895 sham C XXX-XX-7895
558563789 Ram M XXX-XX-3789
Finally, you have to hide DataGridView's
column[0]
;)