Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

In a DataView you can easily set a column as read only, but I was wondering if there was a way in the DataGrid to set a columns enabled to false. Read only still allows them to edit it, and just changes the value back after they click outside the column. I'm looking for a way so they can't edit what's in side at all (no changing!) or even click inside the column.

 

Better yet, is there a way to filter columns displayed with the DataView? I know there's RowFilter, but nothing that seems to cover column filtering.

Gamer extraordinaire. Programmer wannabe.
  • *Experts*
Posted

If you mean to hide columns (your second question), you have to define a new DataGridTableStyle. Check the help for more info. I believe you can also make columns non-editable this way but I'm not sure if there's an easier way.

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Aha! So that's where it was hiding. Interesting. :cool: And very nice. :) Thanks.

 

In the future .NET should add column support to the DataView class so I can easily filter them out using that instead. They designed it to filter rows, why not columns too? And just because you can do it with a DataGrid is not the point! :rolleyes:

 

*ponder* Come to think of it, when I become an all mighty guru maybe I'll extend the DataView class so you can do just that. ;)

Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...