5 Answers, 1 is accepted
I guess there's some misunderstanding here. Let me explain.
You cannot collapse a header panel item with a template. Here's a sample:
In this case, you cannot collapse Item1 and Item2.
Here's how the panelbar structure should look as to achieve your goal:
-- (RadpanelItem without text)
-- (RadpanelItem without text)
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Paul, I'm trying to do something similar.
So, you are saying that instead of having:
<ItemTemplate> template here </ItemTemplate>
We should instead have:
<Items> <telerik:RadPanelItem> <ItemTemplate> </ItemTemplate> </telerik:RadPanelItem> </Items>
If I get you correctly, how exactly can I add say, a new datagrid into each of these item-templates programmatically?
I am databinding the panelbar.
I'm specifically looking for the code to create a new Item, radpanelitem and itemtemplate in the RadPanelBar1.ItemDataBound event
I will then take the key from the current row, and insert my datagrid into the template.
I do have a simple project with a bare bones setup if would like it, studio 2008 Pro targeting 3.5
I'm actually looking at using the panelbar as an accordion replacement, due to the many problems with using a radgrid inside an accordion.
Let me know if you have any other thoughts. I'm interested in alternate ways of doing this currently, as the accordion sucks so bad for databound uses.
( EDIT: Go look for the May patch at http://www.codeplex.com/AjaxControlToolkit/WorkItem/View.aspx?WorkItemId=11055
I haven't finished all my work with the gridviews inside the accordion yet, but this seems to have helped a few people with databinding accordions.
Be prepared to rebuild the entire toolkit on your local box using VS 2005 )
It appears that we are trying to accomplish basically the same thing. I am trying to replace an accordian with a panelbar where each pane contains a databound grid. One difference is that my panel bar is not databound, just the grids that are contained within. Here is my thread asking basically the same question you have (http://www.telerik.com/community/forums/thread/b311D-bgtmkb.aspx). What I have gotten so far is creating the Items and adding the controls according to what telerik says will work. You can follow that link above to get the code that I am using, but I am seeing basically the same problems as you. If you get any further on this, please post your resolution so that I can fix mine as well.
It displays correctly now, but I have no idea about functionality.
I actually need to put some commandbuttons in the grid, but now I need to look up how to create all the grid stuff programmatically...
Here is the aspx:
and the .vb:
I ended up going back and just using a databound accordion with databound gridviews in the template.
Display was easy enough, but the imagebuttons inside the grid were only firing every OTHER click. For the failed clicks, they posted back, but no event fired at the server.
After quite a bit of looking around, I found out that the latest version of the ajax tookit does NOT have the latest code. There is a bugfix on codeplex for the accordion control, which fixed my click/event issues. From MAY, but it wasn't in the August release.
Not sure if this will help you any or not.
I ended up skipping the panelbar, as it is just too complex to use for databinding purposes for what I needed to get done.
( The panelbar wanted to create a line for the databound row, and a NEW line for the itemtemplate. I need one line total for the "child" rows. )