Welcome Guest Search | Active Topics | Sign In | Register

Bind to an ASP SqlDataSource Options
Ryan Idrap
Posted: Tuesday, September 4, 2007 2:43:55 PM
Rank: Newbie
Groups: Member

Joined: 7/26/2007
Posts: 6
I'm trying to bind a tabstrip to an asp sqldatasource, but I can't get it to work. See my code below. SqlUserGroups is the id of the datasource (I've tested the datasource and I know it returns data). GroupName is the field in the result set. When I run the code I get nothing in the tabstrip. On another page I'm binding a tabstrip to an XML Datasource and it works great, so I can't figure out what I'm doing wrong here. Any ideas?

<eo:tabstrip DataSourceID="SqlUserGroups" id="tbGroups" runat="server" ControlSkinID="None">
<TopGroup>
<Bindings>
<eo:DataBinding DataField="GroupName" Property="Value" />
</Bindings>
</TopGroup>
<LookItems>
<eo:TabItem Height="21" ItemID="_Default" LeftIcon-SelectedUrl="00010605" LeftIcon-Url="00010604"
NormalStyle-CssText="background-image: url(00010602); background-repeat: repeat-x; font-weight: normal; color: black;"
RightIcon-SelectedUrl="00010607" RightIcon-Url="00010606" SelectedStyle-CssText="background-image: url(00010603); background-repeat: repeat-x; font-weight: bold; color: #ff7e00;"
Text-Padding-Bottom="2" Text-Padding-Top="1">
<SubGroup ItemSpacing="1" Style-CssText="background-image:url(00010601);background-position-y:bottom;background-repeat:repeat-x;color:black;cursor:hand;font-family:Verdana;font-size:12px;">
</SubGroup>
</eo:TabItem>
</LookItems>
</eo:tabstrip>
eo_support
Posted: Tuesday, September 4, 2007 2:50:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi Ryan,

SqlDataSource won't work. TabStrip derives from BaseNavigator, which requires an hierarchical data source. Besides, even if it were to take SqlDataSource, you still need to specify which field is used to populate the tab item text.

The easiest way for you would be populating either from an IDataReader (SqlDataReader, for example) or a DataTable. You can also populate from an IEnumerable (an array, or ArrayList, for example). You can find more information on those at here:

http://www.essentialobjects.com/ViewDoc.aspx?t=MenuCommon%2fDataBinding%2fpopulate_table.html
http://www.essentialobjects.com/ViewDoc.aspx?t=MenuCommon%2fDataBinding%2fpopulate_array.html

Thanks
Ryan Idrap
Posted: Tuesday, September 4, 2007 3:24:53 PM
Rank: Newbie
Groups: Member

Joined: 7/26/2007
Posts: 6
Thanks for the quick reply (once again!). That gave me what I needed and I've got it working.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.