PC Review


Reply
Thread Tools Rate Thread

anyone having an idea

 
 
nizam
Guest
Posts: n/a
 
      27th Oct 2005
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.


 
Reply With Quote
 
 
 
 
Bajoo
Guest
Posts: n/a
 
      27th Oct 2005
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

 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      28th Oct 2005
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.


"nizam" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can somebody pls. look @ this idea & tell me if it's possible? Susan Microsoft Excel Programming 6 25th Jul 2007 01:40 PM
Good idea or bad idea? pigeonrandle Microsoft C# .NET 2 22nd Jan 2007 06:55 PM
Good idea/Bad idea? murdoch General Discussion 2 8th Apr 2006 09:56 PM
DHCP - Good Idea/Bad idea HelpPls Microsoft Windows 2000 Advanced Server 1 3rd Mar 2005 01:31 AM
Good idea - bad idea Andy Levy Microsoft Access 1 3rd Jun 2004 09:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:27 PM.