Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. xna4life Member 13 Points 71 Posts hard code drop down instead of using toolbar and r/s

xna4life Member 13 Points 71 Posts hard code drop down instead of using toolbar and r/s

Scheduled Pinned Locked Moved JavaScript
csharpasp-netwpfsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xnaLearner
    wrote on last edited by
    #1

    So im trying to creae a dynamic data project using asp.net.

    my project has 2 tables, FruitTable and SellerTable.

    I had it set so the primary key in 'fruit table': name. was the foreign key in 'seller table'

    I added a new class which contains the code to link to the new fieldTemplate I added(DropDown)

    [MetadataType(typeof(UsingDropDownMetadata))]
    public partial class UsingDropDown
    {
    }

    public class UsingDropDownMetadata
    {
        //DropDown is name of field templates
        \[UIHint("DropDown")\]
        //use in field date in tracing table
        public object DropDownFromTextBox { get; set; }
    }
    

    then in the dropDown_Edit.ascx I used the toolbox to get a drop down list and link it to the fruit table.

    Now when a user creates a new item, they can select the names of fruit to add.

    However I would like to hard code this so I have removed the r/s btn fruit and seller table

    In dropdownEdit.ascx iv added it manuall

    <asp:DropDownList id="DropDownList1" runat="server"
    DataSource="<% databindingexpression %>"
    DataTextField="DataSourceField"
    DataValueField="DataSourceField"
    AutoPostBack="True|False"
    OnSelectedIndexChanged="OnSelectedIndexChangedMethod">

    <asp:ListItem value="value" selected="True|False">
    Text
    </asp:ListItem>

    </asp:DropDownList>
    then in the dropdownedit.ascx.cs

    I want to hard code to pull across the values but am not sure if I am doing this right. please advise

    protected void OnSelectedIndexChangedMethod(object sender, EventArgs e)
    {

    //text here

    }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups