Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
172 views
I have a RadGrid and am trying to get paging working with an ObjectDataSource. I have used the demo as the basis as well as a number of other forum postings, but can't seem to get the paging to display or work. RadGrid does not seem to ever call the SelectCountMethod, so I returned the totalRows and set the VirtualItemCount in the Selected event. The PageSize never gets passed into the MaximumRows in the ODS so I set the MaximumRows in the Selecting event. I have pasted the code below. If you guys need I will try to isolate a test project to reproduce, but I was hoping you might be able to discern what I am missing (I am guessing it is something obvious) by looking at the code. Unfortunately I cannot get the code snippet tool to work (probably our overly restrictive proxy) so the code is pasted below:


ucLoanSearch.ascx:

<%

 

@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucLoanSearch.ascx.cs" Inherits="VHIWebSite.Controls.ucLoanSearch" %>

 

<%

 

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<

 

 

script type="text/javascript" language="javascript">

 

</

 

 

script>

 

<

 

 

telerik:RadScriptManager ID="ScriptManager" runat="server" />

 

<

 

 

asp:ObjectDataSource ID="SearchByNameObjectDataSource" EnablePaging="true"

 

 

 

SelectCountMethod="SearchByNameCount" SortParametername="SortColumns"

 

 

 

MaximumRowsParameterName = "maximumRows" StartRowIndexParameterName="startRowIndex"

 

 

 

TypeName="TellerBL.TellerDataObjects" SelectMethod="SearchByName"

 

 

 

EnableCaching="false" runat="server"

 

 

 

onselecting="SearchByNameObjectDataSource_Selecting"

 

 

 

onselected="SearchByNameObjectDataSource_Selected">

 

<

 

 

SelectParameters>

 

 

 

<asp:Parameter Name="mspDataConnectString" Type="String" />

 

 

 

<asp:Parameter Name="clientCode" Type="String" />

 

 

 

<asp:Parameter Name="firstName" Type="String" />

 

 

 

<asp:Parameter Name="lastName" Type="String" />

 

 

 

<asp:Parameter Name="totalRows" Direction="Output" Type="Int32" />

 

</

 

 

SelectParameters>

 

</

 

 

asp:ObjectDataSource>

 

<

 

 

asp:ObjectDataSource ID="SearchByAddressObjectDataSource" EnablePaging="true" SelectCountMethod="SearchByAddressCount" SortParametername="SortColumns"

 

 

 

TypeName="TellerBL.TellerDataObjects" SelectMethod="SearchByAddress" EnableCaching="false" runat="server"

 

 

 

onselecting="SearchByAddressObjectDataSource_Selecting">

 

<

 

 

SelectParameters>

 

 

 

<asp:Parameter Name="mspDataConnectString" Type="String" />

 

 

 

<asp:Parameter Name="clientCode" Type="String" />

 

 

 

<asp:Parameter Name="houseNumber" Type="String" />

 

 

 

<asp:Parameter Name="street" Type="String" />

 

 

 

<asp:Parameter Name="city" Type="String" />

 

 

 

<asp:Parameter Name="state" Type="String" />

 

 

 

<asp:Parameter Name="zipCode" Type="String" />

 

</

 

 

SelectParameters>

 

</

 

 

asp:ObjectDataSource>

 

<

 

 

table cellspacing="0" cellpadding="0">

 

 

 

<tr valign="top">

 

 

 

<td>

 

 

 

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"

 

 

 

SelectedIndex="0" CssClass="TabStrip" ontabclick="RadTabStrip1_TabClick"

 

 

 

CausesValidation="False" ClickSelectedTab="True">

 

 

 

<Tabs>

 

 

 

<telerik:RadTab Text="Loan Number" Selected="True">

 

 

 

</telerik:RadTab>

 

 

 

<telerik:RadTab Text="Borrower/Co-Borrower">

 

 

 

</telerik:RadTab>

 

 

 

<telerik:RadTab Text="Property Address">

 

 

 

</telerik:RadTab>

 

 

 

</Tabs>

 

 

 

</telerik:RadTabStrip>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td>

 

 

 

<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"

 

 

 

CssClass="PageView">

 

 

 

<telerik:RadPageView ID="LoanNumberPageView" runat="server">

 

 

 

<table cellspacing="0" cellpadding="0" style="padding-left:10px;padding-top:10px">

 

 

 

<tr valign="top">

 

 

 

<td colspan="4">

 

 

 

<asp:Label ID="LoanNumberLabel" runat="server" Text="Label">Loan Number:</asp:Label>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr valign="top">

 

 

 

<td>

 

 

 

<asp:TextBox ID="LoanNumberTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="10" Width="100px" runat="server" ValidationGroup="loan"></asp:TextBox>

 

 

 

