Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / September 2005

Tip: Looking for answers? Try searching our database.

DataGrid Pulldowns- how to access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken Webster - 22 Sep 2005 01:04 GMT
Given a pulldown template like:

     <asp:TemplateColumn HeaderText="PO Line">
     <ItemTemplate>
      <asp:Label id="TX_POLine" runat="server" BorderColor="#E0E0E0"
BackColor="White" BorderStyle="Solid"></asp:Label>
     </ItemTemplate>
     <EditItemTemplate>
      <asp:DropDownList id="CB_POLine" runat="server"
Width="75px"></asp:DropDownList>
     </EditItemTemplate>
    </asp:TemplateColumn>

How/where can I populate the pulldown in code?

I've tried everything I can think of to find that pulldown, but with no
luck. My latest attempt was:
For liRow = 0 To DG_List.Items.Count - 1
pd = CType(DG_List.Items(lirow).FindControl("CB_POLine"), DropDownList)
If Not pd Is Nothing Then
 ' --- should break here if the pulldown is found
End If
Next

Thanks
Scott Mitchell [MVP] - 23 Sep 2005 05:01 GMT
Ken, it matters when you're doing this.  If you put a breakpoint in your
code, what's the value of DG_List.Items.Count?

Here's an article that shows how to display a DDL in an editable DG:
http://aspnet.4guysfromrolla.com/articles/080702-1.aspx

Also, you might want to consider taking a look at Andy Smith's free
BoundLookupColumn DataGridColumn control:
http://metabuilders.com/Tools/BoundLookupColumn.aspx

hth

> Given a pulldown template like:
>
[quoted text clipped - 21 lines]
>
> Thanks

Signature

    Scott Mitchell [ASP.NET MVP]
    mitchell@4GuysFromRolla.com
    http://www.4GuysFromRolla.com/ScottMitchell


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.