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

Radgrid SelectedItem always 0

9 Answers 187 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Leon
Top achievements
Rank 1
Leon asked on 18 Apr 2008, 03:21 AM

Hi, I have upgraded from Q3 promothues to Q1 2008 Ajax
same code, but doesn't work anymore
here is the aspx

<telerik:RadGrid ID="AListingsGrid" runat="server"   
          AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True"   
          AutoGenerateColumns="False" GridLines="None" Height="515px" PageSize="300"   
          Skin="Vista">  
<MasterTableView> 
<RowIndicatorColumn Visible="False">  
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn Visible="False" Resizable="False">  
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
 
    <Columns> 
        <telerik:GridBoundColumn DataField="Href_No" HeaderText="Ref"   
            UniqueName="column">  
        </telerik:GridBoundColumn> 
    </Columns> 
 
<EditFormSettings> 
<PopUpSettings ScrollBars="None"></PopUpSettings> 
</EditFormSettings> 
</MasterTableView> 
          <ClientSettings> 
              <Selecting AllowRowSelect="True" /> 
              <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
          </ClientSettings> 
      </telerik:RadGrid> 
<telerik:RadAjaxLoadingPanel ID="PnlLoading" Runat="server"   
        height="75px" width="75px">  
        <img alt="Loading..."   
            src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'   
            style="border:0px;" /> 
      </telerik:RadAjaxLoadingPanel> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
    <AjaxSettings> 
     <telerik:AjaxSetting AjaxControlID = "AListingsGrid">  
      <UpdatedControls> 
       <telerik:AjaxUpdatedControl ControlID ="AListingsGrid" LoadingPanelID="PnlLoading" /> 
      </UpdatedControls> 
     </telerik:AjaxSetting>       
     <telerik:AjaxSetting AjaxControlID = "btnFilter">  
      <UpdatedControls> 
       <telerik:AjaxUpdatedControl ControlID ="AListingsGrid" LoadingPanelID="PnlLoading" /> 
      </UpdatedControls> 
     </telerik:AjaxSetting>       
    </AjaxSettings> 
    </telerik:RadAjaxManager> 


after some data pouplated, and select some rows and call

Debug.Print(AListingsGrid.SelectedItems.Count)
the AListingsGrid.SelectedItems.Count is always 0

what's wrong?

9 Answers, 1 is accepted

Sort by
0
Leon
Top achievements
Rank 1
answered on 18 Apr 2008, 03:51 AM
Sorry, suddenly it works again....
i have no idea what's going on out there
:(
0
Doug Beard
Top achievements
Rank 2
answered on 19 Jun 2008, 01:41 PM
I'm having this problem.  No matter what I do, the grid.selecteditems.count = 0

0
t
Top achievements
Rank 1
answered on 07 Jul 2008, 10:23 AM
I have the same problem after updating to the new version.

Which changes have to be made to get this working again?
0
Sebastian
Telerik team
answered on 07 Jul 2008, 10:26 AM
Hello guys,

Do you use advanced binding through the NeedDataSource event or data source control as shown in these demos:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/NeedDataSource/DefaultCS.aspx
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/DataEditing/AllEditableColumns/DefaultCS.aspx

This should ensure that the SelectedItems collection will reflect the client/server selection made by the end user. Also verify that the viewstate for the grid is enabled.

Regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
t
Top achievements
Rank 1
answered on 07 Jul 2008, 10:32 AM
I use the NeedDataSource Event and Viewstate ist also enabled.

But it still doesn't work.

SelectedItems are always 0
0
Sebastian
Telerik team
answered on 07 Jul 2008, 10:44 AM
Hi t,

Can you isoalate a stripped working version of your project, illustrating the issue, and send it attached to a formal support ticket? I will test it locally and will advice you further.

Regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Marco
Top achievements
Rank 1
answered on 10 Mar 2011, 05:36 PM
Was there a solution found for this?  I have the same problem.
0
asimptota
Top achievements
Rank 1
answered on 30 Apr 2011, 02:20 PM
I have the same problem. But the funny thing is that I;ve made sample project to try to isolate problem and it works as it should even though the markup and code are same :D funny
Any help?
0
Minh
Top achievements
Rank 1
answered on 31 Aug 2015, 06:45 AM

I came across this issue while working on custom widget template in Sitefinity.

It turn out that the custom page, which I created and added the template in, had ViewState set to false. So even the Grid has ViewState set to true, it did not work.

Tags
Grid
Asked by
Leon
Top achievements
Rank 1
Answers by
Leon
Top achievements
Rank 1
Doug Beard
Top achievements
Rank 2
t
Top achievements
Rank 1
Sebastian
Telerik team
Marco
Top achievements
Rank 1
asimptota
Top achievements
Rank 1
Minh
Top achievements
Rank 1
Share this question
or