Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Ken Webster #1
DataGrid Pulldowns- how to access
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
Ken Webster Guest
-
Access the buttons in the datagrid within another datagrid
I have a datagrid whose, data is bound from a database. Inside the datagrid there is a template column that holds another datagrid. How to get a... -
CF pulldowns
When I display a field from a database query in a form using CFForm and include a pulldown list on that field the pulldown options overwrite the... -
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column
i am trying to trap the value of one dropdownlist (in a datagrid edititemtemplate column) at the time its selectedindexchanged event fires and use... -
Linked Database Pulldowns
Hi Everyone, I have a problem, and it's causing me to tear my hair out... On allhvacinfo.com, they have pulldowns which are linked together...... -
Access to Rows in a datagrid
I am working on a page to allow editing of products in out database. I'd like to bind a datareader to the table. And on submit generate an update... -
Scott Mitchell [MVP] #2
Re: DataGrid Pulldowns- how to access
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:
[url]http://aspnet.4guysfromrolla.com/articles/080702-1.aspx[/url]
Also, you might want to consider taking a look at Andy Smith's free
BoundLookupColumn DataGridColumn control:
[url]http://metabuilders.com/Tools/BoundLookupColumn.aspx[/url]
hth
Ken Webster wrote:> 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 [ASP.NET MVP]
[email]mitchell@4GuysFromRolla.com[/email]
[url]http://www.4GuysFromRolla.com/ScottMitchell[/url]
Scott Mitchell [MVP] Guest



Reply With Quote

