Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Event Receiver - SPFieldChoice

$
0
0

I need to edit a field (ChoiseType) only one (not all) element in a list.

Use the following code:

            
            SPListItemCollection elementoLista = ricavoElements.elementilistafiltrati(Id_richiesta, nomeLista, ref properties);
            
            foreach (SPListItem item in elementoLista)
            {
                SPFieldChoice dropDown = (SPFieldChoice)item.Fields["Stato Richiesta"];
                dropDown.Choices.Clear(); // Elimino gli stati precedenti
                foreach (SPListItem elemento in collListItems)
                {
                    string stato = elemento["stati"].ToString();
                    dropDown.Choices.Add(stato);// imposto il nuovo stato

                }
                dropDown.Update();// faccio l'update

Unfortunately change the choices of ALL the items on the list ...

Do you have an idea how can I do?

thanks


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>