Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
102 views

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">
James
Top achievements
Rank 1
 answered on 30 Jan 2013
2 answers
255 views
Hi,

How can I disable the image paste in radeditor?
Also I don't want to allow the drag and drop as well.

Thanks
Attila
Top achievements
Rank 1
 answered on 29 Jan 2013
2 answers
347 views
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.
Cristian
Top achievements
Rank 1
 answered on 29 Jan 2013
12 answers
986 views
I have a radgrid with a checkbox grid template column to select the default address. I would like to have user check only one checkbox . If  user checks one, then all others should be unchecked. If none are checked then give them error saying atleast one needs to be checked.  They can change the checkbox selection until they submit the form.  How can this be done?
Wbc
Top achievements
Rank 1
 answered on 29 Jan 2013
1 answer
84 views
And the drag handle on the window titlebar is only the width of the title text on this window. (Help!)

Opening my radwindow with these settings, set in a user control:

<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>

There is a button on the user control like this to open the window:
<rad:RadButton ID="btnUpload" Text="Go" Enabled="true" runat="server" AutoPostBack="false" OnClientClicked="btnUpload_Click" />

Javascript:
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.

 

 

 

nat
Top achievements
Rank 1
 answered on 29 Jan 2013
3 answers
611 views
Hello, I'm having issues with the order index of my grid's columns.
I am saving the grid settings in a session variable, with the class provided here. I added a debug to see what is happening.
During the save, after i moved some column, i get this output:
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
.....
Output:
column no 0 with OrderIndex 2
column no 1 with OrderIndex 3
column no 2 with OrderIndex 4
column no 3 with OrderIndex 5
column no 4 with OrderIndex 6
column no 5 with OrderIndex 7.....

My grid have those settings:
<ClientSettings EnableRowHoverStyle="true"
  AllowColumnsReorder="true"
  ReorderColumnsOnClient="true"
  AllowDragToGroup="false"
  ColumnsReorderMethod="Reorder"
  AllowColumnHide="true"
  Selecting-AllowRowSelect="false">
 and my masterTableView has those settings:
<MasterTableView AllowMultiColumnSorting="false" AllowNaturalSort="true" AllowCustomSorting="true" AllowCustomPaging="true" .... >.....

Is it normal to get OrderIndex always in the same order? Does that explain why i load my grid settings i always get default order?
I save column slection too, that works really well, saved in session and saved in database. But OrderIndex... always in this order.

Anything im missing?


EDIT: i missed something... wether you hide or show a column, the order Index is always in order.
Then, any idea on how am i going to save the indexOrder of the column in my database?
Daniel
Telerik team
 answered on 29 Jan 2013
1 answer
74 views
Dear Team,
i encounter a strange behaviour of the RAD Editor within an aspdnsf Portal.
The UI looks like it's shown in the attached pictures.
Any idea if that might be Version related?
It's a cross browser issue...show in IE as well as in FF.
Rumen
Telerik team
 answered on 29 Jan 2013
1 answer
211 views
Hi,

I have a RadListView where I am dynamically creating the layout template and insert template at runtime.  Also just to let you know, I have the RadListView inside of a RadPanelBar whose ContentTemplate I am also creating at runtime.  This RandPanelBar is within a NestedGridView of a RadGrid.  All that is just an FYI as to the situation :)  I have all of this working, but I am having an issue with inserting a value into my RadListView.  I have a button that resides in the layouttemplate, where when I click it I am rebinding my listview and calling the ShowInsertItem command.  This is correctly showing my Inserttemplate items, where I have a radcombobox and radnumerictextbox. 

At this point after the user fills these things in, I have a save button that is clicked.  This is where my problems lies. I need to be able to get the values of the radCombobox and radnumerictextbox from the edit template.  I tried to access them using FindControl within the save click, but that only finds controls in the layouttemplate.  So I wanted to implement the OnItemInserting event to be able to access the insert template.  At first, I just performed a PerformInsert() call.  But that gave me an error that the list view wasn't in insert mode.  To get around this, I had to call ShowInsertItem again.  By doing that, I can call PerformInsert.  But the event isn't firing, even if I reattach the event to the list view (just to be sure, since it is a dynamic control).  I tried changing my save button's CommandName to 'PerformInsert', but it seems to trigger an insert on the RadGrid and gives an error about it not being in insert mode.  Below is the code in my btnSave_Click event, could someone tell me what I'm doing wrong? Or is there a way within my btnSave_Click event to access the controls in the InsertTemplate?

Thank you!
Richard
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;

Angel Petrov
Telerik team
 answered on 29 Jan 2013
1 answer
50 views
I have a radgrid with a details table. Both the master table and the details table are using usercontrols for the edit/insert capbilities. Below is the code of the main grid page (I have stripped out unrelated sections):

<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>


I have put command names on the update (LibraryGlobalRateEventUpdate) and insert (LibraryGlobalRateEventInsert) buttons on the usercontrol for the details table update. on the main grid item command event I evaluate for the command name and proceed accordingly in the code behind:

 

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

 

 

 

 

 

 

 

 

 

 

 

Maria Ilieva
Telerik team
 answered on 29 Jan 2013
4 answers
92 views
In my grid  there is a column contains a usercontrol and a checkbox , when I export the grid to pdf, the column is empty. When   grid exports to pdf , not support  usercontrol or checkbox? Thanks in advance.
William
Top achievements
Rank 1
 answered on 29 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?