I am using the grid to display data with paging. As shown in the demo, I am trying to implement both numeric and Next/Previous buttons pager.
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/paging/defaultcs.aspx
However, I am facing the following issue:
If my datasource has 55 records and the page size is 20 (default). I get 3 pages and clicking on 1, 2 and 3 (page numbers) loads the correct records on the page.
However, if I change the default page size to say 10. I see 6 pages and the data on the first page (10 records) is fine, but as soon as I change the page number (by clicking on the numbers) to go to the next page (say 2), the page size is reset to 20 and I am back to seeing 3 pages.
What am I missing?
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" EnableViewState="true" AutoGenerateColumns="False" PageSize="20" AllowMultiRowSelection="false" OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="RadGrid1_NeedDataSource" PagerStyle-AlwaysVisible="true">Hi guys I'm working with RadListView as the main menu of my application, and I'm facing the next problem.
As you can see, I have two legends(one commented), my question is how can I change the legend dynamically
based on an integer parameter loaded on page_load event.
<telerik:RadListView Width="600px" ID="RadListView1" runat="server" ItemPlaceholderID="ProductsHolder" onselectedindexchanged="RadListView1_SelectedIndexChanged" onneeddatasource="RadListView1_NeedDataSource1" PageSize="2 " AllowPaging="true" DataKeyNames="fiIdReforma" Skin="Black" > <LayoutTemplate> <table> <tr> <td> <h3 style="color: #FFFFFF; font-weight: bold;" >DASHBOARDS</h3> </td></tr> <tr> <td> <fieldset style="width: 900px;" > <%-- <legend style="color: #FFFFFF">REFORMAS</legend>--%> <legend style="color: #FFFFFF">OBRAS PĂBLICAS</legend> <asp:Panel ID="ProductsHolder" runat="server" /> </fieldset> </td> </table> <asp:ImageButton runat="server" ID="btnPrev" CommandName="Page" CommandArgument="Prev"Text="Anterior" Visible="<%#Container.CurrentPageIndex > 0 %>" ImageUrl="~/img/black_left2.png" /> <asp:ImageButton runat="server" ID="btnNext" CommandName="Page" CommandArgument="Next"Text="Siguiente" Visible="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" ImageUrl="~/img/black_right2.png" /> </LayoutTemplate> <ItemTemplate> <div class="reforma"> <%-- <span> <asp:Label ID="AddressLabel" runat="server" Text='<%# Eval("fcDescRef") %>' Font-Bold="true" ClientIDMode="Inherit" ForeColor="White" /> </span>--%> <br /> <table> <tr> <td> <span> <asp:Label ID="Label1" runat="server" Text='<%# Eval("fcDescRef") %>' Width="200px" Font-Bold="true" ClientIDMode="Inherit" ForeColor="White" style="text-align:justify; vertical-align:middle;" /> </span> </td> <td><span> <asp:ImageButton ID="SushiImage" runat="server" AlternateText='<%# Eval("fcDescRef") %>' Width="150px" CommandName="Select" ImageUrl='<%# Eval("fcURLimg") %>' /> </span></td> </tr> </table> <%--<table> <tr> <td> <asp:Label ID="AddressLabel" runat="server" Text='<%# Eval("fcDescRef") %>' Font-Bold="true" ClientIDMode="Inherit" ForeColor="White" /> </td> </tr> <tr> <td> <asp:ImageButton ID="SushiImage" runat="server" AlternateText='<%# Eval("fcDescRef") %>' Width="150px" CommandName="Select" ImageUrl='<%# Eval("fcURLimg") %>' /> </td> <td align="left"> <asp:Label ID="Label1" runat="server" Text='<%# Eval("fcObs") %>' Width="200px" Font-Bold="true" ClientIDMode="Inherit" ForeColor="White" /> </td> </tr> </table>--%> </div> </ItemTemplate> </telerik:RadListView>
Hope Your Help. <rad:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server"> <Windows> <rad:RadWindow ID="radwindowPopup" runat="server" VisibleOnPageLoad="true" Height="280px" Width="500px" Modal="true" Animation="None" VisibleStatusbar="false" VisibleTitlebar="true" Behaviors="Move, Close" Title="" KeepInScreenBounds="false" Skin="Default"> </rad:RadWindow> </Windows></rad:RadWindowManager><rad:RadButton ID="btnUpload" Text="Go" Enabled="true" runat="server" AutoPostBack="false" OnClientClicked="btnUpload_Click" />function btnUpload_Click(sender, eventArgs) { var oWnd = window.radopen(null, "radwindowPopup"); oWnd.set_title("Fooo Barrr");}
And in the page load of the user control I set the nav URL:
protected void Page_Load(object sender, EventArgs e){ radwindowPopup.NavigateUrl = "SomePage.aspx";}And the dummy page itself:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileUpload.aspx.cs" Inherits="MyAgDataWebRole1.UI.FileUpload" %><html><head id="Head1" runat="server"> <title></title></head><body class="Popup"><form id="Form1" runat="server" > <div> This is a test </div></form></body></html>
The window opens, and the close X button at the top right of the window is visible, but it is always disabled and clicking it does nothing. Also, the handle for dragging the window in the titlebar is only the width of the text in the title, not the 100% width of the titlebar. I tried changing the text to be longer and the handle changes width = text width.
I have opened other RadWindows from server-side and the windows display, drag handle is 100% width of the titlebar and the close X button actually works. Not sure what is going on and any help to make this (simple) task work client-side would be much appreciated. I have at least 8 hours so far sunk into this trying to get your windows to work correctly. TIA.
Protected Overridable Sub SaveColumnSettings() Settings.ColumnSettings.Clear() Dim i = 0 For Each column As GridColumn In Grid.MasterTableView.Columns Debug.Print("column no " + i.ToString() + " with OrderIndex " + column.OrderIndex.ToString()) i += 1 Settings.ColumnSettings.Add(GetColumnSettings(column)) Next.....column no 0 with OrderIndex 2column no 1 with OrderIndex 3column no 2 with OrderIndex 4column no 3 with OrderIndex 5column no 4 with OrderIndex 6column no 5 with OrderIndex 7.....<ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" ReorderColumnsOnClient="true" AllowDragToGroup="false" ColumnsReorderMethod="Reorder" AllowColumnHide="true" Selecting-AllowRowSelect="false"><MasterTableView AllowMultiColumnSorting="false" AllowNaturalSort="true" AllowCustomSorting="true" AllowCustomPaging="true" .... >.....
rlv.DataSource = rlv.Page.Session[rlv.UniqueID + "_MyItems"]List<MyItem>;rlv.InsertItemTemplate = new CustomTemplate();rlv.ShowInsertItem(RadListViewInsertItemPosition.LastItem);rlv.PerformInsert(); // calls without error, but no event fired.rlv.InsertItemPosition = RadListViewInsertItemPosition.None;<telerik:RadGrid ID="grdLibraryGlobalRates" runat="server" DataSourceID="dsLibraryGlobalRateManager"
AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
<MasterTableView CommandItemDisplay="Top" DataSourceID="dsLibraryGlobalRateManager"
DataKeyNames="_LibraryGlobalRateScheduleID">
<DetailTables>
<telerik:GridTableView Name="grdGlobalRateScheduleEvent"
DataKeyNames="_LibraryGlobalRateScheduleEventID"
DataSourceID="dsLibraryGlobalRateManagerEvent" Width="100%"
runat="server" AutoGenerateColumns="False" CommandItemDisplay="Top">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="_LibraryGlobalRateScheduleID"
MasterKeyField="_LibraryGlobalRateScheduleID"></telerik:GridRelationFields>
</ParentTableRelation>
.............. Columns here
<EditFormSettings EditFormType="WebUserControl"
UserControlName="UserControls_EditUpdate/LibraryGlobalRateEvents.ascx">
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</telerik:GridTableView>
</DetailTables>
............Columns here
<EditFormSettings EditFormType="WebUserControl" UserControlName="UserControls_EditUpdate/LibraryGlobalRates.ascx">
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
Protected Sub grdLibraryGlobalRates_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles grdLibraryGlobalRates.ItemCommand
If e.CommandName = "LibraryGlobalRateEventUpdate" Then
Try
Dim MyUserControl As UserControl = CType(e.Item.FindControl(Telerik.Web.UI.GridEditFormItem.EditFormUserControlID), UserControl)
End If
If e.CommandName = "LibraryGlobalRateEventInsert" Then
Try
Dim MyUserControl As UserControl = CType(e.Item.FindControl(Telerik.Web.UI.GridEditFormItem.EditFormUserControlID), UserControl)
End If
End Sub
On the LibraryGlobalRateEventInsert command, e.item evaluates to
{Telerik.Web.UI.GridEditFormInsertItem} and MyUserControl gets set to the usercontrol I am using for the EditFormSettings
On the LibraryGlobalRateEventUpdate command, e.item evaluates to
{Telerik.Web.UI.GridDataItem} and MyUserControl gets set to Nothing
At this point I am unable to update values when edit is selected.
Please help me resolve this or point me to a post that will explain the update process for details tables as it pertains to UserControls for editing.
Thanks,
Marty