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

Automatic RadGrid data source operations in a RadPanelBar

1 Answer 80 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ryan C
Top achievements
Rank 1
Ryan C asked on 11 Mar 2010, 04:55 PM
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> 

1 Answer, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 16 Mar 2010, 10:40 AM
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.
Tags
PanelBar
Asked by
Ryan C
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or