These steps will guide you through the process of coverting the SharePoint Data View Web Part into dropdown format and display the unique items or values from the list. Now to perform the steps below, the SharePoint designer and XSL knowlegde is required. Start by adding a blank Data View Web Part on a page. Then attach the list source to the data view from data source library. For this example I will attach the test list that I created for this tutorial.After providing the source for the Data View all the columns from the list will be displayed. Now lets drag and drop one of the columns from the data source on a Data View. At this point it will bring all the data from that column and display it in a table format. If it is previewed it will look like this : Data View Web Part in Table Format Now, lets convert this Data View Web Part into a drop down format. In a SharePoint designer click on the little arrow or bracket at t...
Below are the steps for adding an option to the dropdown box using JavaScript. · Create a Option element using JavaScript var opt = document.createElement("option"); · Add Option object to dropdown box document.getElementById("test").options.add(opt); · Assign value and text to the Option object just added opt.text = "New"; opt.value = "0"; · Insert this Option object just created at top position inside dropdown. This step is optional, if this step is not performed the Option object will added to dropdown as the last item. document.getElementById("test").insertBefore(opt, document.getElementById("test").firstChild); · To make the Option object as default when th...