Hiding values in a datagrid

W

Wayne

I have a datagrid that will display data, and based on the security level of
our user's they may not be able to see the data. However, I still want the
column to appear in the grid and just mask the data with asterisks, one for
each char in the value or a fixed number, but none if the value is blank.

Anyone have any examples of how to do this?

--
Thanks
Wayne Sepega
Jacksonville, Fl

Enterprise Library Configuration Console Module Generator
http://workspaces.gotdotnet.com/elccmg

"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
 
N

Nicholas Paldino [.NET/C# MVP]

Wayne,

In order to do this, you would have to create an individual
DataGridColumnStyle for each column you wanted to show. You would have to
make the determination if the data could be displayed or not, and if not,
draw the column cell so that it shows asterisks.

That's not really too secure though, since the data is still in memory
(in the dataset). One could argue that your UI layer should not even have
knowledge of that data, if you truly want to be secure.

To do what you want, check out the documentation for the
DataGridColumnStyle class.

Hopet his helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

windows form datagrid questions 2
Beta 2 News Groups 1
///Summary <-- help file generation 2
form inheritance 1
is a char a number? 1
TollBox Pushpin effect 2
DataGrid multi select 3
New to .net threads 3

Top