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

[Solved] Grid Server Side Row Selection

3 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matei Mihai
Top achievements
Rank 1
Matei Mihai asked on 10 Nov 2009, 09:03 AM
Hi there,

I would appreciate if anyone could help me. For the life of me i cannot understand why i can't select a row. I went through the demo for the Server-side Row Selection and did everything according to the example, and it still won't work. For some reason the grid makes a full PostBack when i select a row, then it reloads and looses it's state (and the row i selected).
I have a simple MasterPage/WebContentForm setup. Below is a code snippet of my MasterPage:
    <form id="frmMaster" runat="server"
    <telerik:RadScriptManager ID="RadScriptManagerMaster" runat="server"
    </telerik:RadScriptManager> 
    <asp:LoginView runat="server" ID="lvLoadingPanelView"
        <LoggedInTemplate> 
            <telerik:RadAjaxLoadingPanel ID="ralpMain" runat="server" Skin="Sunset"
            </telerik:RadAjaxLoadingPanel> 
        </LoggedInTemplate> 
    </asp:LoginView> 
    <telerik:RadAjaxPanel ID="rapMain" runat="server" HorizontalAlign="NotSet" LoadingPanelID="ralpMain"
        <center> 
            <table id="Table_01" width="899" border="0" cellpadding="0" cellspacing="0" class="mainBackgroundImage"
                <tr> 
                    <td> 
                        <img runat="server" id="SAICA_CMS_02" src="~/images/SAICA-CMS_02.jpg" width="899" 
                            height="100" alt="" /> 
                    </td> 
                </tr> 
                <tr> 
                    <td> 
                        <asp:LoginView runat="server" ID="lvTopLoginViewMasterPage"
                            <LoggedInTemplate> 
                                <center> 
                                    <table width="100%"
                                        <tr align="center"
                                            <td style="font-size: large;"
                                                <asp:SiteMapPath ID="smpMaster" runat="server" Font-Names="Verdana" Font-Size="0.8em" 
                                                    PathSeparator=" > "
                                                    <PathSeparatorStyle Font-Bold="True" ForeColor="#1C5E55" /> 
                                                    <CurrentNodeStyle ForeColor="#333333" /> 
                                                    <NodeStyle Font-Bold="True" ForeColor="#666666" /> 
                                                    <RootNodeStyle Font-Bold="True" ForeColor="#1C5E55" /> 
                                                </asp:SiteMapPath> 
                                            </td> 
                                        </tr> 
                                    </table> 
                                </center> 
                            </LoggedInTemplate> 
                        </asp:LoginView> 
                    </td> 
                </tr> 
                <tr> 
                    <td style="height:450px;" valign="top"
                        <br /> 
                        <asp:ContentPlaceHolder ID="ContentPlaceHolderMain" runat="server"
                        </asp:ContentPlaceHolder> 
                    </td> 
                </tr> 
                <tr> 
                    <td style="background-image: url('Images/SAICA-CMS_05.jpg'); width: 899px; height: 50px;"
                        <table style="width: 100%;"
                            <tr align="center"
                                <td> 
                                    <asp:LoginView ID="BottomLoginViewMasterPage" runat="server"
                                        <LoggedInTemplate> 
                                            <asp:LoginStatus ID="LoginStatus1" runat="server" /> 
                                        </LoggedInTemplate> 
                                    </asp:LoginView> 
                                </td> 
                            </tr> 
                        </table> 
                    </td> 
                </tr> 
            </table> 
        </center> 
    </telerik:RadAjaxPanel> 
    </form> 
 

You can see the page that loads in the ContentPlaceHolder in the code snippet below (i'm only including the top part to keep it nice and short):
<asp:Content ID="ContentTraineeDetail" ContentPlaceHolderID="ContentPlaceHolderMain" 
    runat="server"
    <telerik:RadAjaxManager ID="ramTraineeDetail" runat="server" EnableAJAX="true"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="rgTraineeContracts"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rgTraineeContracts" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <div> 
        <center> 
            <table> 
                <tr> 
                    <td style="text-align: left;"
                        <asp:Label runat="server" ID="lblTraineeDetailHeading" Text="Contracts" Font-Bold="true"></asp:Label> 
                    </td> 
                </tr> 
                <tr> 
                    <td> 
                        <telerik:RadGrid ID="rgTraineeContracts" runat="server" AutoGenerateColumns="False" 
                            DataSourceID="odsTraineeContracts" GridLines="None" AllowMultiRowSelection="true"
                            <MasterTableView DataKeyNames="opportunitykey"
                                <Columns> 
                                    <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description"
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status" 
                                        ReadOnly="True" SortExpression="Status"
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="ContractStartDate" HeaderText="Start Date" UniqueName="ContractStartDate"
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="ContractEndDate" HeaderText="EndD ate" UniqueName="ContractEndDate"
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="OriginalContractEndDate" HeaderText="Original End Date" UniqueName="OriginalContractEndDate"
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="ContractTerm" HeaderText="Term" UniqueName="ContractTerm"
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="TrainingOffice" HeaderText="Training Office" SortExpression="TrainingOffice"
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridButtonColumn CommandName="Select" Text="Select"
                                    </telerik:GridButtonColumn> 
                                </Columns> 
                                <NoRecordsTemplate> 
                                    <center> 
                                        <asp:Label runat="server" ID="lblNoContractRecords" Text="There are no contracts associated with this trainee."></asp:Label> 
                                    </center> 
                                </NoRecordsTemplate> 
                            </MasterTableView> 
                            <ClientSettings EnableRowHoverStyle="true"
                            </ClientSettings> 
                        </telerik:RadGrid> 
                        <asp:ObjectDataSource ID="odsTraineeContracts" runat="server" SelectMethod="ViewTraineeContracts" 
                            TypeName="CMS.MiddleTier.BLL.Entities.CMSUser"
                            <SelectParameters> 
                                <asp:SessionParameter Name="TraineeAccountant" SessionField="CurrentTrainee" Type="Object" /> 
                            </SelectParameters> 
                        </asp:ObjectDataSource> 
                    </td> 
                </tr> 
            </table> 

Below that table i have a RadPanelBar and bunch of asp controls, nothing that would interfere at all with the grid.
I am using Q2 2009.
Can anyone spot something i haven't?

Kind regards,
Matei

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 11 Nov 2009, 02:18 PM
Hi Matei,

Can you verify if the page ViewState is enabled in your case?

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Matei Mihai
Top achievements
Rank 1
answered on 11 Nov 2009, 02:35 PM
Hi Vlad,

Thank you for the feedback.
The EnableViewState property is not set explicitly anywhere in the system (pages or controls), but i assume that by default it's value is true.

Regards,
Matei
0
Accepted
Vlad
Telerik team
answered on 12 Nov 2009, 08:15 AM
Hello Matei,

Please send us an example (via support ticket) where we can reproduce and debug this.

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Matei Mihai
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Matei Mihai
Top achievements
Rank 1
Share this question
or