Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
160 views
Hi

A few moths ago I started a thread and later a support ticket regarding writing the week number in the date header of the radscheduler week and day view and your reply was that I could find the LiteralControl that held the header by referring to:

RadScheduler1.Controls[0].Controls[0].Controls[2].Controls[0]

and then use my custom method to retrieve the week number and write it to the LiteralControl

that worked fine until I upgraded to the latest version of the package which renders an error that the same control now is a WebControl not a LiteralControl. Is there a new way for me to write to the header or anotherway to display the week number?

with kind regards
Peter
Telerik team
 answered on 30 May 2009
1 answer
115 views
Update: I think its a side effect of a different control I am using

I have a control on the page that does an ajax request back to a page e.g.(clicking a button) in that button event I am making a call to some web service. After I get the results back from that call I am using linq to filter down the data by some items on the page.
I tired setting the data source of my grid after I am done with the linq filtering but rows never show up on the page. I ended up reading this link Rebind grid on command/postback event with EnableViewState = false thiking that would be what I need to do, but that has not worked for me either.

Here is some of the code I have written.

public class Programs 
    { 
        public string Name 
        { 
            get; 
            set; 
        } 
        public bool Required 
        { 
            get; 
            set; 
        } 
 
        public bool Approved 
        { 
            get; 
            set; 
        } 
    } 
 
 public partial class Charts: Page 
    { 
        List<Programs> ProgramList; 
 
 
 protected void Button_Click(object sender, ImageClickEventArgs e) 
{ 
 
   
                //Programs has items in it and is declare as a var 
                // for brevity sake I left out the filtering  code 
                ProgramList = programs; 
 
                DetailsGrid.DataSource = null; 
                DetailsGrid.Rebind(); 
} 
 
protected void DetailsGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        { 
            if (ProgramList != null) 
            { 
                DetailsGrid.DataSource = ProgramList; 
 
            } 

That datasource is set and the Items created code does run but the grid never shows up on the page. It
Georgi Krustev
Telerik team
 answered on 30 May 2009
3 answers
215 views
Hi,
  I'm using an ObjectDatasource as the datasource for a radgrid object. I came across the following problem and hope if someone can help out:
  1. When a filter command raise the OnSelecting event of the objectdatasource, the MasterView.FilterExpression has the right expression (turn off the enablelinqexpression) for a SQL whereclause, But the grid display without the grid pager ( could not netvigate result set). I found out that must manually set MasterView.FilterExpression="" for the result to be displayed right. Is this a problem ?
 2. Since  MasterView.FilterExpression must be cleared every time a filter is applied, I have to maintain a persistent filter object be veiewstate. Filter object is constructed in the OnItemCommand event handler but for a date field filter the following returned null:
                TextBox filterBox = (e.Item as GridFilteringItem)[filterPair.Second.ToString()].Controls[0] as TextBox;
      is there other ways to access the filter input box of a datetime column ?
3. I down loaded the 2009 Q1 Trial version hoping some of the problem got fixed. After the installation process (uninstall 2008 Q3 then install 2009 Q1) when creating a new websize project in VS 2008, the radcontrols in toolbox are updated but when dragged a RadScriptManager onto the design surface, the control displayed error:"Cannot load assembly Telerik.Web.UI.2009,1.403,35 .....".
Telerik.Web.UI.dll of the right version has been created in the project bin directory though. How could this be fixed ?

Georgi Krustev
Telerik team
 answered on 30 May 2009
3 answers
127 views
Apologies in advance for the duplicate posting, but I just realized that I originally posted this in the old RadControls for ASP.Net forum rather than RadControls for AJAX forum.

I am having this problem in both FF 3.0 and IE 8 (haven't been able to test in IE 7 yet).  This problem also can be recreated using the demos on Telerik's site. 

To recreate, 
  • Go to http://demos.telerik.com/aspnet-ajax/editor/examples/filemanagers/defaultcs.aspx
  • Select the Document Manager
  • Select Telerik at TechEd.doc from the listing.  The right most pane should correctly populate the link text field with the Telerik at TechEd.doc file name.
  • Now, select the Telerik RadControls.doc file from the listing.
  • The link text does not updating along with the change of selected file
  • When you click Insert, Telerik RadControls.doc file is correctly inserted into the content, however it is inserted with the Telerik at TechEd.doc link text
Is there a way for the link text to update when the selected document is changed?
Lini
Telerik team
 answered on 30 May 2009
1 answer
118 views
I am exporting a grid into a pdf file.  But when I view the print screen the grid is half the size of the paper and the font is really tiny.  I have over 100 pages when it should only be around 40.  How do I make the print out look like what it does in PDF.  I put down  landscape in my code.  

 

this.ExportSettings.Pdf.PageHeight = Unit.Parse("162mm");

 

 

this.ExportSettings.Pdf.PageWidth = Unit.Parse("600mm");

 

e.Item.Style[

"font-size"] = "9px";

Is there something I need to do to make it fit to the correct paper size?

Thanks,

Daniel
Telerik team
 answered on 30 May 2009
1 answer
73 views
Hi,

In edit event only few columns to be allowed for editing and for AddNew record all columns to be allowed to enter values. GridColumns are autogenerated. Please reply with some solutions/suggestions.

Thanks
Venkat
Daniel
Telerik team
 answered on 30 May 2009
4 answers
162 views
I'm sure this is a duplicate request, but I can't find what I'm looking for.  I'm hoping someone can point me in the right direction.

I need a demo/forum post with an example of a dynamic user control.  Based upon the type of record being edited, I want the control to render itself differently for each type.  (Most of my work is in the code behind as well, so demos with stuff in the mark up doesn't fit too well.)

For example,

I have a data grid, lets say a grid of a automobiles.  Each automobile record has an automobile-type-indicator (T=truck, C=Convertable, W=Wagon, S=Sedan, ....).

When the user drills down on a truck recod .. I pass the indicator "T" to the user control.  I have this wired up and working in the Item Created Event.

        protected void grdDefinition_ItemCreated(object sender, GridItemEventArgs e)  
        {  
 
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
            {  
                 
                AutomobilSelector userControl = (AutomobilSelector )e.Item.FindControl(GridEditFormItem.EditFormUserControlID);  
 
                userControl.AutoTypeId = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["auto_type_id"].ToString(), CultureInfo.InvariantCulture);  
            }  
]  
             


The user control then says, "hey I'm a truck" so it renders the truck panel which shows a prompt for the size of the truck bed, towing package, etc.

When the user clicks a Convertable record, the user control says, "hey, I'm a convertable" so it now hides the truck stuff and shows a panel with a drop down for rag top or hard top, transmission type, etc.

I can do some of this, but the user control's page life cycle is different when I put it into an inline edit vs. just putting it on a standard page.  Stuff like setting a label value within page load doesn't render, instead I have to hook a data binding event in order to do stuff in the code behind..

My lastest challenge is when, say I'm showing the convertable panel.  The user says, "lets make it a truck instead" and changes the autoType drop down from convertable to truck.  I then execute a onSelectedValueChange event, to show/hide text boxes concerning truck options.  However, none of the new panels render.


        protected void ddlAutoType_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)  
        {  
            pnlTruck.Visible = false;  
            pnlConvertable.Visible = false;  
            pnlSedan.Visible = false;  
            switch (ddlAutoType.SelectedValue.ToString(CultureInfo.InvariantCulture))  
            {  
                case "T":  
                    pnlTruck.Visible = true;  
                    break;  
                case "S":  
                    pnlSedan.Visible = true;  
                    break;  
                case "C":  
                    pnlConvertable.Visible = true;  
                    break;  
    
                default:  
                    break;  
            }  
        }  
 
I can hit this code when the drop down changes, but I can't seem to do anything to effect the rendering of the control.

so if anyone has any examples to help guide me, I'd love to see them. ... thank you very much.

Rosen
Telerik team
 answered on 30 May 2009
1 answer
91 views
The PagerStyle class is from the Telerik Grid API.

Color MyValue;
var color = RadGrid1.PagerStyle.BackColor;
color = MyValue;

PagerStyle returns GridPagerStyle. BackColor returns type Color.

If I edit the returned value by writing RadGrid1.PagerStyle.BackColor = Color(and however I manipulate this Color),

or write:

RadGrid1.PagerStyle.BackColor = MyValue (where MyValue is my own custom set variable).

Is there a difference in the end result? Is one approach preferred over the other?

Thanks

Dimo
Telerik team
 answered on 30 May 2009
1 answer
64 views
I realize that you need to keep your graphic designers busy.

But how many different skins are you going to make that are called "Web20"?

Can't you just leave "Web20" alone, and just call every other version something else, like "Web21" and "Web22", etc?
Dimo
Telerik team
 answered on 30 May 2009
1 answer
66 views
Hi,
I previously downloaded a trial version and created a grid interface that was working great.  However after I purchased a license version this grid no longer works I get the following error message:

Below is the HTML aspx code
'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager


<%

@ Page Language="C#" AutoEventWireup="true" CodeBehind="Leads.aspx.cs" Inherits="AstonishResultsReporting.Reports.Leads"

 

 

MasterPageFile="~/SiteMasterPage.master" %>

 

<%

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

 

<

 

asp:Content ID="Leads" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 

 

<telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">

 

 

</telerik:RadScriptManager>

 

 

<asp:UpdateProgress ID="UpdateProgress1" runat="server">

 

 

<ProgressTemplate>

 

 

<div class="progress">

 

 

<img src="/images/indicator.gif" alt="" />

 

Processing .....

 

</div>

 

 

</ProgressTemplate>

 

 

</asp:UpdateProgress>

 

 

<br />

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="dbgLeads">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="dbgLeads" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadCodeBlock runat="server" ID="radCodeBlock">

 

 

<script type="text/javascript">

 

 

function showFilterItem(){

 

$find(

'<%=dbgLeads.ClientID %>').get_masterTableView().showFilterItem();

 

}

 

function hideFilterItem(){

 

$find(

'<%=dbgLeads.ClientID %>').get_masterTableView().hideFilterItem();

 

}

 

</script>

 

 

</telerik:RadCodeBlock>

 

 

<telerik:RadGrid ID="dbgLeads" runat="server" AllowPaging="True" AllowSorting="True"

 

 

GridLines="None" OnPageIndexChanged="dbgLeads_PageIndexChanged" OnSortCommand="dbgLeads_SortCommand"

 

 

PageSize="25" Skin="Vista" AutoGenerateColumns="False" Height="100%" Width="100%"

 

 

OnPageSizeChanged="dbgLeads_PageSizeChanged" AllowFilteringByColumn="True">

 

 

<HeaderContextMenu Skin="WebBlue">

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</HeaderContextMenu>

 

 

<PagerStyle Mode="NextPrevNumericAndAdvanced" />

 

 

<MasterTableView>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="Firstname" HeaderText="First Name" UniqueName="Firstname">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Lastname" HeaderText="Last Name" UniqueName="Lastname">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Phone" DataFormatString="{0:(###)###-####}" HeaderText="Phone"

 

 

UniqueName="Phone">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Mobilephone" DataFormatString="{0:(###)###-####}"

 

 

HeaderText="Cell" UniqueName="Mobilephone">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Company" HeaderText="Company" UniqueName="Company">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Createddate" DataFormatString="{0:MM/dd/yy}"

 

 

DataType="System.DateTime" HeaderText="Create Date" UniqueName="Createddate">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Systemdays" HeaderText="Days in System" UniqueName="Systemdays">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Email" HeaderText="E-Mail" UniqueName="Email">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Contacttype" HeaderText="Contact Type" UniqueName="Contacttype">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status">

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings AllowColumnsReorder="True">

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 

 

<FilterMenu>

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</FilterMenu>

 

 

</telerik:RadGrid>

 

</

 

asp:Content>

 

Pavlina
Telerik team
 answered on 30 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?