SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am displaying a custom list using a ListViewWebPart. I want to update the display so that it has some buttons (two columns at the end with buttons).

I then want to handle the button click and do some custom logic.

Can i do this with the ListViewWebPart?

I am using the correct web part?

share|improve this question
up vote 0 down vote accepted

Use the dataview webpart rather than the list view one. Insert a blank dataview in sharepoint designer and then attach the custom list as the data source. You can do a lot more with the dataview webpart than the list view one.

share|improve this answer

What you can do is put HTML through calculated column following the link below:
Using calculated columns to write HTML

The guy has explained how you can add HTML in a calculated column or you can make single line textbox to prepare your HTML and then using JavaScript the HTML will be rendered in XSLTListView.. following is the link to download JavaScript:
Download link - Topic : HTML Calculated Column

So you can create buttons, link buttons, image buttons inside and on javascript redirect to other page or call pop up etc.

But you need to make sure the JavaScript is on every page you have the XSLTListView...

I hope this helps

share|improve this answer

You would open the page in SharePoint Designer and modify the Web Part by adding the buttons. Custom logic when pressing the buttons would be easiest by using JavaScript and Client Object Model.

share|improve this answer
what about changing this to use a SPGridView? – user1786107 Nov 14 '12 at 13:13

Here is a solution using JSLink.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – SPArchaeologist Jun 5 '15 at 8:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.