Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
444 views
I'm having a RadGrid with two columns which need to display custom Aggregate result.$0$0$0$0In RadGrid each column with Aggregate = "Custom" column triggers event OnCustomAggregate and passes GridCustomAggregateEventArgs object to it. $0$0$0$0$0However I couldn't find any property within GridCustomAggregateEventArgs object that would allow me to distinguish between several columns within one GridItem. $0$0It only contains a reference to the current GridItem object but not a particular cell within it which actually triggers the call. $0$0Is there still any way to know within the event handler to know which column the current aggregate=custom call refers to?$0$0$0$0$0$0Protected Sub rgSummary_CustomAggregate(ByVal sender As System.Object, ByVal e As Telerik.Web.UI.GridCustomAggregateEventArgs) Handles rgSummary.CustomAggregate$0$0...........................$0$0    End Sub$0$0$0End Class$0$0
Marc Fearby
Top achievements
Rank 1
 answered on 15 Sep 2011
3 answers
165 views
I have created a series of RadGrids dynamically from a SQL Datasource.  The grid is a list of reports with information pertaining to each report (format, frequency, published date).  I need to add a NestedViewTemplate to each row so that I can also display the report description.  

All this worked fine when declaring the RadGrid in the .ascx and then binding in code behind.  Using those grids as templates I removed the declarations, inserted a placeholder and started creating the grids dynamically. That also worked fine.   It only goes haywire when i try to add a NestedViewTemplate.  Basically what happens is that though there are 4 columns defined for the list, it renders a 5th with no content and causes the defined columns to shift left by one.  Can anyone tell me what I'm doing wrong? Here's the code:

//Create Grid object
var rgReport = new Telerik.Web.UI.RadGrid
{
    CssClass = css,
    Width = Unit.Percentage(100),
    PageSize = 5,
    AllowPaging = true,
    AllowSorting = true,
    AutoGenerateColumns = false,
    DataSource = dataSource,
    ID = itemName
};
 
//Nested template
rgReport.MasterTableView.NestedViewTemplate = new EeisNestedTemplate();
rgReport.MasterTableView.NestedViewSettings.DataSourceID = "Description";
 
// ReportName column
GridHyperLinkColumn reportName = new GridHyperLinkColumn
{
    DataTextField = "ReportName",
    HeaderText = "Report Name",
};
var landingURL = new string[1];
landingURL[0] = "LandingPageUrl";
reportName.DataNavigateUrlFields = landingURL;
reportName.DataNavigateUrlFormatString = "{0}";
reportName.HeaderStyle.Width = Unit.Pixel(340);
reportName.HeaderStyle.Wrap = true;
 
// Report Format
GridBoundColumn reportFormat = new GridBoundColumn
{
    HeaderText = "Format",
    DataField = "Format"
};
reportFormat.HeaderStyle.Width = Unit.Pixel(66);
reportFormat.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
 
// Report Frequency
GridBoundColumn reportFrequency = new GridBoundColumn
{
    HeaderText = "Frequency",
    DataField = "Frequency"
};
reportFrequency.HeaderStyle.Width = Unit.Pixel(80);
 
 
// Report Publish Date
GridBoundColumn reportPublishedDate = new GridBoundColumn
{
    HeaderText = "Published",
    DataField = "Published",
    DataFormatString = "{0:MM/dd/yyyy}"
};
reportPublishedDate.HeaderStyle.Width = Unit.Pixel(70);
 
//Pager Template
rgReport.MasterTableView.PagerTemplate = new EeisPagerTemplate { itemCount = dataSource.Count };
rgReport.MasterTableView.PagerStyle.AlwaysVisible = true;
rgReport.MasterTableView.PagerStyle.Mode = GridPagerMode.NumericPages;
rgReport.MasterTableView.PagerStyle.PageButtonCount = 3;
 
 
 
//Misc Properties
rgReport.MasterTableView.ID = "MasterView" + reportCategoryCount.ToString();
rgReport.MasterTableView.HierarchyDefaultExpanded = false;
 