<asp:RegularExpressionValidator ID="LoanNumberRegularExpressionValidator" ValidationGroup="loan" ControlToValidate="LoanNumberTextBox" runat="server" Display="None" ValidationExpression="^\d{0,10}" ErrorMessage="Loan Number must be numeric."></asp:RegularExpressionValidator>

 

 

 

<asp:CustomValidator ValidationGroup="loan" ID="LoanNumberCustomValidator" runat="server" Display="None" ErrorMessage="Invalid Loan Number." onservervalidate="LoanNumberCustomValidator_ServerValidate"></asp:CustomValidator>

 

 

 

</td>

 

 

 

<td>&nbsp;&nbsp;&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:Button id="SearchButton" runat="server" CssClass="TellerInput" UseSubmitBehavior="false" Text="Go" onclick="SearchButton_Click" ValidationGroup="loan" CausesValidation="True" />

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

</tr>

 

 

 

<tr valign="top">

 

 

 

<td colspan="4">

 

 

 

<asp:ValidationSummary ID="LoanNumberValidationSummary" DisplayMode="BulletList" runat="server" ValidationGroup="loan" SkinID="TellerSkin" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</telerik:RadPageView>

 

 

 

<telerik:RadPageView ID="NamePageView" runat="server" DefaultButton="NameSearchButton">

 

 

 

<div id="nameDiv" runat="server">

 

 

 

<table cellspacing="0" cellpadding="0" style="padding-left:10px;padding-top:10px">

 

 

 

<tr valign="top">

 

 

 

<td>

 

 

 

<asp:Label ID="LastNameLabel" runat="server">Last</asp:Label>

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:Label ID="FirstNameLabel" runat="server">First</asp:Label>

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>&nbsp;</td>

 

 

 

</tr>

 

 

 

<tr valign="top">

 

 

 

<td>

 

 

 

<asp:TextBox ID="LastNameTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="10" Width="150px" runat="server" ValidationGroup="name"></asp:TextBox>

 

 

 

<asp:RegularExpressionValidator ID="LastNameRegularExpressionValidator" ValidationGroup="name" ControlToValidate="LastNameTextBox" runat="server" Display="None" ValidationExpression="^[a-zA-Z]{2,}$" ErrorMessage="Please enter at least two characters for Last Name."></asp:RegularExpressionValidator>

 

 

 

<asp:RequiredFieldValidator ID="RequiredFieldValidator3" ValidationGroup="name" ControlToValidate="LastNameTextBox" runat="server" Display="None" ErrorMessage="Please enter a Last Name."></asp:RequiredFieldValidator>

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:TextBox ID="FirstNameTextBox" CssClass="TellerInput" CausesValidation="true" MaxLength="10" Width="150px" runat="server" ValidationGroup="name"></asp:TextBox>

 

 

 

</td>

 

 

 

<td>&nbsp;&nbsp;&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:Button id="NameSearchButton" runat="server" CssClass="TellerInput"

 

 

 

UseSubmitBehavior="false" Text="Search"

 

 

 

onclick="NameSearchButton_Click" ValidationGroup="name"

 

 

 

CausesValidation="True" />

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

</tr>

 

 

 

<tr valign="top">

 

 

 

<td colspan="6">

 

 

 

<asp:ValidationSummary ID="ValidationSummary1" DisplayMode="BulletList" runat="server" ValidationGroup="name" SkinID="TellerSkin" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</div>

 

 

 

</telerik:RadPageView>

 

 

 

<telerik:RadPageView ID="AddressPageView" runat="server" DefaultButton="PropertySearchButton">

 

 

 

<table cellspacing="0" cellpadding="0" style="padding-left:10px;padding-top:10px">

 

 

 

<tr valign="top">

 

 

 

<td>

 

 

 

<asp:Label ID="Label2" runat="server">H/B&nbsp;#</asp:Label>

 

 

 

</td>

 

 

 

<td>&nbsp;&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:Label ID="Label3" runat="server">Street</asp:Label>

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td><asp:Label ID="Label1" runat="server">City</asp:Label></td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td><asp:Label ID="Label4" runat="server">State</asp:Label></td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td><asp:Label ID="Label5" runat="server">Zip&nbsp;Code</asp:Label></td>

 

 

 

<td>&nbsp;</td>

 

 

 

</tr>

 

 

 

<tr valign="top">

 

 

 

<td>

 

 

 

<asp:TextBox ID="HouseNumberTextBox" CssClass="TellerInput" CausesValidation="true" MaxLength="10" Width="50px" runat="server" ValidationGroup="address"></asp:TextBox>

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:TextBox ID="StreetTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="10" Width="150px" runat="server" ValidationGroup="address"></asp:TextBox>&nbsp;

 

 

 

