Maybe the DataSource is the right solution. For now, I created a new class
DataGridReadOnlyTextBoxColumn inheriting from DataGridTextBoxColumn and
overrode Edit method to just return.
I can't set the width to zero, because I still want to display the columns.
actually, yup. sorry about that. i got lost in thinking about something else
while answering this post and ended up providing an incorrect answer
(sorry!). I was thinking about how to set the width of a datagrid column to
0...
actually, yup. sorry about that. i got lost in thinking about something else
while answering this post and ended up providing an incorrect answer
(sorry!). I was thinking about how to set the width of a datagrid column to
0...
I had a very similar situation. I just used the readonly property and that
worked fine.... but.... the users were very happy when I also figured out
how to display any data in the 'writeable' columns in a different colour (I
used red... readonly data black). Just an idea... I'll try to dig out some
code tomorrow.
That's very interesting, and probably something I'll have to do some day
(change background color). Now, I don't believe there is a property for the
background color, right?
I changed it a touch so that I could pass the colours when calling the
class... other than that it pretty much worked right out of the box for me.
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.