Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
222 views
Hi all,

Just wondered if anybody could tell me why when doing custom paging the CurrentPageIndex of the grid is always equal to 0 no matter which page I click? Am I missing something really obvious?

I have my grid set up as follows and am only doing paging no sorting/grouping etc:

AllowPaging = true
AllowCustomPaging =true
PageSize=20
OnNeedDataSource=grid1_NeedDataSource

My code behind gets the name of a user entered into a search box txtName and then uses this as search criteria. If CurrentPageIndex is 0 I set it to 1 as that is what my sproc needs as a minimum startRowIndex. But whenever I debug and select a different page the grid1.MasterTableView.CurrentPageIndex property is always 0 and never changes.

protected void grid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
String name = txtName.Text.Trim();
Int32 totalRecords;
Int32 startRowIndex = grid1.MasterTableView.CurrentPageIndex == 0 ? 1 : grid1.MasterTableView.CurrentPageIndex * grid1.PageSize;
Int32 maximumRows = grid1.MasterTableView.PageSize;

if (name != String.Empty)
{
UserCollection users = UserMgr.GetByUserSearch(name, startRowIndex, maximumRows, out totalRecords);
grid1.VirtualItemCount = totalRecords;
grid1.DataSource = users;
}


Any help with this would be much appreciated as its starting to drive me a little insane.

Thanks

Tim
Vlad
Telerik team
 answered on 24 Nov 2008
2 answers
93 views
I know this sort of sounds like a weird request as I understand the motive for the pager details not showing up if there is only 1 page, but for one of my pages I really want to row count to always show up in the footer pager item and by detault it appears that the radgrid hides the pager item if there is only 1 page.  Is there a way to deactivate this feature so that it shows regardless of the number of pages so that the user still has access to the row count?  Or is there a better way to display the total row count?
Jeremy Coenen
Top achievements
Rank 1
 answered on 24 Nov 2008
4 answers
91 views
Hi,
I have a scheduler, when user click to Edit Or Insert, I need to check if he is authenticated, and display a Login page in RadWindow if he is not authenticated.

protected void RadScheduler1_FormCreating(object sender, Telerik.Web.UI.SchedulerFormCreatingEventArgs e)
    {
        if ((e.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) || (e.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert))
        {
            if ((bool)Session["isAuthenticated"] == false)
            {
                //Run Script
                string script = "<SCRIPT LANGUAGE='JavaScript'> ";
                script += "return DisplayLogin()";
                script += "</SCRIPT>";
                ClientScript.RegisterStartupScript(typeof(Page), "ClientScript", script);

                
                e.Cancel = true;//Cancel the Edit or Insert form
            }
        }

    }


And here is javaScript to display RadWindow

<script language="javascript" type="text/javascript">
        function DisplayLogin()
        {            
            var oRadWindow = $find("<%=LoginRadWindow.ClientID%>");            
            oRadWindow.show();
            oRadWindow.restore();
            return false;
        }
</script>

My problem is the script does not run because I cancel the form Create event and there are no post back.
Is there any way to make it happens
Thanks
Liem
Top achievements
Rank 1
 answered on 24 Nov 2008
2 answers
91 views

I am playing around with the Scheduler and the OnClientTimeSlotClick event. Right now I have done nothing to the scheduler but add the client event and an alert to see the day. When i click on some dates (only happens in MonthView - Day and Week return the correct date/time) it returns the day before. It appears it is only happening when the monthview is on November and the date is from November 3 on. It returns: Wednesday, November 19, 2008 11:00:00 PM when i click on Nov. 20/ If i switch to December all of the Dec. dates show right. If i go back to november i get the same problem.

My page is just the scheduler and script manager with teh javascript alert. I am not even binding data to it yet.

<telerik:RadScheduler ID="RadScheduler1" DayStartTime="08:00:00" DayEndTime="18:00:00" TimeZoneOffset="03:00:00" 
 DataEndField="End" DataKeyField="Key" DataStartField="Start" DataSubjectField="Subject" OnClientTimeSlotClick="timeSlotClick" runat="server">  
</telerik:RadScheduler> 

cursive34
Top achievements
Rank 1
 answered on 24 Nov 2008
2 answers
194 views
Hi

I have a RadGrid that is working as expected with a Self Referencing Hierarchy, I have now been tasked with putting a Right Click Context menu in place. What I need to figure out is:

1)     How to select the highlight / select the row that has been right clicked in a nested TableView. 
        
        I have tried to replace:
        
        var index = eventArgs.get_itemIndexHierarchical();
        var mtv= sender.get_masterTableView();
        mtv().selectItem(mtv.get_dataItems()[index].get_element(), true);

        with

        var index = eventArgs.get_itemIndexHierarchical();
        var otv= sender.get_tableView();
        otv().selectItem(otv.get_dataItems()[index].get_element(), true); 