<asp:RequiredFieldValidator ID="RequiredFieldValidator4" ValidationGroup="address" ControlToValidate="StreetTextBox" runat="server" Display="None" ErrorMessage="Please enter a Street Name."></asp:RequiredFieldValidator>

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:TextBox ID="CityTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="10" Width="100px" runat="server" ValidationGroup="address"></asp:TextBox>&nbsp;

 

 

 

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="address" ControlToValidate="CityTextBox" runat="server" Display="None" ErrorMessage="Please enter a City."></asp:RequiredFieldValidator>

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:TextBox ID="StateTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="2" Width="20px" runat="server" ValidationGroup="address"></asp:TextBox>&nbsp; <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="address" ControlToValidate="StateTextBox" runat="server" Display="None" ErrorMessage="Please enter a State."></asp:RequiredFieldValidator>

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:TextBox ID="ZipTextBox" CssClass="TellerInput" CausesValidation="true" MaxLength="10" Width="50px" runat="server" ValidationGroup="address"></asp:TextBox>&nbsp;

 

 

 

<asp:RegularExpressionValidator ID="RegularExpressionValidator4" ValidationGroup="address" ControlToValidate="ZipTextBox" runat="server" Display="None" ValidationExpression="^[0-9]{0,5}$" ErrorMessage="Zip Code must be 5 digits."></asp:RegularExpressionValidator>

 

 

 

</td>

 

 

 

<td>&nbsp;&nbsp;</td>

 

 

 

<td>

 

 

 

<asp:Button id="PropertySearchButton" runat="server" CssClass="TellerInput"

 

 

 

UseSubmitBehavior="false" Text="Search"

 

 

 

onclick="PropertySearchButton_Click" ValidationGroup="address"

 

 

 

CausesValidation="True" />

 

 

 

</td>

 

 

 

<td>&nbsp;</td>

 

 

 

</tr>

 

 

 

<tr valign="top" class="TellerAnnotation">

 

 

 

<td>House&nbsp;or<br />Building&nbsp;Number</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>Please use only the street name<br />(e.g. &quot;Main&quot; instead of &quot;N. Main St.&quot;)</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>&nbsp;</td>

 

 

 

<td>(5 digits only)</td>

 

 

 

<td>&nbsp;</td>

 

 

 

</tr>

 

 

 

<tr valign="top">

 

 

 

<td colspan="6">

 

 

 

<asp:ValidationSummary ID="ValidationSummary2" DisplayMode="BulletList" runat="server" ValidationGroup="address" SkinID="TellerSkin" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</telerik:RadPageView>

 

 

 

</telerik:RadMultiPage>

 

 

 

</td>

 

</

 

 

tr>

 

<

 

 

tr>

 

 

 

<td>

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1"

 

 

 

runat="server">

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="SearchResultsRadGrid" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>

 

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">

 

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 

<telerik:RadGrid runat="server" ID="SearchResultsRadGrid"

 

 

 

AutoGenerateColumns="False" Visible="False"

 

 

 

EnableHeaderContextMenu="True" AllowSorting="True" BorderStyle="Solid"

 

 

 

CellSpacing="0" GridLines="None" BorderWidth="1px" BorderColor="Black"

 

 

 

onitemcommand="SearchResultsRadGrid_ItemCommand"

 

 

 

AllowCustomPaging="False" PageSize ="10"

 

 

 

AllowPaging="True" GroupingEnabled="False" EnableLinqExpressions="false" >

 

 

 

<clientsettings allowcolumnsreorder="False"

 

 

 

allowgroupexpandcollapse="False" reordercolumnsonclient="False"

 

 

 

enablepostbackonrowclick="True">

 

 

 

<Selecting AllowRowSelect="True" enabledragtoselectrows="False"></Selecting>

 

 

 

</clientsettings>

 

 

 

<PagerStyle AlwaysVisible="true" Mode="NumericPages"></PagerStyle>

 

 

 

<mastertableview allowpaging="False" commanditemdisplay="None" OverrideDataSourceControlSorting="True" CanRetrieveAllData="false"

 

 

 

datakeynames="Id, LoanNo" insertitempageindexaction="ShowItemOnCurrentPage"

 

 

 

grouploadmode="Server" GroupsDefaultExpanded="False">

 

 

 

<commanditemsettings exporttopdftext="Export to PDF" />

 

 

 

<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

 

 

 

<rowindicatorcolumn filtercontrolalttext="Filter RowIndicator column"

 

 

 

visible="True">

 

 

 

</rowindicatorcolumn>

 

 

 

<expandcollapsecolumn filtercontrolalttext="Filter ExpandColumn column"

 

 

 

visible="True">

 

 

 

</expandcollapsecolumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="BorrowerName" UniqueName="BorrowerName" HeaderText="Borrower" >

 

 

 

<ItemStyle Wrap="False"/>

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="BorrowerSSNFormatted" UniqueName="BorrowerSSNFormatted" HeaderText="Borrower&nbsp;SSN" >

 

 

 

<ItemStyle Wrap="False"/>

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="CoBorrowerName" UniqueName="CoBorrowerName" HeaderText="Co-Borrower" >

 

 

 