//Add columns
rgReport.MasterTableView.Columns.Add(reportName);
rgReport.MasterTableView.Columns.Add(reportFormat);
rgReport.MasterTableView.Columns.Add(reportFrequency);
rgReport.MasterTableView.Columns.Add(reportPublishedDate);
 
return rgReport;

And the Template Class:
internal class EeisNestedTemplate : ITemplate
{
    protected Literal nestedContent;
    protected Panel headerObj;
    public string description { get; set; }
 
    public void InstantiateIn(System.Web.UI.Control container)
    {
        headerObj = new Panel();
        headerObj.ID = "panel" + Guid.NewGuid().ToString();
        nestedContent = new Literal();
        nestedContent.ID = "literal" + Guid.NewGuid().ToString();
        nestedContent.Text = "Report Description";
 
        headerObj.Controls.Add(nestedContent);
        container.Controls.Add(headerObj);
    }
}

Thanks!
Chris
Top achievements
Rank 1
 answered on 15 Sep 2011
1 answer
282 views

Not sure how to interpret this error... I'm getting it at runtime.  I recently upgraded the RadControls non-AJAX framework to the AJAX framework. 

FYI: these are the dlls we were using, if that gives you any clue, but they are now removed. 

If you need me provide anymore info, just ask.

C:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadAjax.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadCalendar.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadComboBox.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadEditor.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadGrid.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadInput.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadMenu.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadSpell.NET2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadSplitter.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadTabStrip.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadToolbar.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadTreeView.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadUpload.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadWindow.Net2.dll

------------------------------------
Runtime Error:

Server Error in '/' Application.

Compilation Error

 

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30009: Reference required to assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the implemented interface 'System.Web.UI.IScriptControl'. Add one to your project.

Source Error:

Line 43:         Private Shared __initialized As Boolean
Line 44:         
Line 45: Private Shared __BuildControl__control2_skinKey As Object = System.Web.UI.PageTheme.CreateSkinKey(GetType(Telerik.Web.UI.RadEditor), "")Line 46:         
Line 47:         Private Shared __BuildControl__control5_skinKey As Object = System.Web.UI.PageTheme.CreateSkinKey(GetType(Telerik.Web.UI.RadEditor), "MinimalSetOfTools")

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d1181b04\d55e5605\App_Theme_Default.9qs9avxh.0.vb    Line: 45


 

 

 


Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618

 

..... some of the code above in the error is not visible.  Use this for more readability:

Line 43:         Private Shared __initialized As Boolean
Line 44:        
Line 45:         Private Shared __BuildControl__control2_skinKey As Object = System.Web.UI.PageTheme.CreateSkinKey(GetType(Telerik.Web.UI.RadEditor), "")
Line 46:        
Line 47:         Private Shared __BuildControl__control5_skinKey As Object = System.Web.UI.PageTheme.CreateSkinKey(GetType(Telerik.Web.UI.RadEditor), "MinimalSetOfTools")

newb
Top achievements
Rank 1
 answered on 15 Sep 2011
1 answer
93 views
The combo box does not size the scrollable area of the box to fit within the visible area of the browser.  This means that when you open the list, you can have to scroll the page just to see the other end of the list.  Especially annoying if you have a lot of items in the combo box since it can make some items inaccessible without resizing the browser window.

It also doesn't detect the best direction to expand the box based on proximity to the browser window edge.

This is with EnableScreenBoundaryDetection set to true.
Kalina
Telerik team
 answered on 15 Sep 2011
4 answers
357 views
We are trying to use the new functionality in Telerik Radcombobox  to be able to accomplish multi select functionality with checkboxes. Is there a property / code sample that would allow us to Select All checkboxes.

For example: if we have a multi select combo box loaded with states. We want the client to be able to select multiple states. If the client wants to select all of the states, checking 50+ check boxes will be a lot more work than having one select all check box, that would let them select all of them.

