This is a migrated thread and some comments may be shown as answers.

Cant get "OnItemDataBound" To work!

3 Answers 332 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 21 Feb 2010, 12:39 AM
<telerik:RadComboBox ID="AreaOfInterestComboBox" runat="server" AutoPostBack="false" CssClass="areaOfInterestComboBox" Skin="Bazaar" EnableEmbeddedSkins="false" OnDataBound="AreaOfInterestComboBox_ItemDataBound"
    <ItemTemplate> 
        <asp:CheckBox runat="server" ID="cbCategory" Text="" AutoPostBack="false" onclick="stopPropagation(event);" /> 
        <%# DataBinder.Eval(Container, "Text") %> 
    </ItemTemplate> 
</telerik:RadComboBox> 


protected void AreaOfInterestComboBox_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e) 


Cant get this to work, why? I need to be able to make the CheckBoxed Checked or unchecked in the Event OnItemDataBound, Is it possible?

"Compiler Error Message: CS0123: No overload for 'AreaOfInterestComboBox_ItemDataBound' matches delegate 'System.EventHandler'"

And Visual Studio can't resolva "RadComboBoxItemDataBoundEventArgs", cant use namespace Telerik.WebControls!

3 Answers, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 21 Feb 2010, 05:36 PM
You're handling DataBound, not ItemDataBound....

Change this
OnDataBound="AreaOfInterestComboBox_ItemDataBound"

to this
OnItemDataBound="AreaOfInterestComboBox_ItemDataBound"




There doesn't appear to be a Telerik.WebControls...you should be using Telerik.Web.UI



0
Erik
Top achievements
Rank 1
answered on 22 Feb 2010, 11:57 AM
I've tried to use OnItemDataBound, but there is no trigger of that event, the page is loaded and does nog go into AreaOfInterestComboBox_OnItemDataBound, why?
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 22 Feb 2010, 12:21 PM
I don't see a datasource defined either which would explain why the ItemDataBound isn't firing

Are you assigning it somewhere in the code behind, and if you are, have you tried calling the DataBind() method on the combo after that?
Tags
ComboBox
Asked by
Erik
Top achievements
Rank 1
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Erik
Top achievements
Rank 1
Share this question
or