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