F
Fernando A. Gómez F.
Hello all.
I'm building a WebControl. In it's CreateChildControls, I'm creating a
DataSource and a DetailsView controls and set de DV's DataSourceID to
the control I just created.
Now, I'm not sure how to add the template fields and then bind them. I
mean, I'm lookin the translation from this:
<aspetailsView ID="CatalogDetailView" runat="server" ...etc... >
<Fields>
<asp:TemplateField HeaderText="Aplicación *"
HeaderStyle-HorizontalAlign="Left"
ItemStyle-HorizontalAlign="left" >
<InsertItemTemplate>
<aspropDownList ID="ddlAplicacion" runat="server"
Width="205px" DataSourceID="AplicacionCatDataSource"
DataValueField="ClaveAplicacion"
DataTextField="NombreAplicacion"
SelectedValue='<%# Bind("IdAplicacion") %>' <------here
AutoPostBack="true" />
</InsertItemTemplate>
<EditItemTemplate >
...etc...
</EditItemTemplate>
</asp:TemplateField>
</Fields>
</aspetailsView>
Into C# code. I mean, in the ASP.NET page I just use the <%# Bind(...)
%> tag and be done with it. How do I translate that into C# code? How
can I bind the control?
Any help will be appreciated. Thanks in advance
Regards,
Fernando.
I'm building a WebControl. In it's CreateChildControls, I'm creating a
DataSource and a DetailsView controls and set de DV's DataSourceID to
the control I just created.
Now, I'm not sure how to add the template fields and then bind them. I
mean, I'm lookin the translation from this:
<aspetailsView ID="CatalogDetailView" runat="server" ...etc... >
<Fields>
<asp:TemplateField HeaderText="Aplicación *"
HeaderStyle-HorizontalAlign="Left"
ItemStyle-HorizontalAlign="left" >
<InsertItemTemplate>
<aspropDownList ID="ddlAplicacion" runat="server"
Width="205px" DataSourceID="AplicacionCatDataSource"
DataValueField="ClaveAplicacion"
DataTextField="NombreAplicacion"
SelectedValue='<%# Bind("IdAplicacion") %>' <------here
AutoPostBack="true" />
</InsertItemTemplate>
<EditItemTemplate >
...etc...
</EditItemTemplate>
</asp:TemplateField>
</Fields>
</aspetailsView>
Into C# code. I mean, in the ASP.NET page I just use the <%# Bind(...)
%> tag and be done with it. How do I translate that into C# code? How
can I bind the control?
Any help will be appreciated. Thanks in advance
Regards,
Fernando.