Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
207 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
123 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
114 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
65 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
158 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
86 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
61 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
1 answer
58 views

I am dynamically loading the rad combo box controls into a place holder control that resides inside the rad ajax panel in a user control, when the user does a ajax post back all the controls disappeared in 2 seconds after showing the controls.

No errors displayed and no exception message. i didnt get any clue on this problem.

But if i use asp drop down list instead of rad combo box control then its working properly.

And also If i remove the rad ajax panel control then it is showing the all the controls properly after the post back.

Is this a bug or am i doing something wrong?

Thanks
Muthu

Pavlina
Telerik team
 answered on 30 May 2009
1 answer
94 views
This problem has been driving me crazy.  I have a RadGrid with an Ajax Manager wired up to it.  See screenshot:
http://i5.photobucket.com/albums/y176/drpcken/1-2.png

Everything looks great until I sort by a column, then for no reason at all a whitespace (about 8 pixels) appears above the grid.  See screenshot:
http://i5.photobucket.com/albums/y176/drpcken/2.png

It seems that anytime I click on a control that is wired up to the AJAX manager this happens.  I have a button ABOVE the grid (it's not even a part of the grid) and its wired up to the Ajax Manager, when I click it I get the same behavior: a white space above the grid.  When I remove the AJAX manager it works, but of course the whole page posts back with no AJAX.  I've tried everything I can think of to fix this:  I've removed ALL CSS from the page, but I get the same problem.  I've removed the wrapper around the grid, same problem.  I've removed the loading panel, same problem.  I've removed every single server-side method and client side javascript but get the same problem.  The code for the grid:

<div class="CensusGrid"
        <asp:Button ID="btnRefreshCustomers" runat="server" Style="display: none;"  /> 
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="LinqDataSource1" 
            GridLines="None" Skin="WebBlue" AllowMultiRowSelection="True" AllowSorting="True" 
            OnItemDataBound="RadGrid1_ItemDataBound"
            <MasterTableView AutoGenerateColumns="false" DataKeyNames="CensusID" DataSourceID="LinqDataSource1"
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"
                        <ItemStyle Width="27px" Wrap="false" /> 
                        <HeaderStyle Width="27px" Wrap="false" /> 
                    </telerik:GridClientSelectColumn> 
                    <telerik:GridTemplateColumn DataField="LastName" HeaderText="Name"  
                        SortExpression="LastName" UniqueName="LastName"
                        <ItemTemplate> 
                            <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>'></asp:Label>,&nbsp; 
                            <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label>&nbsp; 
                            <asp:ImageButton ID="hasAccess" ImageUrl='<%# Eval("AllowClientAccess", "images/lock_{0}.png") %>' 
                                runat="server" /> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridBoundColumn DataField="DOB" DataType="System.DateTime" HeaderText="DOB" 
                        SortExpression="DOB" UniqueName="DOB" DataFormatString="{0:d}"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="MaritalStatus" HeaderText="MaritalStatus" SortExpression="MaritalStatus" 
                        UniqueName="MaritalStatus"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="AddressCity" HeaderText="AddressCity" SortExpression="AddressCity" 
                        UniqueName="AddressCity"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="AddressState" HeaderText="AddressState" SortExpression="AddressState" 
                        UniqueName="AddressState"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="EmailAddress" SortExpression="EmailAddress" 
                        UniqueName="EmailAddress"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="DateOfHire" DataType="System.DateTime" HeaderText="DateOfHire" 
                        SortExpression="DateOfHire" UniqueName="DateOfHire" DataFormatString="{0:d}"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="JobDescription" HeaderText="JobDescription" SortExpression="JobDescription" 
                        UniqueName="JobDescription"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="flag" UniqueName="flag" Visible="false"
                    </telerik:GridBoundColumn> 
                    <telerik:GridTemplateColumn> 
                        <ItemStyle Width="29px" Wrap="false" /> 
                        <HeaderStyle Width="29px" /> 
                        <ItemTemplate> 
                            <id="HyperLink1" runat="server" class="thickbox" title='<%# "Dependents for <b>" + Eval("FirstName") + " " + Eval("LastName") + "</b>" %>' 
                                href='<%# Eval("censusID", "Dependents.aspx?c={0}&TB_iframe=true&height=550&width=600") %>'
                                <asp:Image ID="Image2" runat="server" ImageUrl="images/she_users.png" ToolTip="Add/Edit Dependents" /> 
                            </a> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn> 
                        <ItemStyle Width="29px" Wrap="false" /> 
                        <HeaderStyle Width="29px" /> 
                        <ItemTemplate> 
                            <id="editUser" runat="server" class="thickbox" title='<%# "Details for <b>" + Eval("FirstName") + " " + Eval("LastName") + "</b>" %>' 
                                href='<%# Eval("censusID", "CensusDetails.aspx?c={0}&TB_iframe=true&height=550&width=600") %>'
                                <asp:Image ID="Image1" runat="server" ImageUrl="images/Edit.gif" ToolTip="Edit Employee" /> 
                            </a> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn> 
                        <ItemStyle Width="29px" Wrap="false" /> 
                        <HeaderStyle Width="29px" /> 
                        <ItemTemplate> 
                             
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings> 
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" /> 
                <Scrolling AllowScroll="True" ScrollHeight="489px" UseStaticHeaders="True" /> 
            </ClientSettings> 
        </telerik:RadGrid> 
    </div> 
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="clientBenefitDataContext" 
            OrderBy="LastName" TableName="Census" Where="ContactID == @ContactID" OnSelecting="LinqDataSource1_Selecting"
            <WhereParameters> 
                <asp:ControlParameter ControlID="hiddenContactID" DefaultValue="0" Name="ContactID" 
                    PropertyName="Value" Type="Int32" /> 
            </WhereParameters> 
        </asp:LinqDataSource> 

And here is my AjaxManager which is below the grid:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="lblToggle"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadGrid1"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 

This problem has been driving me crazy.  Does anyone see anything I don't?


drpcken
Top achievements
Rank 1
 answered on 29 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?