<table cellspacing="0" class="rcTable rcSingle" summary="Table holding date picker control for selection of dates." style="width:100%;"> <caption style="display:none;"> RadDatePicker </caption><thead style="display:none;"> <tr> <th scope="col"></th> </tr> </thead><tbody> <tr> <td class="rcInputCell" style="width:100%;"><span id="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_dateInput_wrapper" class="riSingle RadInput " style="display:block;width:100%;"><input id="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_dateInput" name="ctl00$BC$G1$GD$ctl00$ctl06$RDIPDate$dateInput" class="riTextBox riEnabled" type="text" /><input id="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_dateInput_ClientState" name="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_dateInput_ClientState" type="hidden" /></span></td> <td><a title="Open the calendar popup." href="#" id="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_popupButton" class="rcCalPopup">Open the calendar popup.</a></td> </tr> </tbody> </table>protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "PerformInsert" || e.CommandName == "Update") { //some code block if (Session["idSess"] == null) { objBz.Insert(objEntity); e.Canceled = false; } else { objBz.Update(objEntity); RadGrid1.MasterTableView.ClearEditItems(); } }<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" ShowStatusBar="true" runat="server" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" AutoGenerateColumns="false" ClientSettings-Resizing-AllowColumnResize="true" DataKeyNames="CarrierNetID" OnItemDataBound="RadGrid_ItemDataBound"> <MasterTableView PageSize="10" Width="100%"> <Columns> <telerik:GridBoundColumn DataField="CarrierNetID" Visible="false" UniqueName="CarrierNetID" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Name" HeaderText="Carrier Name" UniqueName="Name" SortExpression="Name" ReadOnly="true" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Region" HeaderText="Region" UniqueName="Region" AllowFiltering="true" SortExpression="Region" ReadOnly="true" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Country" HeaderText="Country" UniqueName="Country" SortExpression="Country" ReadOnly="true" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn HeaderText="PLMN" UniqueName="PLMN"> <ItemTemplate> <asp:HyperLink ID="lnkPLMN" runat="server" Target="_blank" ForeColor="Blue"> </asp:HyperLink> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="TechnologyTypeCode" HeaderText="Technology" UniqueName="TechnologyTypeCode" SortExpression="TechnologyTypeCode" ReadOnly="true" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="SMSMORate" HeaderText="SSMSO Rate" UniqueName="SMSMORate" AllowFiltering="false" SortExpression="SMSMORate" ReadOnly="true" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="SMSMTRate" HeaderText="SMSMT Rate" UniqueName="SMSMTRate" AllowFiltering="false" SortExpression="SMSMTRate" ReadOnly="true" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DataRate" HeaderText="Data Rate" UniqueName="DataRate" AllowFiltering="false" SortExpression="DataRate" ReadOnly="true" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MOCRate" HeaderText="MOC Rate" UniqueName="MOCRate" AllowFiltering="false" SortExpression="MOCRate" ReadOnly="true" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MTCRate" HeaderText="MTC Rate" UniqueName="MTCRate" AllowFiltering="false" SortExpression="MTCRate" ReadOnly="true" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}"> </telerik:GridBoundColumn> <telerik:GridCheckBoxColumn DataField="FlatRate" HeaderText="Flat Rate" UniqueName="FlatRate" SortExpression="FlatRate" ReadOnly="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridCheckBoxColumn> <telerik:GridCheckBoxColumn DataField="Discount" HeaderText="Discount" UniqueName="Discount" SortExpression="Discount" ReadOnly="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridCheckBoxColumn> <telerik:GridCheckBoxColumn DataField="ActiveFlag" HeaderText="Active" UniqueName="ActiveFlag" SortExpression="ActiveFlag" ReadOnly="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"> </telerik:GridCheckBoxColumn> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true"> </ClientSettings> <PagerStyle Mode="NumericPages"></PagerStyle> </telerik:RadGrid>HyperLink link = (HyperLink)item["PLMN"].Controls[0];
protected void RadGrid_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; HyperLink link = (HyperLink)item["PLMN"].Controls[0]; string value = item.GetDataKeyValue("CarrierNetID").ToString(); link.NavigateUrl = "~/CarrierLaunchStatusForm.aspx?addRecord=0&ID=" + value; } }Iv'e seen examples of the telerik:AjaxSetting and telerik:RadAjaxLoadingPanel so I thought I would try it out in stead of using the standard Ajax update panel.
For the most part it works ok, even mixing it up with standard Ajax like collapse panels. I came across an issue where setting up a Control to be updated by its own onTextChanged Event, I got a funky java script error. It doess't prevent the control form being updated it just throws an exception.
here is the tag in question:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="TextBox_capacity">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="TextBox_capacity" />
</UpdatedControls>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> </telerik:AjaxSetting>
I have others of course but this one throws the exception. Not Sure why. It works just fine once you click past the exception.
Line: 157
Error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: panelsCreated[12]
And when I debug:
$type.registerClass('Sys.WebForms.InitializeRequestEventArgs', Sys.CancelEventArgs);
$type = Sys.WebForms.PageLoadedEventArgs = function PageLoadedEventArgs(panelsUpdated, panelsCreated, dataItems) {
/// <summary locid="M:J#Sys.WebForms.PageLoadedEventArgs.#ctor">The arguments for the PageRequestManager's pageLoaded event. The pageLoaded event is raised after the DOM has been updated.</summary>
/// <param name="panelsUpdated" type="Array">An array of UpdatePanels that were updated.</param>
/// <param name="panelsCreated" type="Array">An array of UpdatePanels that were created.</param>
/// <param name="dataItems" type="Object" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "panelsUpdated", type: Array},
{name: "panelsCreated", type: Array},
{name: "dataItems", type: Object, mayBeNull: true}
]);
if (e) throw e;
Sys.WebForms.PageLoadedEventArgs.initializeBase(this);
this._panelsUpdated = panelsUpdated;
this._panelsCreated = panelsCreated;
this._dataItems = dataItems || new Object();
}
I'm sure I'm missing something simple...........
I have this in an aspx file:
<telerik:RadGrid ID="radFinalMinutes" runat="server" AllowPaging="true" OnNeedDataSource="radFinalMinutes_NeedDataSource" PageSize="20" AllowSorting="true" ShowHeader="true" CellSpacing="0" EnableTheming="false" ShowStatusBar="true" EnableHeaderContextMenu="true" BorderStyle="None" OnItemCommand="radFinalMinutes_ItemCommand"> <PagerStyle Mode="NextPrevAndNumeric" /> <GroupingSettings CaseSensitive="false" /> <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="MinuteId" AllowSorting="true" AllowMultiColumnSorting="true" AllowFilteringByColumn="true" TableLayout="Auto" GridLines="Vertical"> <CommandItemTemplate> <div class="control_heading"> <div style="float:left"> Finalized Documents <img src="help.png" alt="Help!" /> </div> </div> </CommandItemTemplate> <Columns> <telerik:GridBoundColumn DataField="DivisionDescription" HeaderText="Division" UniqueName="Division" ItemStyle-HorizontalAlign="Left" /> <telerik:GridBoundColumn DataField="CategoryDescription" HeaderText="Category" UniqueName="Category" ItemStyle-HorizontalAlign="Left" /> <telerik:GridBoundColumn DataField="MeetingDescription" HeaderText="Meeting Type" UniqueName="MeetingType" ItemStyle-HorizontalAlign="Left" /> <telerik:GridBoundColumn DataField="Facilitator" HeaderText="Facilitator" UniqueName="Facilitator" ItemStyle-HorizontalAlign="Left" /> <telerik:GridDateTimeColumn DataField="MeetingDate" DataFormatString="{0:MMM dd, yyyy}" HeaderText="Date" UniqueName="Date" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" AutoPostBackOnFilter="true" PickerType="DatePicker" EnableRangeFiltering="true" EnableTimeIndependentFiltering="false" CurrentFilterFunction="Between"> <FilterTemplate> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left">From:</td> <td align="left"><telerik:RadDatePicker ID="radFromDate" runat="server" Width="100px" ClientEvents-OnDateSelected="FromDateSelected" FocusedDate='<%# this.startDate %>' SelectedDate='<%# this.startDate %>'></telerik:RadDatePicker></td> </tr> <tr> <td align="left">To:</td> <td align="left"><telerik:RadDatePicker ID="radToDate" runat="server" Width="100px" ClientEvents-OnDateSelected="ToDateSelected" FocusedDate='<%# this.endDate %>' SelectedDate='<%# this.endDate %>'></telerik:RadDatePicker></td> </tr> </table> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript"> function FromDateSelected(sender, args) { var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); var ToPicker = $find('<%# ((GridItem)Container).FindControl("radToDate").ClientID %>'); var fromDate = FormatSelectedDate(sender); var toDate = FormatSelectedDate(ToPicker); tableView.filter("MeetingDate", fromDate + " " + toDate, "Between"); } function ToDateSelected(sender, args) { var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); var FromPicker = $find('<%# ((GridItem)Container).FindControl("radFromDate").ClientID %>'); var fromDate = FormatSelectedDate(FromPicker); var toDate = FormatSelectedDate(sender); tableView.filter("MeetingDate", fromDate + " " + toDate, "Between"); } function FormatSelectedDate(picker) { var date = picker.get_selectedDate(); var dateInput = picker.get_dateInput(); var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat()); return formattedDate; } </script> </telerik:RadScriptBlock> </FilterTemplate> </telerik:GridDateTimeColumn> </Columns> </MasterTableView> </telerik:RadGrid>And the code behind:
protected DateTime DefaultFromDate { get { return DateTime.Now.AddDays( -60 ).Date; } }protected DateTime DefaultThruDate { get { return DateTime.Now.AddDays( 30 ); } }protected DateTime? startDate{ set { ViewState["strD"] = value; } get { if ( ViewState["strD"] != null ) return (DateTime)ViewState["strD"]; else return DefaultFromDate; }}protected DateTime? endDate{ set { ViewState["endD"] = value; } get { if ( ViewState["endD"] != null ) return (DateTime)ViewState["endD"]; else return DefaultThruDate; }} protected void Page_Load( object sender, EventArgs e ){ if ( !IsPostBack ) { LoadInfo(); this.startDate = DefaultFromDate; this.endDate = DefaultThruDate; }}protected void LoadInfo(){ //loading data here into variable "list" var list = Database.SetupFinalMinutes(); list.Load(); radFinalMinutes.DataSource = list.ToList();}protected void radFinalMinutes_NeedDataSource( object sender, GridNeedDataSourceEventArgs e ){ LoadInfo();}protected void radFinalMinutes_ItemCommand( object sender, GridCommandEventArgs e ){ if ( e.CommandName == RadGrid.FilterCommandName ) { Pair filterPair = (Pair)e.CommandArgument; switch ( filterPair.Second.ToString() ) { case "Date": this.startDate = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl( "radFromDate" ) as RadDatePicker).SelectedDate; this.endDate = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl( "radToDate" ) as RadDatePicker).SelectedDate; break; default: break; } }}Now the problem I'm having is the radFinalMinutes_ItemCommand event doesn't fire when I change the dates in my date filter. Any ideas? The javascript in the RadScriptBlock1 does fire, and returns the correct dates [and formatting] - but the filtering on the between dates does not happen. All other columns do fire the ItemCommand.
Edit: should note, I followed http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; GTB7.4; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Wed, 13 Mar 2013 07:34:25 UTC
Message: Unspecified error.
Line: 49
Char: 5
Code: 0
URI: http://demos.telerik.com/aspnet-ajax/editor/examples/overview/Telerik.Web.UI.DialogHandler.aspx?DialogName=ImageManager&UseRSM=true&Skin=Metro&Title=Image+Manager&doid=c5466ed4-9416-4601-b991-fbf5832a3cc4&dpptn=

