Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

FindControl() Details View --> Template Field --> DropDownList problem

[es] :: .NET :: FindControl() Details View --> Template Field --> DropDownList problem

[ Pregleda: 2896 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

VerbatimBOT
Aleksandar Dragosavac
Senior .NET Developer

Član broj: 84129
Poruke: 228
217.24.18.*



Profil

icon FindControl() Details View --> Template Field --> DropDownList problem24.01.2007. u 15:07 - pre 209 meseci
Code:

<asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="SqlDataSource_registerDetails"
                Height="50px" Width="198px" AutoGenerateRows="False" DataKeyNames="uID">
                <RowStyle Width="450px" />
                <FieldHeaderStyle Width="200px" Font-Bold="False" HorizontalAlign="Left" Wrap="True" />
                <HeaderStyle HorizontalAlign="Left" Width="200px" />
                <Fields>
                        <asp:TemplateField HeaderText="Pol">
                        <ItemTemplate>
                            <asp:Label ID="lblSex" runat="server" Text='<%# Eval("sex") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddlSex" runat="server">
                                <asp:ListItem Value="0" Text="ženski" />
                                <asp:ListItem Value="1" Text="muški" />
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
</Fields>
            </asp:DetailsView>


Code:

If (DetailsView1.CurrentMode = DetailsViewMode.Edit) Then
Dim ddlSex As DropDownList = CType(DetailsView1.FindControl("ddlSex"), DropDownList)
Dim x = ddlSex.Items.Count
        End If

Jel ima neko ideju zašto ovo ne radi?
ddlSex javlja da je NOTHING!
Pozdrav!
Winners never quit, quitters never win.
 
Odgovor na temu

gracija68

Član broj: 49646
Poruke: 4
*.adsl.net.t-com.hr.



Profil

icon Re: FindControl() Details View --> Template Field --> DropDownList problem25.01.2007. u 08:13 - pre 209 meseci
Ne bi li ovaj dio:
Dim x = ddlSex.Items.Count

trebao izgledati ovako:
Dim x As Integer = ddlSex.Items.Count
 
Odgovor na temu

VerbatimBOT
Aleksandar Dragosavac
Senior .NET Developer

Član broj: 84129
Poruke: 228
217.24.18.*



Profil

icon Re: FindControl() Details View --> Template Field --> DropDownList problem25.01.2007. u 14:31 - pre 209 meseci
Nema to veze, u VB-u se ne mora eksplicitno navesti tip promenljive.
Winners never quit, quitters never win.
 
Odgovor na temu

[es] :: .NET :: FindControl() Details View --> Template Field --> DropDownList problem

[ Pregleda: 2896 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.