Hi,
I am using RadGrid within a usercontrol sitting inside a SharePoint webpart. All my other functionalitites are working fine, but I am having issues when once I scroll through couple of pages in the grid and then try to hit filter button I get an error 'null' is null or not an object. Below is my RadGrid within a user control, any help will be greatly appreciated as I don't want to give a buggy UI to my clients:
I am using RadGrid within a usercontrol sitting inside a SharePoint webpart. All my other functionalitites are working fine, but I am having issues when once I scroll through couple of pages in the grid and then try to hit filter button I get an error 'null' is null or not an object. Below is my RadGrid within a user control, any help will be greatly appreciated as I don't want to give a buggy UI to my clients:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function GetSelectedItems() { alert($find("<%= grdAllContacts.MasterTableView.ClientID %>").get_selectedItems().length); } </script> </telerik:RadCodeBlock> <br /> <!-- content start --> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="grdAllContacts" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="grdAllContacts"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="grdAllContacts" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <asp:Button ID="Button2" CssClass="button" Text="Get Selected Items Count" OnClientClick="GetSelectedItems(); return false;" runat="server" /> <br /> <telerik:RadGrid ID="grdAllContacts" Width="97%" AllowPaging="True" PageSize="20" runat="server" ShowGroupPanel="false" OnNeedDataSource="grdAllContacts_NeedDataSource" GridLines="None" AutoGenerateColumns="false" AllowMultiRowSelection="true"> <PagerStyle Mode="NextPrev" /> <GroupHeaderItemStyle BorderColor="Black" Font-Bold="true"></GroupHeaderItemStyle> <MasterTableView Width="100%" GroupLoadMode="Server" TableLayout="Fixed" AllowPaging="True" PageSize="20" AllowFilteringByColumn="true"> <GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldAlias="FamilyName" FieldName="FamilyName"></telerik:GridGroupByField> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="FamilyName"></telerik:GridGroupByField> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions> <Columns> <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" /> <telerik:GridBoundColumn SortExpression="FamilyName" HeaderText="Family Name" HeaderButtonType="TextButton" DataField="FamilyName" HeaderStyle-HorizontalAlign="Center" Visible="false" AutoPostBackOnFilter="true"> <HeaderStyle Width="15%" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="Context" HeaderText="Contact Type" HeaderButtonType="TextButton" DataField="Context"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="OrganisationName" HeaderText="Organisation Name" HeaderButtonType="TextButton" DataField="OrganisationName" > <HeaderStyle Width="32%" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="RoleTitle" HeaderText="Role Title" HeaderButtonType="TextButton" DataField="RoleTitle" > </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="Phone" HeaderText="Phone" HeaderButtonType="TextButton" DataField="Phone" > </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="Mobile" HeaderText="Mobile" HeaderButtonType="TextButton" DataField="Mobile"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="Fax" HeaderText="Fax" AutoPostBackOnFilter="true" HeaderButtonType="TextButton" DataField="Fax"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton" DataField="ID" Visible="false"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="false" AllowDragToGroup="false" AllowColumnsReorder="false" EnableRowHoverStyle="false"> <Selecting AllowRowSelect="True" /> </ClientSettings> </telerik:RadGrid>