Automatic RadGrid data source operations in a RadPanelBar

2 posts, 1 answers
  1. Ryan C
    Ryan C avatar
    28 posts
    Member since:
    Aug 2009

    Posted 11 Mar 2010 Link to this post

    Automatic RadGrid data source operations doesn't seem to be working when grid is in a RadPanelBar. Do I need specify any specific variables?

    <telerik:RadPanelItem Value="companyNames" runat="server"
                                <ItemTemplate> 
                                    <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Windows7" AllowAutomaticDeletes="True" 
                                        AllowAutomaticInserts="True" PageSize="10" AllowAutomaticUpdates="True" AllowPaging="True" 
                                        AutoGenerateColumns="False" DataSourceID="datasource" DataKeyNames="id" OnItemUdated="radGrid_ItemUpdated" 
                                        OnItemDeleted="radGrid_ItemDeleted" OnItemInserted="radGrid_ItemInserted" OnDataBound="radGrid_DataBound"
                                        <PagerStyle Mode="NextPrevAndNumeric" /> 
                                        <MasterTableView DataSourceID="datasource" Width="100%" CommandItemDisplay="TopAndBottom" 
                                            DataKeyNames="id" HorizontalAlign="NotSet" AutoGenerateColumns="False" EditMode="InPlace"
                                            <Columns> 
                                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" /> 
                                                <telerik:GridBoundColumn DataField="id" Visible="false" HeaderText="id" UniqueName="id" 
                                                    DataType="System.Int32" /> 
                                                <telerik:GridBoundColumn UniqueName="companyName" DataField="companyName" HeaderText="companyName" 
                                                    ColumnEditorID="GridTextBoxColumnEditor1" /> 
                                                <telerik:GridNumericColumn UniqueName="percentage" DataField="percentage" HeaderText="Percentage" 
                                                    ColumnEditorID="GridNumericColumnEditor1" /> 
                                                <telerik:GridButtonColumn ConfirmText="Delete this entity?" ConfirmDialogType="RadWindow" 
                                                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                                                    UniqueName="DeleteColumn"
                                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                                </telerik:GridButtonColumn> 
                                            </Columns> 
                                        </MasterTableView> 
                                    </telerik:RadGrid> 
                                    <telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server" 
                                        DropDownStyle-Width="110px" /> 
                                    <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server" NumericTextBox-Width="40px" /> 
                                    
                                    <asp:SqlDataSource ID="datasource" runat="server" ConnectionString="<%$ ConnectionStrings:sqlReIns1 %>" 
                                        DeleteCommand="DELETE FROM myTable WHERE (id = @id)" OldValuesParameterFormatString="original_{0}" 
                                        InsertCommand="INSERT INTO myTable(companyName, percentage, parentID) VALUES (@companyName, @percentage, @parentID)" 
                                        SelectCommand="SELECT id, companyName, percentage FROM myTable where parentID=@parentID" 
                                        UpdateCommand="UPDATE myTable SET companyName = @companyName, percentage = @percentage WHERE (id = @id)"
                                        <SelectParameters> 
                                            <asp:SessionParameter DefaultValue="0" Name="parentID" SessionField="sessparentID" 
                                                Type="Int32" /> 
                                        </SelectParameters> 
                                        <DeleteParameters> 
                                            <asp:Parameter Name="id" Type="Int32" /> 
                                        </DeleteParameters> 
                                        <UpdateParameters> 
                                            <asp:Parameter Name="companyName" /> 
                                            <asp:Parameter Name="percentage" /> 
                                            <asp:Parameter Name="id" /> 
                                        </UpdateParameters> 
                                        <InsertParameters> 
                                            <asp:Parameter Name="companyName" Type="String" /> 
                                            <asp:Parameter Name="percentage" Type="Double" /> 
                                            <asp:SessionParameter DefaultValue="0" Name="parentID" SessionField="sessparentID" 
                                                Type="Int32" /> 
                                        </InsertParameters> 
                                    </asp:SqlDataSource> 
                                </ItemTemplate> 
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelItem> 

  2. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 16 Mar 2010 Link to this post

    Hello Ryan C,

    Try moving the SqlDataSource out of the panelbar item template (e.g. move it under the panelbar).


    Regards,
    Veskoni
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top