Hi
I have a rad grid in my app and have custom paging enabled but when i try paging it doesnt seem to work my code is as follows
aspx
CS
I have a rad grid in my app and have custom paging enabled but when i try paging it doesnt seem to work my code is as follows
aspx
| <telerik:RadGrid ID="grdRepairs" runat="server" Skin="Simple" GridLines="None" OnItemCommand="grdRepairs_ItemCommand" | |
| OnSelectedIndexChanged="grdRepairs_SelectedIndexChanged" | |
| OnItemDataBound="RadGrid1_ItemDataBound" AllowSorting="True" AutoGenerateColumns="False" | |
| AllowPaging="True" AllowCustomPaging="true" VirtualItemCount="10000" onsortcommand="grdRepairs_SortCommand" PageSize="7" Height="250px"> | |
| <MasterTableView CellSpacing="-1" clientDataKeyNames="ORDERID, PROPREF"> | |
| <Columns> | |
| <telerik:GridBoundColumn DataField="ORDERID" DataType="System.Int32" HeaderText="ORDERID" ReadOnly="True" SortExpression="ORDERID" | |
| UniqueName="ORDERID"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="PROPREF" HeaderText="PROPREF" SortExpression="PROPREF" UniqueName="PROPREF"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="FAULTREPORTED" HeaderText="FAULTREPORTED" SortExpression="FAULTREPORTED" | |
| UniqueName="FAULTREPORTED" ItemStyle-Width="300px" HeaderStyle-Width="350px" ItemStyle-Wrap="false"> | |
| <HeaderStyle Width="350px" /> | |
| <ItemStyle Width="300px" Wrap="False" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="NEARCOMPLETEDATETIME" DataType="System.DateTime" HeaderText="NEARCOMPLETEDATETIME" | |
| SortExpression="NEARCOMPLETEDATETIME" UniqueName="NEARCOMPLETEDATETIME"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="STATUS" HeaderText="STATUS" | |
| SortExpression="STATUS" UniqueName="STATUS"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="CONTRACT" HeaderText="CONTRACT" SortExpression="CONTRACT" UniqueName="CONTRACT"> | |
| </telerik:GridBoundColumn> | |
| </Columns> | |
| </MasterTableView> | |
| <ClientSettings AllowRowsDragDrop="False" Resizing-AllowRowResize="false"> | |
| <DataBinding EnableCaching="True"> | |
| </DataBinding> | |
| <Selecting AllowRowSelect="True" /> | |
| <ClientEvents OnRowContextMenu="RowContextMenu" OnRowSelected="RowSelected" /> | |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" /> | |
| </ClientSettings> | |
| </telerik:RadGrid> |
CS
| protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) | |
| { | |
| if (e.Item is GridDataItem) | |
| { | |
| TimeSpan ts = new TimeSpan(1, 0, 0, 0); | |
| GridDataItem dataItem = (GridDataItem)e.Item; | |
| if (dataItem["NEARCOMPLETEDATETIME"].Text == string.Empty || dataItem["NEARCOMPLETEDATETIME"].Text == "" || dataItem["NEARCOMPLETEDATETIME"].Text == " ") | |
| { | |
| dataItem.BackColor = Color.White; | |
| } | |
| else | |
| { | |
| if (DateTime.Today > DateTime.Parse(dataItem["NEARCOMPLETEDATETIME"].Text)) | |
| { | |
| dataItem.BackColor = Color.Orange; | |
| } | |
| else if (DateTime.Today == DateTime.Parse(dataItem["NEARCOMPLETEDATETIME"].Text)) | |
| { | |
| dataItem.BackColor = Color.Red; | |
| } | |
| } | |
| } | |
| if (e.Item is GridPagerItem) | |
| { | |
| GridPagerItem pagerItem = (e.Item as GridPagerItem); | |
| pagerItem.PagerContentCell.Controls.Clear(); | |
| } | |
| } | |
| protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e) | |
| { | |
| txtTabName.Value = e.Tab.Text; | |
| var order = Pilot.Data.tbl_repair_order.LoadByStatus(Classes.Contexts.WEBSSCHEDULE_CONN(), RadComboBox1.SelectedValue, e.Tab.Text); | |
| grdRepairs.DataSource = order; | |
| grdRepairs.DataBind(); | |
| } | |
| } | |
| else | |
| { | |
| if (DateTime.Today > DateTime.Parse(dataItem["NEARCOMPLETEDATETIME"].Text)) | |
| { | |
| dataItem.BackColor = Color.Orange; | |
| } | |
| else if (DateTime.Today == DateTime.Parse(dataItem["NEARCOMPLETEDATETIME"].Text)) | |
| { | |
| dataItem.BackColor = Color.Red; | |
| } | |
| } | |
| } | |
| if (e.Item is GridPagerItem) | |
| { | |
| GridPagerItem pagerItem = (e.Item as GridPagerItem); | |
| pagerItem.PagerContentCell.Controls.Clear(); | |
| } | |
| } |