I am having a few issues and am trying to figure out how to overcome them. My first issue is a drop down in my edit form. I am setting the selected value equal to the value from my data source. However on insert their is not value so I do I handle the null situation?
Second In my entity data source control I have 2 other enitites I am including, once again though on insert, I receive errors when databinding my controls in the edit form template to any of the included entities. Again I am unsure how to get past this. I imagine the fix for my first problem will solve this one.
Finally I am unsure how to link the buttons in my edit form template to the proper events in the entity data source control for crud operations. Thanks!
Second In my entity data source control I have 2 other enitites I am including, once again though on insert, I receive errors when databinding my controls in the edit form template to any of the included entities. Again I am unsure how to get past this. I imagine the fix for my first problem will solve this one.
Finally I am unsure how to link the buttons in my edit form template to the proper events in the entity data source control for crud operations. Thanks!
| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <br /> |
| <asp:EntityDataSource ID="VendorRemittanceDataSource" runat="server" ConnectionString="name=RITSNetEntities" |
| DefaultContainerName="RITSNetEntities" EnableInsert="True" EnableUpdate="True" |
| EntitySetName="VendorRemittance" AutoGenerateWhereClause="True" Where="" EntityTypeFilter="VendorRemittance" |
| Include="Remittance, Vendors" EnableDelete="True"> |
| <WhereParameters> |
| <asp:QueryStringParameter DbType="Int32" Name="Vendors.CompanyEntityId" QueryStringField="1" /> |
| </WhereParameters> |
| </asp:EntityDataSource> |
| <asp:ObjectDataSource ID="CurrencyDataSource" runat="server" |
| SelectMethod="RetrieveLookupsByLookupTypeId" |
| TypeName="Graebel.RITS.Components.BusinessManagers.LookupManager"> |
| <SelectParameters> |
| <asp:Parameter DefaultValue="106" Name="lookupTypeId" Type="Int32" /> |
| </SelectParameters> |
| </asp:ObjectDataSource> |
| <telerik:RadGrid ID="RemittanceGrid" runat="server" AllowAutomaticInserts="True" |
| AllowAutomaticUpdates="True" AllowSorting="True" AutoGenerateColumns="False" |
| GridLines="None" Skin="Telerik" ShowStatusBar="True" DataSourceID="VendorRemittanceDataSource" |
| OnItemCommand="RemittanceGrid_ItemCommand" AutoGenerateEditColumn="True"> |
| <PagerStyle Mode="NumericPages" AlwaysVisible="True" /> |
| <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="VendorRemittanceId" |
| DataSourceID="VendorRemittanceDataSource"> |
| <Columns> |
| <telerik:GridBoundColumn UniqueName="RemittanceId" Visible="False" DataField="Remittance.RemittanceId"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Bank Name" UniqueName="BankName" DataField="Remittance.BankName"> |
| <HeaderStyle HorizontalAlign="Center" /> |
| <ItemStyle HorizontalAlign="Center" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Account #" UniqueName="Account" DataField="Remittance.AccountNumber"> |
| <HeaderStyle HorizontalAlign="Center" /> |
| <ItemStyle HorizontalAlign="Center" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Currency" UniqueName="Currency" DataField="Lookups.Text.Description"> |
| <HeaderStyle HorizontalAlign="Center" /> |
| <ItemStyle HorizontalAlign="Center" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Sequence" UniqueName="Sequence" DataField="SequenceNum"> |
| <HeaderStyle HorizontalAlign="Center" /> |
| <ItemStyle HorizontalAlign="Center" /> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings EditFormType="Template"> |
| <FormTemplate> |
| <table style="width: 100%;"> |
| <tr> |
| <td> |
| Currency: |
| </td> |
| <td> |
| <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="CurrencyDataSource" |
| DataTextField="Description" DataValueField="LookupId" SelectedValue='<%# Bind("Lookups.LookupId") %> '> |
| <asp:ListItem Text="Select" Value=null></asp:ListItem> |
| </asp:DropDownList> |
| </td> |
| <td> |
| Non-Currency Specific Vendor: |
| </td> |
| <td> |
| <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsGlobalCurrency") %> ' /> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Bank Sequence: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind( "SequenceNum") %> '></asp:TextBox> |
| </td> |
| <td> |
| Account #: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind( "Remittance.AccountNumber") %> '></asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Payable Name: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind( "Remittance.PayableName") %> '></asp:TextBox> |
| </td> |
| <td> |
| ABA Transit Route #: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind( "Remittance.ABATransitRoutingNumber") %> '></asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Swift Code: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind( "Remittance.SWIFTCode") %> '></asp:TextBox> |
| </td> |
| <td> |
| ISO Package Received: |
| </td> |
| <td> |
| <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind( "Remittance.HasISOPackage") %> ' /> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Bank Name: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind( "Remittance.BankName") %> '></asp:TextBox> |
| </td> |
| <td> |
| Bank Address: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind( "Remittance.Addresses.Address1") %> '></asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| |
| </td> |
| <td> |
| |
| </td> |
| <td> |
| |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind( "Remittance.Addresses.Address2") %> '></asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| City: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind( "Remittance.Addresses.City") %> '></asp:TextBox> |
| </td> |
| <td> |
| |
| </td> |
| <td> |
| <uc1:StateCountryFields ID="m_stateCountryFields" runat="server" /> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Zip: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind( "Remittance.Addresses.Zip") %> '></asp:TextBox> |
| </td> |
| <td> |
| |
| </td> |
| <td> |
| |
| </td> |
| </tr> |
| <tr> |
| <td align="right" colspan="2"> |
| <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
| runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'> |
| </asp:Button> |
| </td> |
| <td> |
| <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" |
| CommandName="Cancel"></asp:Button> |
| </td> |
| <td> |
| |
| </td> |
| <td> |
| |
| </td> |
| </tr> |
| </table> |
| </FormTemplate> |
| </EditFormSettings> |
| </MasterTableView> |
| </telerik:RadGrid> |