Thanks
Chandra
Kalina
Telerik team
 answered on 15 Sep 2011
1 answer
244 views
Hi,
  I have a asp.net page that has a grid on it.  This grid is refreshed peridodically via a RadXMLHttpPanel.  The problem is that I need this auto refresh to stop when session state ends and redirect to a login page...however the auto refresh mechanism keeps the session state alive.  I thought the Ajax controls bypassed part of page life cycle and session state would expire...but it appears to be doing a full postback?  How can I get a partial page update without keeping session state alive?...and ultimately once session state is dead then to redirect to another page...Below is my script code that starts the refresh based on a js timer...

//js script
function startWorklistRefresh() {
                if (wlIntervalId == 0) {
                    wlIntervalId = setInterval("reloadWorklist();", wlCtrlAutoRefreshRate);
                }
               }
 
            function reloadWorklist() {
                $find("<%= XmlGridPanel.ClientID %>").set_value("Reload");
            }
 
            function GridXmlPanel_OnResponseEnded(sender, args) {
                startWorklistRefresh();
            }
 
//aspnet markup...
 <telerik:RadXmlHttpPanel ID="XmlGridPanel" runat="server" OnServiceRequest="GridXmlPanel_OnServiceRequest"
            OnClientResponseEnded="GridXmlPanel_OnResponseEnded" EnableClientScriptEvaluation="true">
            <telerik:RadGrid id="GridWorklist" runat="server" SkinID="main" GridLines="None" style="outline: none;" OnItemCreated="GridWorklist_ItemCreated" OnItemDataBound="GridWorklistt_ItemDataBound">...
 
And the xml panel event on the server side...
 protected void GridXmlPanel_OnServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
        {
            GridWorklist.DataSource = RadTechData.GetWorklist(AppUtils.CurrentFacilityID);
            GridWorklist.DataBind();
        }
Pero
Telerik team
 answered on 15 Sep 2011
1 answer
289 views
I've been following the instructions on this page to get Telerik controls working in a SharePoint WebPart. I'm getting an error on the following line in the OnInit method:
this.Page.Form.Controls.AddAt(0, scriptManager);
The error says:
"The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases."
I reckon the RadScriptManager could be added to the masterpage, but because it is a WebPart we're building we'd much prefer to keep it as a self-contained object. Anyway, it looks like the example code isn't really valid. Am I missing something?
Eraph
Top achievements
Rank 1
 answered on 15 Sep 2011
1 answer
544 views
In RadGrid control, you can add DetailTables.

By default, the html generated out of this added DetailTable contains <colgroup> and <thead> elements.

I'd need to remove these 2 elements and currently I'm using JQuery on the client side:

thisNestedTable.find('> thead,> colgroup').remove();

How to achieve this from the server side? Does GridTableView support this to exclude these 2 elements from the generated html?

I'd need this asap so would really appreciate it if you could respond quickly.
Galin
Telerik team
 answered on 15 Sep 2011
1 answer
106 views
Hi

I have a radscheduler in a weekday view. When the user clicks in the weekday name the radscheduler render all the appointments for that day, eg, if I click in "Tuesday" the form makes a postback and automatically displays the events only for "Tuesday". How can I detect this event? I wish to save in a state variable if the user is seeing the whole week or only one day


Thanks
Regula
Top achievements
Rank 1
 answered on 15 Sep 2011
1 answer
126 views
Hi,

I'm using the following codes to remove the some of the filter selections.  For some reason, it set the filters for all of the datetime columns to 'no filter'

 

 

GridFilterMenu menu = GridWellVent.FilterMenu;  

int i = 0; 

while (i < menu.Items.Count)

{

if (menu.Items[i].Text == "NoFilter" || menu.Items[i].Text == "Contains")

{

i++;

}

else

{

menu.Items.RemoveAt(i);

}

}

thanks,
Minh Bui

Andrey
Telerik team
 answered on 15 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?