<ItemStyle Wrap="False"/>

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="CoBorrowerSSNFormatted" UniqueName="CoBorrowerSSNFormatted" HeaderText="Co&#8209;Borrower&nbsp;SSN" >

 

 

 

<ItemStyle Wrap="False"/>

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="PropertyAddress" UniqueName="PropertyAddress" HeaderText="Property&nbsp;Address" >

 

 

 

<ItemStyle Wrap="False"/>

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

<editformsettings>

 

 

 

<editcolumn filtercontrolalttext="Filter EditCommandColumn column">

 

 

 

</editcolumn>

 

 

 

</editformsettings>

 

 

 

</mastertableview>

 

 

 

<filtermenu enableimagesprites="False">

 

 

 

</filtermenu>

 

 

 

</telerik:RadGrid>

 

 

 

</td>

 

</

 

 

tr>

 

</

 

 

table>

 




ucLoanSearch.ascx.cs:

using

 

 

System;

 

using

 

 

System.Collections.Generic;

 

using

 

 

System.Linq;

 

using

 

 

System.Web;

 

using

 

 

System.Web.UI;

 

using

 

 

System.Web.UI.WebControls;

 

using

 

 

TellerBL;

 

using

 

 

DmiCore.DataAccess;

 

using

 

 

System.Configuration;

 

using

 

 

System.Web.Profile;

 

using

 

 

DMI.UserManagement;

 

using

 

 

Dmi.Extensions;

 

using

 

 

Telerik.Web.UI;

 

 

namespace

 

 

VHIWebSite.Controls

 

{

 

 

public partial class ucLoanSearch : System.Web.UI.UserControl

 

{

 

 

const string CLIENTCODE = "ClientCode";

 

 

 

const string CUSTOMERID = "CustomerId";

 

 

 

const string GOTO_PAGE = "~/TellerWeb/LoanSummary.aspx";

 

 

 

public string ClientCode

 

{

 

 

get

 

{

 

 

Object o = ViewState[CLIENTCODE];

 

 

 

if (o == null)

 

 

 

if (PopulateClientCustInfo())

 

 

 

return ViewState[CLIENTCODE].ToString();

 

 

 

return o.ToString();

 

}

 

 

set

 

{

 

 

if (!String.IsNullOrEmpty(value))

 

ViewState[CLIENTCODE] =

 

value;

 

}

}

 

 

public string CustomerId

 

{

 

 

get

 

{

 

 

Object o = ViewState[CUSTOMERID];

 

 

 

if (o == null)

 

 

 

if (PopulateClientCustInfo())

 

 

 

return ViewState[CUSTOMERID].ToString();

 

 

 

return o.ToString();

 

}

 

 

set

 

{

 

 

if (!String.IsNullOrEmpty(value))

 

ViewState[CUSTOMERID] =

 

value;

 

}

}

 

 

public string LoanNumber

 

{

 

 

get

 

{

 

 

return LoanNumberTextBox.Text;

 

}

 

 

set

 

{

LoanNumberTextBox.Text =

 

value;

 

}

}

 

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

SetDefaultFocus();

}

 

 

protected bool PopulateClientCustInfo()

 

{

 

 

User currentUser = UserManager.GetUser(HttpContext.Current.User.Identity.Name);

 

 

 

if (currentUser == null)

 

 

 

return false;

 

 

 

Customer c = CustomerManager.GetCustomer(currentUser.CustomerID);

 

 

 

if (c == null)

 

 

 

return false;

 

 

 

Client cl = ClientManager.GetClient(c.ClientID);

 

 

 

if (cl == null)

 

 

 

return false;

 

ViewState[CUSTOMERID] = c.CustomerID;

ViewState[CLIENTCODE] = cl.ClientCode;

 

 

return true;

 

}

 

 

protected void SearchButton_Click(object sender, EventArgs e)

 

{

 

 

if (Page.IsValid)

 

{

Session[

 

TellerStringConstants.TellerLoanNo] = LoanNumberTextBox.Text;

 

Response.Redirect(GOTO_PAGE);

}

}

 

 

protected void LoanNumberCustomValidator_ServerValidate(object source, ServerValidateEventArgs args)

 

{

args.IsValid =

 

true;

 

 

 

string loanNumber = String.Empty;

 

 

 

if (!String.IsNullOrEmpty(LoanNumberTextBox.Text))

 

{

LoanNumberTextBox.Text = LoanNumberTextBox.Text.PadLeft(10,

 

'0');

 

loanNumber = LoanNumberTextBox.Text;

}

 

 

else

 

{

args.IsValid =

 

false;

 

 

 

return;

 

}

 

 

if (!loanNumber.IsValidLoanNumber())

 

{

EventLog.

 

Web.OnTellerInvalidLoanNumber(ConfigurationManager.ConnectionStrings["LoggingEntity"].ToString(),

 

 

 

"Failed parity check", true, Request.ServerVariables["remote_addr"].ToString(),

 

 

 

ConfigurationManager.AppSettings["ApplicationName"].ToString(), Page.Request.Url.AbsoluteUri, HttpContext.Current.User.Identity.Name, Session[TellerStringConstants.TellerLoanNo] != null ? Session[TellerStringConstants.TellerLoanNo].ToString() : String.Empty);

 

args.IsValid =

 

false;

 

 

 

return;

 

}

 

 

DataErrors errorCode;

 

 

 

IHeaderInfo hi = TellerDataObjects.GetHeaderInfo(ConfigurationManager.ConnectionStrings[TellerStringConstants.MspDataEntity].ToString(), loanNumber, out errorCode);

 

 

 

if (hi == null)

 

{

EventLog.

 

Web.OnTellerInvalidLoanNumber(ConfigurationManager.ConnectionStrings["LoggingEntity"].ToString(),

 

 

 

"Loan Number does not exist.", true, Request.ServerVariables["remote_addr"].ToString(),

 

 

 

ConfigurationManager.AppSettings["ApplicationName"].ToString(), Page.Request.Url.AbsoluteUri, HttpContext.Current.User.Identity.Name, loanNumber);

 

args.IsValid =

 

false;

 

 

 

return;

 

}

 

 

}

 

 

protected void SearchByNameObjectDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)

 

