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

RadPanelbarPanelItemDataBoundEventArgs namespace could not be found?

1 Answer 33 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Admin
Top achievements
Rank 1
Admin asked on 14 Sep 2008, 08:39 AM
I'm having a hard time trying to programatically add images to the panel bar.  I have read through formus for a few hours already.  This is pulled straight from an example.  Does not work for me.

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>


<telerik:RadPanelbar ID="RadPanelbar1" runat="server" Width="100%" Skin="Outlook" OnPanelItemDataBound="RadPanelbar1_OnPanelItemDataBound" ImagesBaseDir="~/img/" PersistStateInCookie="True">

</telerik:RadPanelbar>


Code behind

using

Telerik.Web.UI;


 

 //RadPanelbarPanelItemDataBoundEventArgs namespace can not be found!    I can't figure out why?
protected void RadPanelbar1_OnPanelItemDataBound(object sender,  RadPanelbarPanelItemDataBoundEventArgs e) 

{

if (!e.DataBoundDataRow.IsNull("Image"))

{

e.Item.ImageUrl = (

string)DataBinder.Eval(e.Item.DataItem, "image");

e.Item.ImageOverUrl = (

string)DataBinder.Eval(e.Item.DataItem, "image");

e.Item.ExpandedImageUrl = (

string)DataBinder.Eval(e.Item.DataItem, "image");

}

}




//Bind database to RadPanelBar.  This works

DataSet ds = new DataSet();

da.Fill(ds);

RadPanelbar1.DataSource = ds;

RadPanelbar1.DataFieldID =

"ID";

RadPanelbar1.DataFieldParentID =

"ParentID";

RadPanelbar1.DataTextField =

"Text";

RadPanelbar1.DataValueField =

"ID";

RadPanelbar1.DataNavigateUrlField =

"URL";

RadPanelbar1.DataBind();






1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 15 Sep 2008, 08:25 AM
Hello Mike,

I suggest you edit the code by the following way: 

protected void RadPanelbar1_OnPanelItemDataBound(object sender,  RadPanelBarEventArgs e) { //your  code}  
 
 
 

Also you can read the help article  - Migrating From RadPanelBar Classic to for ASP.NET Ajax


Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
PanelBar
Asked by
Admin
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Share this question
or