Read Only Rows in Data Grid

ReportsNerd

Active member
Joined
Nov 24, 2012
Messages
31
Programming Experience
3-5
Hi, I am building a Windows Forms application with VS Pro 2010. I will be using the stock data grid control to show customer transaction history which includes several rows for interest and several rows for payments.

My client has a requirement to edit the amount field in a data grid if it is a payment, but if the row is associated with the interest amount, it should be read only and not allow editing. We have a column that will indicate "I" for interest and "P" for mayment.

Any suggestions or examples appreciated on how to approach this.

Thanks
 
My offerred help refers to a C1FlexGrid which should be the same for the datagrid.

You have to format the grid with a hidden column which contains the edit information. Either true or false depending on the content. Then, on the BeforeEdit event, test to see if the row clicked is editable or not. If not, exit the BeforeEdit sub with Cancel=True.

Hope this helps.
 
My offerred help refers to a C1FlexGrid which should be the same for the datagrid.

You have to format the grid with a hidden column which contains the edit information. Either true or false depending on the content. Then, on the BeforeEdit event, test to see if the row clicked is editable or not. If not, exit the BeforeEdit sub with Cancel=True.

Hope this helps.
Nope, not the same.
 
Goodness, thanks for your replies, but I misunderstood my requirement. Sorry. What we actually need is to be able to double click on a record in the grid and have it pop open a small details form with that record and other fields from the database ready to edit. So, no records will actually be edited in the grid itself.

Are there any examples of how to do that (feed a popup window from a record on a grid)?

Once I have the record open in the popup window, I can control the read only access there.

Thank you.
 
Back
Top