How to edit cell of type Linkcolumn in a gridview

旧城冷巷雨未停 提交于 2020-01-11 07:14:08

问题


I have a gridview control having 4 columns. One of the column is of type linkcolumn. The user has to enter data for each column.

How can we edit the link column cell? When I click on this cell nothing happens. I did set its readonly property to false.


回答1:


Your can try creating a textbox control instead and show it when the grid is being edited, this will allow the user to enter the hyperlink's text. Then add code to check if this textbox control has any text and if so you can then display a hypelink control with the value from the textbox and hide the textbox.

Also, my preferred way of doing this is to use grids for viewing only (read only), and then have a separate form with the data entry fields for data entry purposes.

Good luck!



来源:https://stackoverflow.com/questions/2513515/how-to-edit-cell-of-type-linkcolumn-in-a-gridview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!