Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPISection Head in a data controlSection Head in a data control
Previous
 
Next
New Post
1/15/2007 6:29 PM
 

Hi

I'm looking to use the section head in a bound datalist. I thought that I could do this by naming my id's dynamically, but this does not work.

Code:
<dnn:sectionhead id='dnnSection' runat="server"
CssClass="SubHead" IncludeRule="true" IsExpanded="false"
Section='<%# Eval("CategoryName") %>'
ResourceKey='<%# Eval("CategoryName") %>'
EnableViewState="true"
Text='<%# Eval("CategoryName") %>'
Visible="true" />
<table id='<%# Eval("CategoryName") %>' runat=server>
.....

Has anyone else even tried this? I would really like to use collapsable sections in my datalist.

[EDIT]
Ok I figured it out. Duh. I can name the table id and the sectionhead id something generic and it works fine. It doesn't need to be a databound element.

 
New Post
1/15/2007 6:57 PM
 

Well it works ok unless there is a postback caused by another control. Inside my datalist, I have a gridview and a formview.

Datalist Item Template (SectionHeadAPI)
          GridView
                     FormView

If I click the Select in the datagrid, it loads the data into the formview for updating. But the side effect is that all the Section Head items are then closed (+) and the text property of the dnn:sectionhead (which was set dynamically by the datalist) is gone.

How should one handle this situation? I set enableviewstate on my <dnn:sectionhead> but it is not persisting.

 
New Post
1/16/2007 9:56 AM
 
The way the expand/collapse persists its state is keyed off of the button's id that caused the expand/collapse.  In the section head case, this button has the id of imgIcon.  This id is obviously prefixed with the naming container.  I am guessing that this id is changing between postbacks, and therefore it looses its state.

 
New Post
1/16/2007 11:15 AM
 

Ok. I managed to get around the collapsing problem by putting the id and runat=server in a div tag instead of a table tag.

<ItemTemplate>
 <dnn:sectionhead id='dnnSection' runat="server"
      CssClass="SubHead" IncludeRule="true" IsExpanded="false"
      Section='section'
      ResourceKey='<%# Eval("CategoryName") %>'
      EnableViewState="true"
      Text='<%# Eval("CategoryName") %>'
      Visible="true" />
<div id="section" runat=server>
        <table border="0" cellpadding="1" cellspacing="0" width="100%">
          <tr>
                <td>
                    <asp:Label ID="CategoryIdLabel" runat="server" Text='<%# Eval("CategoryId") %>' Visible="False"></asp:Label>
                    <asp:Label ID="CategoryDescLabel" runat="server" CssClass="normal" Text='<%# Eval("CategoryDesc") %>'></asp:Label>
                </td>
            </tr>
            <tr>
                <td valign="top">   
                  <asp:GridView ....
</div>
                   <asp:FormView .....

The problem that still persists is the Text property of the section head not being set again on the select event of the gridview.

This is what I found when viewing the source:

Before:
<div>
<input type="image" name="dnnSection:imgIcon" id="dnnSection_imgIcon" tabindex="-1" title="Maximize" max_icon="/ErikDev/images/plus.gif" min_icon="/ErikDev/images/minus.gif" src="/ErikDev/images/plus.gif" alt="Maximize" border="0" onclick="if (__dnn_SectionMaxMin(this, 'dnn_ctr369_FRSAdmin_dlCategories__ctl0_section')) return false;" language="javascript" />&nbsp;
<span id="dnnSection_lblTitle" class="SubHead">Carpentry</span>
</div>

After:

<div>
<input type="image" name="dnnSection:imgIcon" id="dnnSection_imgIcon" tabindex="-1" title="Minimize" max_icon="/ErikDev/images/plus.gif" min_icon="/ErikDev/images/minus.gif" src="/ErikDev/images/minus.gif" alt="Minimize" border="0" onclick="if (__dnn_SectionMaxMin(this, 'dnn_ctr369_FRSAdmin_dlCategories__ctl0_section')) return false;" language="javascript" />&nbsp;
<span id="dnnSection_lblTitle" class="SubHead"></span>
</div>

 So I assume that since I set the Text property to a bound value, that when the select event is called, it won't create a rebind of the data, thus no text.

 
New Post
1/16/2007 2:17 PM
 
That or EnableViewState isn't working. I looked at SectionHeadControl.ascx and saw that EnableViewState=False for the label.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPISection Head in a data controlSection Head in a data control


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out