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. ASP.NET
  4. DropDownList problem... plz help me...

DropDownList problem... plz help me...

Scheduled Pinned Locked Moved ASP.NET
helpphpcomtutorialquestion
3 Posts 3 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.
  • P Offline
    P Offline
    pradeep kumarappagari
    wrote on last edited by
    #1

    Hi all... How to disable a potion without getting selected in the dropdownlist. See the this http://www.naukri.com/tieups/tieups.php?othersrcp=945 go to Current Location* Dropdownlist, there we can able select the location only not the state names. plz tell me how to do that, its urgent help me.......:-O

    Pradeep Reddy

    M S 2 Replies Last reply
    0
    • P pradeep kumarappagari

      Hi all... How to disable a potion without getting selected in the dropdownlist. See the this http://www.naukri.com/tieups/tieups.php?othersrcp=945 go to Current Location* Dropdownlist, there we can able select the location only not the state names. plz tell me how to do that, its urgent help me.......:-O

      Pradeep Reddy

      M Offline
      M Offline
      Mayank Parmar
      wrote on last edited by
      #2

      protected void Page_Load(object sender, EventArgs e) { DataTable dt = commonfunctions.fillCategory(1); } public static DataTable fillCategory(int catID) { DataTable dt = new DataTable(); dt.Columns.Add("CATEGORY_ID", typeof(int)); dt.Columns.Add("CATEGORY_NAME", typeof(string)); dt.Columns.Add("LEVEL", typeof(int)); dt.Columns.Add("PARENT_CATEGORY", typeof(int)); dt = commonfunctions.fillCat(catID, dt, 0); return dt; } public static DataTable fillCat(int catID, DataTable dt, int i) { DataTable currdt = new DataTable(); DataTable cdt = new DataTable(); DataTable ccdt = new DataTable(); string query; query = "SELECT CATEGORY_ID, CATEGORY_NAME, PARENT_CAT_ID FROM CATEGORY_MASTER WHERE CATEGORY_ID = " + catID; currdt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionString, CommandType.Text, query); string name = currdt.Rows[0][1].ToString(); for (int cnt = 0; cnt < i; cnt++) { name = "-" + name; } dt.Rows.Add(currdt.Rows[0][0], name, i, currdt.Rows[0][2]); query = "SELECT CATEGORY_ID, CATEGORY_NAME FROM CATEGORY_MASTER WHERE PARENT_CAT_ID = " + catID ; cdt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionString, CommandType.Text, query); foreach (DataRow drc in cdt.Rows) { query = "SELECT COUNT(*) FROM CATEGORY_MASTER WHERE PARENT_CAT_ID = " + catID ; ccdt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionString, CommandType.Text, query); if (Convert.ToInt32(ccdt.Rows[0][0].ToString()) > 0) { i++; dt = fillCat(Convert.ToInt32(drc[0].ToString()), dt, i); i--; } else { name = drc[1].ToString(); i--; for (int cnt = 0; cnt < i; cnt++) { name = "-" + name; } dt.Rows.Add(drc[0], name, i, catID); } } i--; return dt; } --------------------------------------- Here I have just one table. Category_Master And Column are : Category_id Category_Name Parent_Category_ID

      1 Reply Last reply
      0
      • P pradeep kumarappagari

        Hi all... How to disable a potion without getting selected in the dropdownlist. See the this http://www.naukri.com/tieups/tieups.php?othersrcp=945 go to Current Location* Dropdownlist, there we can able select the location only not the state names. plz tell me how to do that, its urgent help me.......:-O

        Pradeep Reddy

        S Offline
        S Offline
        Sylvester george
        wrote on last edited by
        #3

        All the state name values are "select". So the code may be checking if the value is not "select" accept the value. Please try it out with this logic

        Regards, Sylvester G sylvester_g_m@yahoo.com

        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