2)    How do I deselect any previously right clicked rows (be they in the Master Table View or in an nested Table View)

        "sender.get_masterTableView().clearSelectedItems();" only clears out selected rows in the Master Table View. 
        Do I need to call get_detailTables() and iterate through these?

 

 


3)     How can I get a value from the either the DataItem or the DataKeyValues from client side for the row that has fired off the 
        context menu?       

Any thoughts / pointers most appreciated

Cheers

Simon
        

Sebastian
Telerik team
 answered on 24 Nov 2008
3 answers
73 views
Dear telerik team,
My ParentPage has a repeater.items that contains textboxes and each repeater.items has Add button.
When clicking to Add button TargetPage opens. After chossing the data in TargetPage could you explain how we can transfer the datas to textboxex where in repeater.item.

Thank you for helping us.
Nikolay Raykov
Telerik team
 answered on 24 Nov 2008
1 answer
68 views
I'm experiencing an issue with trying to amend the RadEditorTools.xml file for the RadEditor. I'm trying to create a dropdown list for the various paste functions (paste, paste from word etc). In my RadEditorTools.xml file I've got the following code:

 

<EditorToolStrip Name="Paste" > 
    <EditorTool Name="Paste"  /> 
    <EditorTool Name="PasteFromWordNoFontsNoSizes" /> 
    <EditorTool Name="PastePlainText" /> 
    <EditorTool Name="PasteAsHtml" /> 
</EditorToolStrip> 

In order to hide the text on the 'paste' top level button I'm assuming I need to use the showtext="false" property. However, when adding this all my dropdowns in the toolstrip don't work. Please can anyone confirm if this is a reproducable bug or I'm understanding this incorrectly.

Thanks in advance for any help.

Nikolay Raykov
Telerik team
 answered on 24 Nov 2008
1 answer
90 views
Hi,
I have a scheduler, when user click to Edit Or Insert, I need to check if he is authenticated, and display a Login page in RadWindow if he is not authenticated.

protected void RadScheduler1_FormCreating(object sender, Telerik.Web.UI.SchedulerFormCreatingEventArgs e)
    {
        if ((e.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) || (e.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert))
        {
            if ((bool)Session["isAuthenticated"] == false)
            {
                //Run Script
                string script = "<SCRIPT LANGUAGE='JavaScript'> ";
                script += "return DisplayLogin()";
                script += "</SCRIPT>";
                ClientScript.RegisterStartupScript(typeof(Page), "ClientScript", script);

                
                e.Cancel = true;//Cancel the Edit or Insert form
            }
        }

    }


And here is javaScript to display RadWindow

<script language="javascript" type="text/javascript">
        function DisplayLogin()
        {            
            var oRadWindow = $find("<%=LoginRadWindow.ClientID%>");            
            oRadWindow.show();
            oRadWindow.restore();
            return false;
        }
</script>

My problem is the script does not run because I cancel the form Create event and there are no post back.
Is there any way to make it happens
Thanks
Svetlina Anati
Telerik team
 answered on 24 Nov 2008
1 answer
167 views
Hi,

I need the content that a user can edit, to be a fixed size.. eg- the user can only edit whats viewable in the editor
and not be able to increase the size of the page, kinda like a masterpage contentcontrol.
________________
This is a Title

This is Description

This is Ending notes
________________

So everything inbetween the lines can be edited but the line width and height cannot be increased or descreased (Fixed)

Is this at all possible?

Regards

Dean
Rumen
Telerik team
 answered on 24 Nov 2008
4 answers
83 views

Hello,

I am trying to launch a RadWindow from within my radgrid using the following tutorial (Editing RadGrid Records with RadWindow) and everytime I click on my link I get a javascript 'Object does not support this property or method' error. If I add a button outside of the grid and try showing the window, everything works fine.

 

<

telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

 

 

<script type="text/javascript">

 

 

 

 

 

function ShowEditForm(url)

 

{

window.radopen(url,

null);

 

 

return false;

 

}

 

</

telerik:RadCodeBlock>

 

 

 

 

 

<telerik:GridTemplateColumn UniqueName="TemplateEditColumn">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<asp:Button ID="Button1" runat="server" Text="xxx" OnClientClick="return ShowEditForm('www.google.com');" />

 

 

 

 

 

<asp:HyperLink ID="lnkEdit" runat="server" Text="Edit"></asp:HyperLink>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 


 

Daniel
Telerik team
 answered on 24 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?