J
jphaycock
I've been trying to do this all day.
Sorry if the lingo isn't right but I think this is close:
I have a formview that is using an ObectDataSource to bind to a class
in my app_code folder. I have an update method in that class that
works fine. and I am using this as the formViews update method. There
are just 4 fields
ID int
Name string
Description string
added boolean
The ID is taken from a dropdownList (selectedValue). When I choose an
item from the dropdown the formview is populated. I can add and delete
items in the form view but when i do an update it complains that the
ID column is read only.
I have used this check in the ItemUpdating event to check the value of
the id and it is null
Label skillID = FormView2.FindControl("Id") as Label;
if (skillID != null)
{
e.NewValues["Id"] = skillID.Text;
}
else
{
//get annoyed!!
}
I have no idea why it is getting set to null.
Has anyone got any ideas? Any help is much appreciated I have Googled
it to death but got nowhere
John
Sorry if the lingo isn't right but I think this is close:
I have a formview that is using an ObectDataSource to bind to a class
in my app_code folder. I have an update method in that class that
works fine. and I am using this as the formViews update method. There
are just 4 fields
ID int
Name string
Description string
added boolean
The ID is taken from a dropdownList (selectedValue). When I choose an
item from the dropdown the formview is populated. I can add and delete
items in the form view but when i do an update it complains that the
ID column is read only.
I have used this check in the ItemUpdating event to check the value of
the id and it is null
Label skillID = FormView2.FindControl("Id") as Label;
if (skillID != null)
{
e.NewValues["Id"] = skillID.Text;
}
else
{
//get annoyed!!
}
I have no idea why it is getting set to null.
Has anyone got any ideas? Any help is much appreciated I have Googled
it to death but got nowhere
John