SfWeb Dropdownlist populating


Author
Message
Olivier
Olivier
StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 806
Hi all,

I don't find any example or tutorial to populating a dropdownlist with a business object.

I try two way :

<SFWebBigGrinropDownList ID="DropDownList1" runat="server" BusinessObjectName="oTMessageBo" DataTextField="TMES_LIBELLE" DataValueField="TMES_ID" >
</SFWebBigGrinropDownList>

or

 <SFWebBigGrinropDownList ID="DDL_TMESSAGE" runat="server">
      <PopulationDataSourceSettings BusinessObjectType="oTMessageBo" DisplayFieldNamesAlternate="TMES_LIBELLE|" DropDownFormatString="" FormatString="{0}" MethodToExecute="GetYesNo;" ValueMember="TMES_ID" />
 </SFWebBigGrinropDownList>

Have you an idea ?

I work in c# asp.net with strata.

thanks
Olivier,



==============================================
Asp.net C# - Strataframe - telerik
==============================================
Reply
Michel Levy
Michel Levy
Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
He he Olivier,

Did you forgot all we've learn on the SF session I gave you? Whistling That method (FillDataAllFields) is the one we wrote together as an example on one of your BOs...

You may write whatever you want in a custom Fill method, including WHERE clause and/or JOIN and/or ORDER, etc etc... all this will run on the SQL server as long the syntax you use is T-SQL syntax for your version of the engine (I mean SQL 2000 will not understand a CTE, for example).
A single BO may host as many custom fill method you need, and all these methods will be available to fill it from within any aspx page based on a default page in which you create an instance of this BO. Simply code what you need in the BO, consume it where you need.
In my own BOs, around half of the fill methods are specifics one for populating DropDownLists, Combos, and lists (I query only the columns I need).

For the empty or additional line on top of the Combo, look at the TopMostDescription property, it is intended for that usage (see also TopMostDropDown and TopMostValue)

-------------------------------------------------------

Oh Olivier,

Tu as oublié tout ce qu'on a vu pendant la formation que j'ai faite chez toi Whistling Cette méthode (FillDataAllFields), c'est celle qu'on a écrite ensemble comme exemple sur un de tes BOs...

Tu peux écrire ce que tu veux dans une méthode Fill, y compris avec des WHERE, des JOIN, des ORDER, etc etc... tout ça sera éxécuté sur le serveur SQL si ta syntaxe respecte le T-SQL de ta version (je veux dire que par exemple un SQL 2000 ne comprendra pas une requète avec une CTE).
Un BO peut héberger autant de requètes Fill personnalisées que tu veux, toutes ces méthodes seront disponibles pour peupler le BO depuis une page aspx dérivée d'une basepage dans laquelle tu auras créé une instance de ce BO. Tu as juste à coder dans le BO, et tu utilises ce que tu veux quand tu en as besoin.
Dans mes BOs, environ la moitié des méthodes fill sont destinées à peupler des listes déroulantes et des combos (je requète uniquement les colonnes dont j'ai besoin).

Pour ce qui concerne la ligne vide ou supplémentaire en haut du combo, regarde la propriété TopMostDescription, elle est justement faite pour ça! (regarde aussi TopMostDropDown et TopMostValue)
Edited 13 Years Ago by Michel Levy
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search