Problem in filling drop down list
-
Hi, i m trying to fill my dropdownlist from dropdown object. in my class
public DropDownList Bind_DdlBranch(int ZoneId)
{
DropDownList ddl = new DropDownList();
clsMasterBranch obj = new clsMasterBranch();
ddl.DataTextField = "testfieldname";
ddl.DataValueField = "valuefieldname";
ddl.DataSource = obj.MasterBranch_FetchByZoneId_DataSet(ZoneId);
ddl.DataBind();return ddl; }
here i m getting value in ddl object. but while i m trying to bind the ddl object to dropdownlist in my c# code
clsDropDownList obj = new clsDropDownList(); ddlBranch = obj.Bind\_DdlBranch(3);
page was build with no error but drop down ddlBranch is empty... Plz guyz help me to find out the mistek.... thanx is advance....
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."
-
Hi, i m trying to fill my dropdownlist from dropdown object. in my class
public DropDownList Bind_DdlBranch(int ZoneId)
{
DropDownList ddl = new DropDownList();
clsMasterBranch obj = new clsMasterBranch();
ddl.DataTextField = "testfieldname";
ddl.DataValueField = "valuefieldname";
ddl.DataSource = obj.MasterBranch_FetchByZoneId_DataSet(ZoneId);
ddl.DataBind();return ddl; }
here i m getting value in ddl object. but while i m trying to bind the ddl object to dropdownlist in my c# code
clsDropDownList obj = new clsDropDownList(); ddlBranch = obj.Bind\_DdlBranch(3);
page was build with no error but drop down ddlBranch is empty... Plz guyz help me to find out the mistek.... thanx is advance....
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."
if
obj.MasterBranch_FetchByZoneId_DataSet(ZoneId);
return DataSet then rty to find the index of table e.g.
ddl.DataSource = obj.MasterBranch_FetchByZoneId_DataSet(ZoneId).Tables[0];
I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.
-
if
obj.MasterBranch_FetchByZoneId_DataSet(ZoneId);
return DataSet then rty to find the index of table e.g.
ddl.DataSource = obj.MasterBranch_FetchByZoneId_DataSet(ZoneId).Tables[0];
I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.
thax for reply.... but
obj.MasterBranch\_FetchByZoneId\_DataSet(ZoneId);
returning value to the dataset... my problem is that
clsDropDownList obj = new clsDropDownList();
ddlBranch = obj.Bind_DdlBranch(3);is not binding data to the physical dropdownlist. where
obj.Bind_DdlBranch(3);
is returning the dropdownlist
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."
-
thax for reply.... but
obj.MasterBranch\_FetchByZoneId\_DataSet(ZoneId);
returning value to the dataset... my problem is that
clsDropDownList obj = new clsDropDownList();
ddlBranch = obj.Bind_DdlBranch(3);is not binding data to the physical dropdownlist. where
obj.Bind_DdlBranch(3);
is returning the dropdownlist
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."
Did you try to
Bind()
ddlBranch control after you call function which return DropDownList e.g/
clsDropDownList obj = new clsDropDownList();
ddlBranch = obj.Bind_DdlBranch(3);
ddlBranch.DataBind();
I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.
-
Did you try to
Bind()
ddlBranch control after you call function which return DropDownList e.g/
clsDropDownList obj = new clsDropDownList();
ddlBranch = obj.Bind_DdlBranch(3);
ddlBranch.DataBind();
I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.
sorry.... i forgot to copy that line in my code... but i have already do that...
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."
-
Hi, i m trying to fill my dropdownlist from dropdown object. in my class
public DropDownList Bind_DdlBranch(int ZoneId)
{
DropDownList ddl = new DropDownList();
clsMasterBranch obj = new clsMasterBranch();
ddl.DataTextField = "testfieldname";
ddl.DataValueField = "valuefieldname";
ddl.DataSource = obj.MasterBranch_FetchByZoneId_DataSet(ZoneId);
ddl.DataBind();return ddl; }
here i m getting value in ddl object. but while i m trying to bind the ddl object to dropdownlist in my c# code
clsDropDownList obj = new clsDropDownList(); ddlBranch = obj.Bind\_DdlBranch(3);
page was build with no error but drop down ddlBranch is empty... Plz guyz help me to find out the mistek.... thanx is advance....
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."
First of all, How is your dropdown list added in the UI? Please make sure you are adding the same dropdown returned from the function in a panel or a table. Secondly do check if your dropdown is filled while debugging in your function scope (Bind_DdlBranch in this case). Hope that helps...
When you fail to plan, you are planning to fail.