Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Unable to update Gridview dropdown selected value into SharePoint choice List

$
0
0

Hi

I am trying to update the SharePoint List through grid view, This is the code I am using to update the list items.

 item = SelectedList.Items.Add();
                        DropDownList ddlEventTypes = (DropDownList)Gridview1.Rows[i].Cells[1].FindControl("ddlEvents");
                        DateTimeControl dtStartDate = (DateTimeControl)Gridview1.Rows[i].Cells[2].FindControl("StartDate");
                        DateTimeControl dtEndDate = (DateTimeControl)Gridview1.Rows[i].Cells[3].FindControl("EndDate");
                        item["Name"] = usrValue;
                        item["Event Type"] = ddlEventTypes.SelectedItem.Text;
                        item["Start Time"] = dtStartDate.SelectedDate;
                        item["End Time"] = dtEndDate.SelectedDate;
                        item.Update();   

and in my GridView EventType is a Drop down(Choice),

I am getting exception on item["Event Type"] = ddlEventTypes.SelectedItem.Text; as invalide input string type, could you please help me to update it?

thanks

Azra


With Thanks and Regards, Azra


Viewing all articles
Browse latest Browse all 11571

Trending Articles



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