DataGrid and SPList
I have a dataGrid that is databinded to a sharepoint List. I have
written a
ItemCommand event to capture datagrid click and then I try to add
datagrid selected row values to SPEventsList. See this:
'// this is in some method
mydg.datasource = dataset
mydg.databind()
'//This is the method where I update the Events List
ItemCommand_Event(ByVal sender As Object, ByVal e as
DataGridCommandEventArgs)
// I open SPEventsList called _myList, then
Dim item As SPListItem = _myList.Add
item("XYZ") = "Testing"
item("ABC") = e.Item.Index.ToString
Everything works fine. The Word Testing adds to the EventsList
but there is another look-up field in SPEventsList (here "ABC").
Now, when I try to update ABC get an error saying you can';t update a
look up field. How, do I get rid of this. I also tried to explicitly
assign the
value by doing
item("ABC")=myDG.SelectedItem.toString
but this does not work either.
Thank you very much
.
Relevant Pages
- Re: strange event postback behaviour in dynamically created usercontrol
... my aspx page contaings the following in Page_Load: ... the user control is loaded regardless of whether a postback has taken ... the datagrid would disappear from the page. ... itemcommand event being called twice. ... (microsoft.public.dotnet.framework.aspnet) - RE: ButtonColumn and EditCommandColumn dont work together as expected
... The EditCommandColumn server control fires up the ItemCommand event just like ... > I have a DataGrid with standard EditCommandColumn with PageIndex enabled. ... > strange things happen. ... (microsoft.public.dotnet.framework.aspnet.webcontrols) - Re: Changing an image in a datagrid column in the ItemDataBound event
... thanks for the response. ... >> I have a datagrid that is bound to a datatable, ... >> ItemCommand event in which I sort the datatable then ... (microsoft.public.dotnet.framework.aspnet.datagridcontrol) - Re: Detect which ImageButton caused PostBack
... I don't get the ItemCommand event because my DataGrid is being bound to ... these ImageButtons caused the postback so I don't do the bind. ... > command is your command. ... >> I have a DataGrid with a templated column that displays ImageButtons. ... (microsoft.public.dotnet.framework.aspnet) - Re: Invalid CurrentPageIndex error
... Add a DataGird to the WebForm. ... Enable Paging for the datagrid. ... Trap the ItemCommand Event for the Button Column. ... Clicking on the ButtonColumn should give the error. ... (microsoft.public.dotnet.framework.aspnet.datagridcontrol) |
|