My problem was this one :
"I need to display on a specific page the default view of a list, BUT beside each items of this list must be displayed a checkbox in order to be able to select items on this list"
The solution I chose was to recreate a clone of the defaultview that will never be displayed to the users but that will be selected as SPView of the ListView I create on my page.
Here we go...
1/ My Page takes in parameter the ID of the list I'm working on, i call the parameter "List":
Guid ListId = new Guid(this.Page.Request["List"]);2/ Then whenever I reach the page, i check whether the view already exists, if not i create it cloning the default view and adding to it a checbox field. If the clone of the actual defaultview exists i just use it! Easy! In my code below, the listview object is called Select_List
Now, let me explain the code a little bit.
1/ How to create a column Checkbox in a list?
It's quite tricky cause you must create the column using a CAML definition.
Sorry for the "+" but it's for my code lisibility! In fact you just create a field where the display is an HTML input component !!
2/ OK, but now, i have the display How do I get my checkboxes values after postback ?
Well, let's continue to be tricky!! I just create two Hidden field on my page
And on my validation button i fill it before validation using a JS function called fill_ids
The js function simply puts inside the listSrv_Items the ids of each item in the list, and checked_ids will finally contain the list of items ids that are checked.
here we go for the js that i manually add to the page in the render method:
Now my field checked_Ids will contain the ids of my checked items so in my Btn_valid_Click; i just have to use it to do anything I want! That's it!