I'm binding a RadGrid to a BindingList, when I edit a Template column with a dropDown I'm trying it to keep the previously selected value
here is a sample of my code:
eval works fine but bind throws an exception: DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'Contrib'.
I also tried in cs but I cannot find the value in the item["Contributor"].Text
then I tried witha a label in the Item template, ((Label)item["Contributor"].findControl("labelID")).Text but it's always ""
any help will be apreciated thanks!
here is a sample of my code:
<
telerik:GridTemplateColumn
HeaderText
=
"Contributor"
UniqueName
=
"Contributor"
DataField
=
"Contrib"
>
<
EditItemTemplate
>
<
asp:DropDownList
ID
=
"ddContributor"
runat
=
"server"
DataSourceID
=
"ldsContibutors"
DataTextField
=
"ContributorName"
DataValueField
=
"ContributorID"
AppendDataBoundItems
=
"True"
SelectedValue='<%# Eval("Contrib.ContributorID") %>'>
<
asp:ListItem
>Select a value</
asp:ListItem
>
</
asp:DropDownList
>
</
EditItemTemplate
>
<
ItemTemplate
>
<%# Eval("Contrib.ContributorName") %>
</
ItemTemplate
>
eval works fine but bind throws an exception: DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'Contrib'.
I also tried in cs but I cannot find the value in the item["Contributor"].Text
then I tried witha a label in the Item template, ((Label)item["Contributor"].findControl("labelID")).Text but it's always ""
any help will be apreciated thanks!