{

e.InputParameters[

 

"mspDataConnectString"] = ConfigurationManager.ConnectionStrings[TellerStringConstants.MspDataEntity].ToString();

 

e.InputParameters[

 

"clientCode"] = ClientCode;

 

e.InputParameters[

 

"firstName"] = FirstNameTextBox.Text;

 

e.InputParameters[

 

"lastName"] = LastNameTextBox.Text;

 

e.Arguments.MaximumRows = 10;

}

 

 

protected void SearchByAddressObjectDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)

 

{

e.InputParameters[

 

"mspDataConnectString"] = ConfigurationManager.ConnectionStrings[TellerStringConstants.MspDataEntity].ToString();

 

e.InputParameters[

 

"clientCode"] = ClientCode;

 

e.InputParameters[

 

"houseNumber"] = HouseNumberTextBox.Text;

 

e.InputParameters[

 

"street"] = StreetTextBox.Text;

 

e.InputParameters[

 

"city"] = CityTextBox.Text;

 

e.InputParameters[

 

"state"] = StateTextBox.Text;

 

e.InputParameters[

 

"zipCode"] = ZipTextBox.Text;

 

e.Arguments.MaximumRows = 10;

}

 

 

protected void SearchResultsRadGrid_ItemCommand(object sender, GridCommandEventArgs e)

 

{

 

 

if (e.CommandName == "RowClick")

 

{

 

 

GridDataItem dataItem = (GridDataItem)SearchResultsRadGrid.SelectedItems[0];

 

 

 

if (dataItem != null)

 

{

 

 

object o = dataItem.GetDataKeyValue("Id");

 

 

 

if (o == null)

 

 

 

return;

 

 

 

object os = dataItem.GetDataKeyValue("LoanNo");

 

 

 

if (os == null)

 

 

 

return;

 

Session[

 

TellerStringConstants.TellerLoanNo] = os.ToString();

 

Response.Redirect(GOTO_PAGE);

}

}

}

 

 

protected void NameSearchButton_Click(object sender, EventArgs e)

 

{

 

 

if (Page.IsValid)

 

{

SearchResultsRadGrid.DataSourceID =

 

"SearchByNameObjectDataSource";

 

SearchResultsRadGrid.Visible =

 

true;

 

SearchResultsRadGrid.DataBind();

}

}

 

 

protected void PropertySearchButton_Click(object sender, EventArgs e)

 

{

 

 

if (Page.IsValid)

 

{

SearchResultsRadGrid.DataSourceID =

 

"SearchByAddressObjectDataSource";

 

SearchResultsRadGrid.DataBind();

SearchResultsRadGrid.Visible =

 

true;

 

}

}

 

 

protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)

 

{

SearchResultsRadGrid.Visible =

 

false;

 

SetDefaultFocus();

 

 

foreach (Control ctrl in Page.Controls)

 

ClearControls(ctrl);

}

 

 

private void ClearControls(Control c)

 

{

 

 

foreach (Control ctrl in c.Controls )

 

{

 

 

if (ctrl is TextBox)

 

((

 

TextBox)(ctrl)).Text = null;

 

 

 

if (ctrl.Controls.Count > 0)

 

ClearControls(ctrl);

}

}

 

 

 

 

private void SetDefaultFocus()

 

