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

New DataSource For Popup Edit From

1 Answer 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 28 Jan 2009, 10:33 PM
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.
<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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 29 Jan 2009, 08:07 AM
Hi Shawn,

I would suggest you to Implement window editing in Grid instead of using FormTemplate. You can refer this KB article for more details on this regard.
Using RadWindow for editing/inserting RadGrid records

Here the editing is done through a RadWindow loaded with another aspx page containing a DetailsView bound to a DataSource with desired fields. You can alter the logic accordingly.

Shinu
Tags
Grid
Asked by
Shawn
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or