I have a grid that queries about 10 columns from a few different SQL tables using joins, however when a user clicks edit or insert I want to launch a new popup template which will contain all of the columns from the tables. I have always queried all of the columns I wanted to edit and then just hide the ones I don't want in the grid, but to maintain performance (querying over 100 columns and 10,000 records) I want a way to be able to initiate a new datasource when in Edit or Insert mode.
Is there a way to do that?
| <EditFormSettings CaptionFormatString="Edit Application Record: {0}" |
| CaptionDataField="advertisor_site" EditFormType="Template"> |
| <EditColumn UniqueName="EditCommandColumn1"></EditColumn> |
| <FormTemplate> |
| <asp:Label ID="GridRecEdit" runat="server" Visible="false" |
| Text='<%# Eval("record") %>' /> |
| <asp:SqlDataSource ID="sqlds_AppEditor" runat="server" |
| ConnectionString="<%$ ConnectionStrings:Company_Master_ConnectionString %>" |
| SelectCommand="sp_Select_Admin_Application_Details" |
| SelectCommandType="StoredProcedure"> |
| <SelectParameters> |
| <asp:ControlParameter ControlID="GridRecEdit" PropertyName="Text" Type="Int32" Name="Record" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |
| <table> |
| ALL OF MY ROWS & COLUMNS HERE |
| ... |
| <tr> |
| <td> |
| Name:</td> |
| <td> |
| <asp:TextBox ID="last_name" runat="server" Text='<%# Bind("last_name") %>' |
| CssClass="FormBox" MaxLength="40"/> |
| , |
| <asp:TextBox ID="first_name" runat="server" |
| Text='<%# Bind("first_name") %>' CssClass="FormBox" MaxLength="30"/> |
| </td></tr> |
| ... |
| </table> |
| </FormTemplate> |
| <PopUpSettings ScrollBars="None" Width="85%"></PopUpSettings> |
| </EditFormSettings> |
Is there a way to do that?