TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aamir Khan
NA
277
440k
Dropdown in Gridview should be filled on Selection of another Dropdown which is outside Gridview
Jun 20 2012 3:36 AM
Hi friends,
i have a requirement where i have to fill a dropdown in a Gridview on Selection or IndexChange of another Dropdown Control which is not inside of any Gridview.
i have done some code but i get the Null value;
code is as below
protected
{
void
DrpProtocol_ID_SelectedIndexChanged(
object
sender,
EventArgs
e)
//DataRowView drv = e.Row.DataItem as DataRowView;
dt = objDal.GetDataQry(
{
ddlCity = (
DataSet
dt =
new
DataSet
();
"select InvId from dbo.InvDetails where ProtocolId='"
+ DrpProtocol_ID.SelectedItem.Text +
"'"
,
Convert
.ToString(
ConfigurationManager
.ConnectionStrings[
"ConDMUtils_BackUp"
].ConnectionString));
DropDownList
ddlCity =
new
DropDownList
();
foreach
(
GridViewRow
row
in
GridView1.Rows)
DropDownList
)row.FindControl(
"ddlSite"
);
//dropdown inside Gridview
}
{
ddlCity.DataSource = dt.Tables[0];
if
(ddlCity !=
null
)
//ddlCity.DataTextField = "InvId";
ddlCity.DataValueField =
"InvId"
;
ddlCity.DataBind();
}
}
what is the mistake being done
Reply
Answers (
7
)
Getting problem in subdomain data access
How can we use excel as a backend database and asp.net as a front end?