This is a migrated thread and some comments may be shown as answers.

my dropdownlist is not working into the formtemplate

0 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 2
Robert asked on 07 Feb 2012, 10:36 PM
hi everybody, i am trying to reproduce this scenario http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/popupeditform/defaultcs.aspx its working but i have a problem i have a DropDownList that i populate with a different datasource and when i want to add a register or update give an error this is a llittle of my code
<grid..........................
.....
.
.
.
<EditFormSettings  CaptionFormatString="Editar Proveedor: {0}" CaptionDataField="COD_PROVEE" EditFormType="Template" EditColumn-EditText="Editar" EditColumn-UpdateText="Modificar" PopUpSettings-Width="780px" PopUpSettings-Height="300px" PopUpSettings-Modal="True" PopUpSettings-ZIndex="2000">
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
     <FormTemplate>
<label>CUENTA:</label>
                                      
                                <asp:DropDownList ID="DropDownList5" runat="server" AppendDataBoundItems="true" DataSourceID="SqlDataSource2" SelectedValue='<%# Bind("cuenta") %>'
                    DataTextField="cuenta" DataValueField="cuenta">
                                </asp:DropDownList>
                    
                                </div>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
                        ConnectionString="<%$ ConnectionStrings:SICI2.0ConnectionString %>"
                        SelectCommand="SELECT * FROM [TBL_PROVEEDOR]"
                        
                        UpdateCommand="UPDATE TBL_PROVEEDOR SET NOMPROVEE = @NOMPROVEE, CONTACTO = @contacto, TELPROVEE = @TELPROVEE, DIRPROVEE = @DIRPROVEE, DIASCREDITO = @DIASCREDITO, CODIGO = @codigo, tipocontribuyente = @tipocontribuyente, nit = @nit, pais = @pais, cuenta = @cuenta, tipo_sociedad = @tipo_sociedad, montocredito = @montocredito WHERE (COD_PROVEE =@COD_PROVEE)"
                        InsertCommand="INSERT INTO TBL_PROVEEDOR(NOMPROVEE, CONTACTO,TELPROVEE,DIRPROVEE,DIASCREDITO, CODIGO, tipocontribuyente,nit,pais,cuentas,tipo_sociedad,montocredito) VALUES (@NOMPROVEE,@contacto ,@TELPROVEE,@DIRPROVEE,@DIASCREDITO,@codigo, @tipocontribuyente, @nit,@pais,@cuenta,@tipo_sociedad,@montocredito)">
                        <UpdateParameters>
                            <asp:Parameter Name="NOMPROVEE" Type="String" />
                            <asp:Parameter Name="contacto" Type="String"/>
                            <asp:Parameter Name="TELPROVEE" Type="String"/>
                            <asp:Parameter Name="DIRPROVEE" Type="String" />
                            <asp:Parameter Name="DIASCREDITO" Type="Int32"/>
                            <asp:Parameter Name="codigo" Type="String" />
                            <asp:Parameter Name="tipocontribuyente" Type="String" />
                            <asp:Parameter Name="nit" Type="String" />
                            <asp:Parameter Name="pais" Type="String" />
                            <asp:Parameter Name="cuenta" Type="String"/>
                            <asp:Parameter Name="tipo_sociedad" Type="String" />
                            <asp:Parameter Name="montocredito" Type="Decimal" />
                            <asp:Parameter Name="COD_PROVEE" Type="Int32" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="NOMPROVEE" />
                            <asp:Parameter Name="contacto" />
                            <asp:Parameter Name="TELPROVEE" />
                            <asp:Parameter Name="DIRPROVEE" />
                            <asp:Parameter Name="DIASCREDITO" />
                            <asp:Parameter Name="codigo" />
                            <asp:Parameter Name="tipocontribuyente" />
                            <asp:Parameter Name="nit" />
                            <asp:Parameter Name="pais" />
                            <asp:Parameter Name="cuenta" />
                            <asp:Parameter Name="tipo_sociedad" />
                            <asp:Parameter Name="montocredito" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConnectionString="<%$ ConnectionStrings:CONTASConnectionString %>"
        SelectCommand="SELECT [ncuenta], [cuenta] FROM [tbl_c_cuenta]">
    </asp:SqlDataSource>
thank u for ur help

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Robert
Top achievements
Rank 2
Share this question
or