{

 

 

switch (RadTabStrip1.SelectedIndex)

 

{

 

 

case 0:

 

Page.Form.DefaultButton = SearchButton.UniqueID;

LoanNumberTextBox.Focus();

 

 

break;

 

 

 

case 1:

 

Page.Form.DefaultButton = NameSearchButton.UniqueID;

LastNameTextBox.Focus();

 

 

break;

 

 

 

case 2:

 

Page.Form.DefaultButton = PropertySearchButton.UniqueID;

HouseNumberTextBox.Focus();

 

 

break;

 

}

}

 

 

protected void SearchByNameObjectDataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)

 

{

SearchResultsRadGrid.PageSize = 10;

SearchResultsRadGrid.AllowPaging =

 

true;

 

SearchResultsRadGrid.MasterTableView.VirtualItemCount = (

 

int)e.OutputParameters["totalRows"];

 

SearchResultsRadGrid.VirtualItemCount = (

 

int)e.OutputParameters["totalRows"];

 

}

 

}

}



TellerDataObjects.cs:

 

using

 

 

System;

 

 

 

 

using

 

 

System.Collections.Generic;

 

 

 

 

using

 

 

System.ComponentModel;

 

 

 

 

using

 

 

System.Diagnostics.Contracts;

 

 

 

 

using

 

 

TellerDataAccess;

 

 

 

 

using

 

 

System.Linq;

 

 

 

 

using

 

 

System.Web.UI.WebControls;

 

 

 

 

namespace

 

 

TellerBL

 

{

[

 

DataObjectAttribute]

 

 

 

public static class TellerDataObjects

 

 

 

 

 

{

[

 

DataObjectMethodAttribute(DataObjectMethodType.Select, false)]

 

 

 

public static IHeaderInfo GetHeaderInfo(string mspDataConnectString, string loanNumber, out DataErrors errorCode)

 

{

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(loanNumber));

 

errorCode =

 

DataErrors.None;

 

 

 

IHeaderInfo hi = null;

 

 

 

try

 

 

 

 

 

{

 

 

List<IGeneralLoanInfo> gli = TellerBusinessLogic.GetGeneralLoanInfo(mspDataConnectString, loanNumber);

 

 

 

if (gli != null && gli.Count > 0)

 

{

 

 

HeaderInfo hi2 = new HeaderInfo();

 

hi2.LoanNumber = loanNumber;

hi2.BankruptcyStop = gli[0].BankruptcyStop;

hi2.BillingCityAndState = gli[0].BillingCityAndState;

hi2.BillingStreetAddress = gli[0].BillingStreetAddress;

hi2.BorrowerName = gli[0].BorrowerName;

hi2.BorrowerSSN = gli[0].MortgagorSSN;

hi2.CoBorrowerName = gli[0].CoBorrowerName;

hi2.CoBorrowerSSN = gli[0].CoMortgagorSSN;

hi2.DelinquentBalance = (gli[0].DelinquentBalance.HasValue ? gli[0].DelinquentBalance.Value :

 

decimal.Zero);

 

hi2.ForeclosureStop = gli[0].ForeclosureStop;

hi2.LastApplied = gli[0].LastFullPaymentDate;

hi2.LateCharges = gli[0].LateCharges;

hi2.NextPaymentDueDate = gli[0].Duedate;

hi2.OtherFees = (gli[0].OtherFees.HasValue ? gli[0].OtherFees.Value :

 

decimal.Zero);

 

hi2.PhoneNumber = gli[0].FstTelephoneNo;

hi2.PhoneNumber2 = gli[0].SecTelephoneNo;

hi2.PropertyCity = gli[0].PropertyCity;

hi2.PropertyState = gli[0].PropertyState;

hi2.PropertyStreet = gli[0].PropertyStreet;

hi2.PropertyZipCode = gli[0].PropertyZip;

hi2.TotalMonthlyPayment = gli[0].TotalPayment;

hi2.ZipCode = gli[0].Zipcode;

hi = hi2

 

as IHeaderInfo;

 

}

}

 

 

catch

 

 

 

 

 

{ errorCode =

 

DataErrors.UnknownErrorPleaseRetry; }

 

 

 

return hi;

 

}

[

 

DataObjectMethodAttribute(DataObjectMethodType.Select, false)]

 

 

 

public static List<ILoanSearch> SearchByName(out int totalRows, string mspDataConnectString, string clientCode, string firstName, string lastName, string SortColumns, int startRowIndex, int maximumRows)

 

{

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(clientCode));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(lastName));

 

 

 

List<ILoanInfoSearchResult> l = TellerBusinessLogic.SearchByName(mspDataConnectString, clientCode, firstName, lastName);

 

totalRows = l.Count;

 

 

List<ILoanSearch> l2 = l.OrderBy(x => x.BorrowerName).Select(x => new LoanSearch(x)).Skip(startRowIndex).Take(maximumRows).ToList<ILoanSearch>();

 

 

 

return l2;

 

}

