RadGrid1.ExportSettings.IgnorePaging = true; (or false)RadGrid1.ExportSettings.OpenInNewWindow = false;RadGrid1.ExportSettings.ExportOnlyData = true;private void CreateMenuByUser() { RadMenu1.Visible = true; DataTable table = GetDataTable("SELECT * FROM UserRights INNER JOIN Users ON UserRights.UserID = Users.UserID WHERE Users.UserID = '" + Session["UserID"] + "'"); //RadMenuItemCollection menuItems = RadMenu1.Items; RadMenuItem disabledItems = new RadMenuItem(); foreach (DataRow item in table.Rows) { if (bool.Parse(item["rRead"].ToString()) == false) { foreach (RadMenuItem menuItem in RadMenu1.Items)-->>>this line cause the error Index was out of the range error { if (menuItem.Value == item["MenuID"].ToString()) disabledItems = menuItem; if (menuItem.Items.Count > 0) GetAllChildItems(menuItem, item["MenuID"].ToString()); } RadMenu1.Items.Remove(disabledItems); } } }
{ RadMenuItemCollection menuItems = itemsList.Items; RadMenuItem disabledItems = new RadMenuItem(); foreach (RadMenuItem menuItem in itemsList.Items) { if (menuItem.Value == MenuId) disabledItems = menuItem; } menuItems.Remove(disabledItems); }<style type="text/css"> .CustomItem { z-index:99999; } .rootItem { text-align:center !important; text-decoration:none !important; z-index:-1; } .CustomItem:hover { text-decoration:none !important; }</style><div id="section" runat="server" ><telerik:RadMenu ID="FolderMenu" runat="server"></telerik:RadMenu>
<
Rad:RadGrid Width="100%" Height="100%" EnableAJAX="true" ID="grdDispatchedStaff" style="border:0;" runat="server" AllowPaging="False" AllowSorting="True"
AllowMultiRowSelection="false" AutoGenerateColumns="false"
OnNeedDataSource ="GridDispatchedStaffNeedDataSource" >
<MasterTableView DataKeyNames="DispatchAssignmentGUID" ClientDataKeyNames="DispatchAssignmentGUID" AllowNaturalSort="false" TableLayout="Fixed" >
<HeaderStyle Height="18px" Font-Names="Tahoma" Font-Size="7pt" Font-Bold="true"/>
<ItemStyle CssClass="RowModified" />
<AlternatingItemStyle CssClass="RowModified" />
<Columns>
<Rad:GridBoundColumn UniqueName="DispatchAssignmentGUID" SortExpression="DispatchAssignmentGUID" HeaderText="DispatchAssignmentGUID" DataField="DispatchAssignmentGUID" Visible="false" />
<Rad:GridBoundColumn UniqueName="FullName" SortExpression="FullName" HeaderStyle-Width="8%" HeaderText="Name" DataField="FullName" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="RadioID" SortExpression="RadioID" HeaderStyle-Width="8%" HeaderText="Radio ID" DataField="RadioID" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="CallSign" SortExpression="CallSign" HeaderStyle-Width="8%" HeaderText="Call Sign" DataField="CallSign" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="ReferenceID" SortExpression="ReferenceID" HeaderStyle-Width="8%" HeaderText="Ref. ID" DataField="ReferenceID" DataFormatString="{0:d}"/>
<Rad:GridBoundColumn UniqueName="DispatchRole" SortExpression="DispatchRole" HeaderStyle-Width="7%" HeaderText="Role" DataField="DispatchRole" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="DispatchTime" SortExpression="DispatchTime" HeaderStyle-Width="11%" HeaderText="Dispatch Time" DataField="DispatchTime" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="ETA" SortExpression="ETA" HeaderStyle-Width="11%" HeaderText="ETA" DataField="ETA" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="ArrivalTime" SortExpression="ArrivalTime" HeaderStyle-Width="11%" HeaderText="Arrival Time" DataField="ArrivalTime" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="ArrivalCode" SortExpression="ArrivalCode" HeaderStyle-Width="9%" HeaderText="Arrival Code" DataField="ArrivalCode" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="ClearTime" SortExpression="ClearTime" HeaderStyle-Width="11%" HeaderText="Clear Time" DataField="ClearTime" DataFormatString="<nobr>{0} </nobr>"/>
<Rad:GridBoundColumn UniqueName="ClearCode" SortExpression="ClearCode" HeaderStyle-Width="8%" HeaderText="Clear Code" DataField="ClearCode" DataFormatString="<nobr>{0} </nobr>"/>
</Columns>
</MasterTableView>
<ClientSettings AllowDragToGroup="False">
<Resizing AllowColumnResize="True" EnableRealTimeResize="true" AllowResizeToFit="true"></Resizing>
<Selecting AllowRowSelect="true" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="100%"></Scrolling>
<ClientEvents OnRowContextMenu="RowContextMenu" OnRowDblClick="GridDblClick" OnRowClick="GridRowClick"></ClientEvents>
</ClientSettings>
</
Rad:RadGrid>
protected void GridDispatchedStaffNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
this.LoadGrid();
}
private void LoadGrid()
{
this.grdDispatchedStaff.DataSource = this.DataSource.DispatchAssignment;
}
_filterbox.EnableLoadOnDemand = true; _filterbox.AutoPostBack = true;