Reputation: 693
I have looked at numerous articles on how to make on-click events and the best I could find is rowclick, even then it was not very clear on what you have to do. Some use rowcreated event some combine rowchanged and selectedindexchanged, others have said columnindex and rowindex. All I want is for users to be able to click the cell and it show the value in a textbox on the page. Please someone tell me the most simplistic way of doing so. (WITHOUT USING A BUTTON) Thank you for your help.
Upvotes: 0
Views: 91
Reputation: 171
For just displaying the value of a clicked cell in a textbox I suggest using javascript.
Using a library like jQuery there is not much code to write:
$('#clientIdOfGridViewTable').on('click', 'tr > td', function(event) { $('#clientIdOfTextBox').val($(this).text () });
I am writing this on my phone so the code above might need tweaking.
Upvotes: 1