[

 

DataObjectMethodAttribute(DataObjectMethodType.Select, false)]

 

 

 

public static int SearchByNameCount(string mspDataConnectString, string clientCode, string firstName, string lastName)

 

{

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(clientCode));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(lastName));

 

 

 

List<ILoanInfoSearchResult> l = TellerBusinessLogic.SearchByName(mspDataConnectString, clientCode, firstName, lastName);

 

 

 

return l.Count;

 

}

[

 

DataObjectMethodAttribute(DataObjectMethodType.Select, false)]

 

 

 

public static List<ILoanSearch> SearchByAddress(out int totalRows, string mspDataConnectString, string clientCode, string houseNumber, string street, string city, string state, string zipCode, string SortColumns, int startRowIndex, int maximumRows)

 

{

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(street));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(state));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(city));

 

 

 

List<ILoanInfoSearchResult> l = TellerBusinessLogic.SearchByAddress(mspDataConnectString, clientCode, houseNumber, street, city, state, zipCode);

 

totalRows = l.Count;

 

 

return l.Select(x => new LoanSearch(x)).OrderBy(x => x.PropertyAddress).Skip(startRowIndex).Take(maximumRows).ToList<ILoanSearch>();

 

}

[

 

DataObjectMethodAttribute(DataObjectMethodType.Select, false)]

 

 

 

public static int SearchByAddressCount(string mspDataConnectString, string clientCode, string houseNumber, string street, string city, string state, string zipCode)

 

{

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(street));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(state));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(city));

 

 

 

List<ILoanInfoSearchResult> l = TellerBusinessLogic.SearchByAddress(mspDataConnectString, clientCode, houseNumber, street, city, state, zipCode);

 

 

 

return l.Count;

 

}

}

}

 

 



TellerBusinessLogic.cs:

 

using

 

 

System;

 

 

 

 

 

using

 

 

System.Collections.Generic;

 

 

 

 

 

using

 

 

System.Linq;

 

 

 

 

 

using

 

 

System.Text;

 

 

 

 

 

using

 

 

System.Diagnostics.Contracts;

 

 

 

 

 

using

 

 

TellerDataAccess;

 

 

 

 

 

using

 

 

System.Data;

 

 

 

 

 

using

 

 

System.ComponentModel;

 

 

 

 

 

using

 

 

DMI.Crypto;

 

 

 

 

 

using

 

 

DMI.UserManagement;

 

 

 

 

 

using

 

 

VHIWebSite;

 

 

 

 

 

using

 

 

DMI.VHI.TellerApp;

 

 

 

 

 

using

 

 

System.Configuration;

 

 

 

 

 

using

 

 

VHIDataAccess;

 

 

 

 

 

namespace

 

 

TellerBL

 

{

 

 

public static class TellerBusinessLogic

 

 

 

 

 

 

{

 

 

internal static List<ILoanInfoSearchResult> SearchByName(string mspDataConnectString, string clientCode, string firstName, string lastName)

 

{

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(clientCode));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(lastName));

 

 

 

return SearchDA.SearchByName(mspDataConnectString, clientCode, firstName, lastName).ToList<ILoanInfoSearchResult>();

 

}

 

 

internal static List<ILoanInfoSearchResult> SearchByAddress(string mspDataConnectString, string clientCode, string houseNumber, string street, string city, string state, string zipCode)

 

{

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(street));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(state));

 

 

 

Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(city));

 

 

 

return SearchDA.SearchByAddress(mspDataConnectString, clientCode, houseNumber, street, city, state, zipCode).ToList<ILoanInfoSearchResult>();

 

}

}

}

K
Top achievements
Rank 1
 answered on 11 Apr 2012
1 answer
64 views
Hello friends, i have a issue in Rad DatePicker in IE8.
when i launch the screen in IE browser, the date picker sets currrent date and time.
in IE browser, the datepicker  is overlapped and it is not visible the datetime clearly. but in other browser the datetime is clearly visible.
screen shots
1. IE8
2. other browser
what to do the clear this issue.
thanks in advances
S.Rajkumar
Martin
Telerik team
 answered on 11 Apr 2012
1 answer
136 views
I am using Telerik 2012_1_215 version of RadScheduler with a custom db provider. I have a question regarding reminders. I understand that 'Snooze' just delays the reminder for the current user but dismiss should stop the reminder completely, correct? Do I need to explicitly delete the content in the reminder field for that appointment.ID in my database? Or does the scheduler somehow do this automatically when using the custom provider?

Thanks in advance,
C
Peter
Telerik team
 answered on 11 Apr 2012
5 answers
316 views
Hallo,

in the table editor dialog one can select several CSS styles for the table design. Is it possible to change these templates? For our scenario it would be great if we could set the style of a table by default and not allow any changes to the initial style.

I'd appreciate any suggestions on how to accomplish this.

Thanks,
Phil
Rumen
Telerik team
 answered on 11 Apr 2012
