I have some code I'm troubleshooting from our offshore team. We have a datagrid that we want to enable paging on, the problem is that the CurrentPageIndex of the RadGrid is always 0. We aren't using a DataSource property but retrieving our data via a service layer in the code-behind that calls a stored proc that uses OFFSET and FETCH to return the subset of rows based on the page index and page size.
Here's the ASPX code for the RadGrid:
<telerik:RadGrid ID="EnrollmentPeriodCompanyElectionsGrid" runat="server" AllowSorting="true" AutoGenerateColumns="false" PageSize="20" AllowPaging="True" AllowCustomPaging="true" OnPageIndexChanged="EnrollmentPeriodCompanyElectionsGrid_PageIndexChanged" OnPageSizeChanged="EnrollmentPeriodCompanyElectionsGrid_PageSizeChanged" OnNeedDataSource="EnrollmentPeriodCompanyElectionsGrid_NeedDataSource" OnItemDataBound="EnrollmentPeriodCompanyElectionsGrid_ItemDataBound" EnableViewState="true"> <MasterTableView NoMasterRecordsText="Nothing was found for this election period"> <Columns> <telerik:GridBoundColumn DataField="HrpClientID" HeaderText="ID" SortExpression="HrpClientID" /> <telerik:GridHyperLinkColumn HeaderText="COMPANY" UniqueName="Company" SortExpression="CompanyName" DataTextField="CompanyName" DataNavigateUrlFields="CompanyID,BenefitEnrollmentPeriodID" DataNavigateUrlFormatString="~/Admin/Companies/Company.aspx?companyID={0}&page=Exhibits&periodID={1}" HeaderStyle-Width="300px" /> <telerik:GridBoundColumn DataField="CompanyType" HeaderText="TYPE" SortExpression="CompanyType" /> <telerik:GridBoundColumn DataField="HRP" HeaderText="HRP" SortExpression="HRP" /> <telerik:GridBoundColumn DataField="HRC" HeaderText="HRC" SortExpression="HRC" /> <telerik:GridBoundColumn DataField="EnrollmentStatus" SortExpression="EnrollmentStatus" HeaderText="STATUS" /> </Columns> </MasterTableView></telerik:RadGrid>Here's the NeedDataSource method:
protected void EnrollmentPeriodCompanyElectionsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { try { var enrollmentId = Request.QueryString["PeriodID"] != null ? int.Parse(Request.QueryString["PeriodID"]) : 0; { RadGrid enrollmentPeriodCompanyElectionsGrid = (RadGrid)sender; int currentPageIndex = EnrollmentPeriodCompanyElectionsGrid.CurrentPageIndex; var dataSource = GetBenefitEnrollmentCompanies(enrollmentId, currentPageIndex, pageSize); enrollmentPeriodCompanyElectionsGrid.DataSource = dataSource.BenefitEnrollmentCompanyDetail; // set this only once. if (enrollmentPeriodCompanyElectionsGrid.VirtualItemCount == 0) enrollmentPeriodCompanyElectionsGrid.VirtualItemCount = dataSource.TotalRecordsCount; } } catch (Exception ex) { ErrorHandler.HandleError<Exception>(ex, new { UserID = CurrentUser.UserID, CompanyID = CurrentCompany.CompanyID, ViewingUserID = CurrentUser.UserID, PageIndex = 1, PageSize = pageSize }); } }and PageIndexChanged:
protected void EnrollmentPeriodCompanyElectionsGrid_PageIndexChanged(object sender, GridPageChangedEventArgs e) { try { // reset this property to new page after. EnrollmentPeriodCompanyElectionsGrid.CurrentPageIndex = e.NewPageIndex + 1; } catch (Exception ex) { ErrorHandler.HandleError<Exception>(ex, new { UserID = CurrentUser.UserID, CompanyID = CurrentCompany.CompanyID, ViewingUserID = CurrentUser.UserID, PageIndex = e.NewPageIndex, PageSize = pageSize }); } }However, no matter what the CurrentPageIndex is 0. I've verified by manually changing the CurrentPageIndex in Visual Studio that, when set, paging works correctly, it just is always being set to 0. I've tried everything, but I can't get the paging to recognize that I'm selecting a new page.
I have a DDT binding server side to Id & Name, I also have checkboxes
rdtLocation.DataSource = locations;
rdtLocation.DataTextField = "Name";
rdtLocation.DataFieldID = "Id";
rdtLocation.DataValueField = "Id";
rdtLocation.DataFieldParentID = "ParentId";
rdtLocation.DataSource = locations;
rdtLocation.DataBind();
With one selected item when I look at the selectedValue I get a comma separated list containing 2 instances of the id. ie - "2,2"
See attached screen shot.
Why is this and what is the fix.
Andy

Hi there,
I need to show next and prev button above rad grid so that when my site is open on mobile view, user can navigate to rest of the columns. Every column is given fixed width. But the issue I am facing that I must have to freeze at least one column.
Current code:
<MasterTableView DataKeyNames="UserID" HeaderStyle-Width="100px" TableLayout="Auto" CommandItemDisplay="TopAndBottom" CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowRefreshButton="false" CommandItemSettings-NextFrozenColumnText="Next Column" CommandItemSettings-PrevFrozenColumnText="Previous Column">
<ClientSettings>
<Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="1" EnableNextPrevFrozenColumns="true" />
</ClientSettings>
When I set FrozenColumnsCount="0", next and prev button stop working.
Kindly provide the solution so that no column would get freezed.

I have a radgrid which is batch edit mode. How can I get one column value and set Max value to another Column in grid.
Thank You.

Hello,
As far as I know the RadMap is missing a Scale control.
Researching what to do i came across the following example to manually add one: http://dojo.telerik.com/ogAke
I have implemented this but its not satisfying, in bigger zooms there is a bug and the numbers go smaller. (i believe the javascript var is overflowing)
Anyhow, do you have any suggestions about which alternative could i follow to implement a nice scale? Is Telerik planning on adding the scale?
Thank you!

| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadAjaxProblem.aspx.cs" |
| Inherits="Ajax.RadAjaxProblem" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title>Test Ajax</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="scriptManagerProxy1" runat="server"> |
| </asp:ScriptManager> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="radNumber1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="lblTotal" UpdatePanelRenderMode="Inline" /> |
| <telerik:AjaxUpdatedControl ControlID="btnOk" UpdatePanelRenderMode="Inline" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="radNumber2"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="lblTotal" UpdatePanelRenderMode="Inline" /> |
| <telerik:AjaxUpdatedControl ControlID="btnOk" UpdatePanelRenderMode="Inline" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="btnOk"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="lblMessage" UpdatePanelRenderMode="Inline" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <div style="margin:50px" > |
| <telerik:RadNumericTextBox ID="radNumber1" runat="server" Type="Number" MinValue="1" |
| AutoPostBack="true" NumberFormat-DecimalDigits="0" Width="75px" ShowSpinButtons="true" |
| Value="1" OnTextChanged="OnNumber1Changed" /> |
| plus |
| <telerik:RadNumericTextBox ID="radNumber2" runat="server" Type="Number" MinValue="1" |
| AutoPostBack="true" NumberFormat-DecimalDigits="0" Width="75px" ShowSpinButtons="true" |
| Value="1" OnTextChanged="OnNumber2Changed" /> |
| equals |
| <asp:Label runat="server" ID="lblTotal"></asp:Label>. |
| <p> |
| Message: |
| <asp:Label ID="lblMessage" runat="server" Text="..."></asp:Label> |
| </p> |
| <p> |
| <asp:Button runat="server" ID="btnOk" OnClick="btnOk_Click" Text="OK" /> |
| </p> |
| </div> |
| </form> |
| </body> |
| </html> |
| using System; |
| using Telerik.Web.UI; |
| namespace Ajax |
| { |
| public partial class RadAjaxProblem : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| } |
| private void UpdateTotal() |
| { |
| int arg1 = (int) (radNumber1.Value.HasValue ? radNumber1.Value.Value : 0); |
| int arg2 = (int) (radNumber2.Value.HasValue ? radNumber2.Value.Value : 0); |
| lblTotal.Text = String.Format("{0}", arg1 + arg2); |
| } |
| protected void OnNumber1Changed(object sender, EventArgs e) |
| { |
| UpdateTotal(); |
| } |
| protected void OnNumber2Changed(object sender, EventArgs e) |
| { |
| UpdateTotal(); |
| } |
| protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) |
| { |
| } |
| protected void btnOk_Click(object sender, EventArgs e) |
| { |
| lblMessage.Text = String.Format("OK clicked at " + DateTime.Now.ToLongTimeString()); |
| } |
| } |
| } |
Hello
On a page I have RadNavigation menu with submenu and a AutoCompleteBox with OnEntryAdded event. If I put the AutoCompleteBox inside the UpdatePanel, after OnEntryAdded is fired, RadNavigation menu does not work anymore - it's blocked, I can't access submenu nodes. There is no javascript errors on the page, so I don't know how to fix this. Can you help me please.
I'm attaching the sample code which you can use to see the issue.
<%@ Page Title="" Language="VB" AutoEventWireup="false" CodeFile="test1.aspx.vb" Inherits="test1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<form id="form1" enctype="multipart/form-data" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" EnableScriptGlobalization="true" Runat="server">
</telerik:RadScriptManager>
<telerik:RadNavigation ID="radNav" Skin="MetroTouch" Font-Size="Medium" runat="server" RenderMode="Auto">
<Nodes>
<telerik:NavigationNode Text="Test">
<Nodes>
<telerik:NavigationNode NavigateUrl="test1.aspx" Text="Test 1"></telerik:NavigationNode>
<telerik:NavigationNode NavigateUrl="test1.aspx" Text="Test 2"></telerik:NavigationNode>
</Nodes>
</telerik:NavigationNode>
</Nodes>
</telerik:RadNavigation>
<asp:UpdatePanel runat="server" ID="up1">
<ContentTemplate>
<telerik:RadAutoCompleteBox OnEntryAdded="drpLista_EntryAdded" ID="RadAutoCompleteBox1" Width="180px" runat="server" Skin="Bootstrap">
</telerik:RadAutoCompleteBox>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Imports System.Data
Imports System.Data.SqlClient
Imports Telerik.Web.UI
Partial Class test1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
BindToArrayList(RadAutoCompleteBox1)
End Sub 'Page_Load
Private Sub BindToArrayList(ByVal autoCompleteBox As RadAutoCompleteBox)
Dim itemsList As New ArrayList()
itemsList.Add("One")
itemsList.Add("Two")
itemsList.Add("Three")
autoCompleteBox.DataSource = itemsList
End Sub 'BindToArrayList
Protected Sub drpLista_EntryAdded(sender As Object, e As AutoCompleteEntryEventArgs)
End Sub
End Class

On Firefox the Radeditor imagemanager window is:
1. Always sticking on top of browserwindow
2. not high enough for content, see screenshot.
Marc
01. protected void RDDL_Statut_Load(object sender, EventArgs e)02.{03. DC_FiltragesDataContext Mydb = new DC_FiltragesDataContext();04. var results = (from U in Mydb.PLOP05. select new { statut = U.STATUT}).Distinct();06. 07. RDDL_Statut.DataSource = results;08. RDDL_Statut.DataTextField = "statut";09. RDDL_Statut.DataValueField = "statut";10. 11. RDDL_Statut.DataBind();12. RDDL_Statut.Items.Insert(0, new DropDownListItem("--ALL STATUT--", "ALL"));13. 14.}Hi, I have an issue with my drop down list.
Lets say that i have a DropDownList Displaying : A, B ,C , D etc. And I need a default item.
Using this code , my data is not correctly bound.
The display of the DrowDownList Is the one i expected . But my "RDDL_Statut.SelectedItem.Value.ToString()" Is returning the Next Index.
When A is clicked I get B value.
