Hi,
I have a few questions to ask. I'm not able to update the data and select the item from the dropdownlist.
I have the code here. It is the exact same things i refer from ( http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultvb.aspx# ). Only change the dropdownlist to ItemTemplate
because it is not populate from the databinding.
If I put SelectedValue='<%# Bind("Branch") %>' at the EditItemTemplate I can update the data but
I cannot add new record. It will appear this error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException:
'DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
And if I remove the SelectedValue, I can add new record but I cannot update the data.
It will appear this error:
User with ID 3 cannot be updated. Reason: Cannot insert the value NULL into column 'Branch', table 'eDMS42.dbo.TblBranchApprover'; column does not allow nulls. UPDATE fails.
The statement has been terminated.
It's been bugging me for a week now. Please help me out.
I have a few questions to ask. I'm not able to update the data and select the item from the dropdownlist.
I have the code here. It is the exact same things i refer from ( http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultvb.aspx# ). Only change the dropdownlist to ItemTemplate
because it is not populate from the databinding.
<
telerik:GridTemplateColumn
HeaderText
=
"Branch"
SortExpression
=
"Branch"
UniqueName
=
"TemplateColumn"
EditFormColumnIndex
=
"1"
>
<
ItemTemplate
>
<
asp:Label
runat
=
"server"
ID
=
"lblBranch"
><%# DataBinder.Eval(Container.DataItem, "Branch")%></
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:DropDownList
ID
=
"DropDownList1"
runat
=
"server"
>
<
asp:ListItem
Value
=
"KL"
>KL Head Office</
asp:ListItem
>
<
asp:ListItem
Value
=
"PG"
>Penang</
asp:ListItem
>
<
asp:ListItem
Value
=
"JB"
>Johor Bahru</
asp:ListItem
>
</
asp:DropDownList
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
If I put SelectedValue='<%# Bind("Branch") %>' at the EditItemTemplate I can update the data but
I cannot add new record. It will appear this error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException:
'DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
And if I remove the SelectedValue, I can add new record but I cannot update the data.
It will appear this error:
User with ID 3 cannot be updated. Reason: Cannot insert the value NULL into column 'Branch', table 'eDMS42.dbo.TblBranchApprover'; column does not allow nulls. UPDATE fails.
The statement has been terminated.
It's been bugging me for a week now. Please help me out.