anyone having an idea

  • Thread starter Thread starter nizam
  • Start date Start date
N

nizam

hi all,
this is nizam. just today i have joined this group. i want to know how to
bind a dropdownlist to the datagrid in asp.net application.

thankx in advance
nizam.
 
dear nizam ,
i hope the following code helps you out

<asp:TemplateColumn HeaderText="Country">
<ItemTemplate>
<asp:Label ID="lblCountry"
Text='<%# DataBinder.Eval(Container.DataItem,
"Country") %>'
Runat="server" />
<asp:dropDownList id="ddlCountry"
DataSource="<%# BindTheCountry() %>"
OnPreRender="SetDropDownIndex"
DataTextField="Country"
DataValueField="Country"
runat="server" />
</ItemTemplate>
</asp:TemplateColumn>

you can also bind the data source in the code behind but then you have
to get the control first from the grid.

Regards,
Naveed Ahmad Bajwa
Kalsoft pvt Ltd
 
Hi nizam,

If you're working with ASP.Net, you'll get better information from the
microsoft.public.dotnet.framework.aspnet newsgroup.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top