1 answer
101 views
I have my grid automatically kicked into edit mode for all rows when it loads. I have a dropdown list that is populated successfully for the 1st row but the subsequent rows aren't displayed properly, it only states the name of the object for each value in the dropdown list, please see this image for what i mean. Here is my code for populating the dropdowns:

if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            //for edit mode
            string selectedCommentIndex = "";
            GridEditableItem item = e.Item as GridEditableItem;
            GridEditManager editMan = item.EditManager;
 
            GridDropDownListColumnEditor commenteditor = (GridDropDownListColumnEditor)(editMan.GetColumnEditor("Action"));
            GridDropDownColumn testing = e.Item.OwnerTableView.Columns.FindByUniqueName("Action") as GridDropDownColumn;
 
             
                var comments = (from c in db.Entered_Comments
                                where c.type_id == 2
                                select c).ToList();
 
                 
 
                commenteditor.DataSource = comments;
                commenteditor.DataTextField = "description";
                commenteditor.DataValueField = "comment_id";
                commenteditor.DataBind();
                commenteditor.Visible = true;
                commenteditor.ComboBoxControl.SelectedValue = selectedCommentIndex;
                commenteditor.DropDownListControl.SelectedValue = selectedCommentIndex;
                commenteditor.ComboBoxControl.AllowCustomText = true;
                commenteditor.ComboBoxControl.EmptyMessage = Resources.DataEntry_ResultEntryByTestPracticeResource.commenteditorComboBoxControlEmptyMessage;
                commenteditor.ComboBoxControl.Filter = RadComboBoxFilter.Contains;
                commenteditor.ComboBoxControl.CssClass = "rcbDropDown";
            
}



Johny
Top achievements
Rank 1
 answered on 11 Apr 2012
1 answer
89 views
We are getting an odd intermittent gap on the timeline view calendar.  Take a look at the Thursday column on the attached image.  Notice the empty space at the top.  This sometimes appears between events or at the top.  No apparent pattern.

Peter
Telerik team
 answered on 11 Apr 2012
1 answer
68 views
Hi ,

I want to display the title row like (Name, Email, Phone) at the top (just like a table structure) and corresponding values in the particular time slot.
.
I don't want to repeat the title row in every time slot.

How can i achieve this?

Many thanks
Peter
Telerik team
 answered on 11 Apr 2012
10 answers
193 views
Hi all,

I have been trying run a demo project (the zip file that I downloaded was named as 213914_radschedulerdemo.zip) posted by Telerik support in one of the Telerik forums. The demo work as well, so when telerik release version Q1 2012(2012.1.215.40) I downloaded and try run it on new version of telerik but after making these changes I get following error:

 

Server Error in '/' Application.

Selection out of range
Parameter name: value

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Selection out of range
Parameter name: value

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Selection out of range
Parameter name: value]
   Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource) +173
   Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data) +491
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) +1256
   Telerik.Web.UI.RadComboBox.PerformSelect() +37
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.RadComboBox.DataBind() +70
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   Telerik.Web.UI.RadScheduler.CreateHiddenAdvancedInsertForm(Control container) +487
   Telerik.Web.UI.RadScheduler.CreateHiddenAdvancedForms() +150
   Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource) +322
   Telerik.Web.UI.RadScheduler.CreateChildControls() +34
   System.Web.UI.Control.EnsureChildControls() +102
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

is there any change within new version telerik that make impacted on it??
Note: I only change reference to dlls (Telerik.Web.UI, Telerik.Web.Design)

Thanks,
Peter
Telerik team
 answered on 11 Apr 2012
2 answers
68 views
Hi ,

I Recently upgraded my Telerik's DLLs from version 2010.3.1215.40 to 2012.1.215.40 version.
On successful upgrade of the Dll's I found below Properties are missing at the Asp.net Ajax RadGrid 2012.1.215.40 's 'GridSelecting'
class.

AllowCellSelect
AllowColumnSelect
AllowMultiCellSelect
AllowMultiColumnSelect

I would like to know whether these properties are removed intentionally or these provided some where else in the Latest Dll's.

Please comment on this.

Thanks,
Srinivas
Martin
Telerik team
 answered on 11 Apr 2012
2 answers
151 views
Hi,
Is there a way to cause radeditor to scroll to the misspelled word automatically?
I have a radeditor with in radwindow. The content of the radeditor sometimes is too long causing the vertical scroll bar to appear.
When user selects spell check and if the word appears too down in the content, it shows the suggestions popup in the center of the content and does not scroll down to the wrong highlighted word.  This causes confusion for the end user as they don't see the wrong word unless they scroll down.
In such scenario, it would be helpful to have automatic scrolling so that suggestion popup appears right beside the wrong word.

Thanks,
Manisha
Manisha Shivjiani
Top achievements
Rank 1
 answered on 11 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?