Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
178 views
Hello,
        I am using RadControls for ASPNET AJAX Q1 2009. 
I am having a RadGrid with filters on different fields. For all filters I am using RadComboBox.
I have referes to the method given for FilterTemplates example for using RadComboBox as filters.
One of the RadGrid column is displaying the Date of record.
But I have to filter this date according to Year only. 
For Ex: If I have 10 dates of year 2005 and 3 dates of 2006. Then the filter combo for date should contain items as 2005 and 2006.
         Hence whenever I select 2005 from filter it should display all dates from year 2005 along with other filters if applicable.

But now I am unable to show the year in RadComboBox filter. Also I am not able to filter on Year.

Please help me regarding this if anyone finds any solution. This is very urgent.

Thanks,
Pinkey
Yavor
Telerik team
 answered on 10 Aug 2009
3 answers
188 views
Hi

This is what I want to acomplish.

1. when i click b1 (postback p1) only p1 to update

2. when i click b2 (postback p2) only p2 and p3 to update

here is the code and why it's not working correct?

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> 
    <div> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
       <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="p1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="p1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="p2">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="p2" /> 
                    <telerik:AjaxUpdatedControl ControlID="p3" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
        </telerik:RadAjaxManager> 
          
        <asp:Panel ID="p1" runat="server">  
            <%= DateTime.Now.ToString() %> 
            <asp:Button ID="b1" runat="server" Text="b1" /> 
        </asp:Panel> 
          
        <asp:Panel ID="p2" runat="server">  
            <%= DateTime.Now.ToString() %> 
            <asp:Button ID="b2" runat="server" Text="b2" /> 
        </asp:Panel> 
 
        <asp:Panel ID="p3" runat="server">  
            <%= DateTime.Now.ToString() %> 
        </asp:Panel> 
 
          
    </div> 
    </form> 
</body> 
</html> 
 
Pavlina
Telerik team
 answered on 10 Aug 2009
3 answers
238 views
Hello Telerik,

The environment:
- I created a form with a RadGrid with 3 levels
- The third level (the question) has a user control that has a RadioButtonList
- The second level (the sub-section) has a RadioButtonList that looks like the other one, to change the value of all the radios in this sub-section
- The first level (the section) just shows the titles
- Screen shot: Here
- The form used has 53 controls, each one of them has a RadioButtonList with 6 options, a RadTextBox and a HiddenField. They are divided in 18 sections, and the header of those sections has also a RadioButtonList with 6 options each. That's a total of 71 RadioBoxLists and 426 radios.

Now, the problem:

- When clicking in any radio in the third level, the CPU of the client goes to 100% for around 1 second. With a slower computer, it goes up to 3 seconds.
- When clicking the radio in the sub-section, it takes a real long time to change the indexes from the inside radios. In a good client computer, around 10 seconds, and up to 30 seconds in a slower one. The following JavaScript function is used:
 
            function ChangeChildScores(QuestionID, ItemIndex, OwnerTableViewID) { 
                var OwnerTableView = document.getElementById(OwnerTableViewID); // The whole table 
                var parentTable = OwnerTableView.getElementsByTagName('table')[ItemIndex]; // The table with the questions 
                var TRs = parentTable.getElementsByTagName('tr'); // TR for each question 
                for (var r = 0; r < TRs.length; r++) { 
                    var inputs = TRs[r].getElementsByTagName('input'); // Radio boxes 
                    for (var i = 0; i < inputs.length; i++) { 
                        if (inputs[i].type == 'radio' && inputs[i].value == QuestionID) { // Checking the radio if the ID is correct 
                            inputs[i].checked = true; 
                        } 
                    } 
                } 
            } 
- It is much faster when using Firefox than Internet Explorer, but Firefox is still really slow.

Finally, the questions:
- Is it possible to improve the performance, or should I just forget using the form decorator?
- The decorator is in my master page. Is it possible to turn it off for a single section?

Thank you very much,
Daniel Schiavini
Martin
Telerik team
 answered on 10 Aug 2009
1 answer
161 views
Hello,

I have read a few threads in this regards but have not yet got my code working for cascading radcombo in edit mode in radgrid!

Here is my code in aspx page:

 

<telerik:RadGrid ID="gv_Users" runat="server" AutoGenerateColumns="False" GridLines="None" Height="100%" Width="100%" AllowPaging="True" AllowSorting="True" PageSize="15" OnNeedDataSource="gv_Users_NeedDataSource" OnItemCreated="gv_Users_ItemCreated" OnItemDataBound="gv_Users_ItemDataBound">

 

 

<MasterTableView DataKeyNames="UserID,ConID,RoleID,Container_Name,Role_Name">

 

 

<ExpandCollapseColumn Visible="False">

 

 

<HeaderStyle Width="19px" />

 

 

</ExpandCollapseColumn>

 

 

<RowIndicatorColumn Visible="False">

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn UniqueName="col_Edit">

 

 

<HeaderStyle Width="50px" />

 

 

<ItemTemplate>

 

 

<span style="white-space: nowrap;">

 

 

<asp:ImageButton ID="btnEdit" runat="server" meta:resourceKey="btnRole_Edit" CommandName="edit" ToolTip="Edit" SkinID="ImgBtnEdit" />

 

 

<asp:ImageButton ID="btnDelete" runat="server" meta:resourceKey="btnRole_Delete" CommandName="remove" ToolTip="Delete" SkinID="ImgBtnDelete" OnClientClick="return confirm_action('Continue with delete? \nContinuer avec la suppression?');" Visible="false" /></span>

 

 

</ItemTemplate>

 

 

<ItemStyle Width="50px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridDropDownColumn UniqueName="ddContainerEdit" ListTextField="Container_Name" ListValueField="Container_Name" DataField="Container_Name" HeaderText="Container_Name" DropDownControlType="RadComboBox" />

 

 

<telerik:GridDropDownColumn UniqueName="ddRoleEdit" ListTextField="Role_Name" ListValueField="Role_Name" DataField="Role_Name" HeaderText="Role_Name" DropDownControlType="RadComboBox" />

 

 

<telerik:GridBoundColumn DataField="UserID" DataType="System.Guid" HeaderText="UserID" UniqueName="col_UserID" meta:resourceKey="col_UserID" SortExpression="UserID" Visible="False">
.......

And here is my code behind page code:

 

 

Protected Sub gv_Users_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gv_Users.ItemCreated

 

 

If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then

 

 

 

 

 

'the combobox will be the first control in the Controls collection of the corresponding cell

 

 

 

 

 

 

 

 

Dim list As RadComboBox= CType(CType(e.Item, GridEditableItem)("ddContainerEdit").Controls(0), RadComboBox)

 

 

'attach SelectedIndexChanged event for the combobox control

 

 

 

 

list.AutoPostBack =

True

 

 

 

 

 

AddHandler list.SelectedIndexChanged, AddressOf Me.ddContainerEdit_SelectedIndexChanged

 

 

End If

 

 

 

 

 

End Sub

 

 

 

 
My error message:
Unable to cast object of type 'System.Web.UI.WebControls.Literal' to type 'Telerik.Web.UI.RadComboBox'.
I have tried changing the index in Controls(0) from 0 to 3 but it still gives me the same above error.

When I try index 4, My error message:
Specified argument was out of the range of valid values. Parameter name: index

Can you help?

Thanks,
Sanjay


Princy
Top achievements
Rank 2
 answered on 10 Aug 2009
6 answers
422 views
I need a little direction here. 

I open a RadWindow from my main page.  Inside the RadWindow I have a button called "Upload".  When clicked, I want to open a second RadWindow.  However, I'm stuck right now because what should open as a second RadWindow is actually replacing the content of the first RadWindow.

How can I solve this problem?  Comments would be appreciated!

Michael
Georgi Tunev
Telerik team
 answered on 10 Aug 2009
0 answers
182 views
how to rebind data of a repeater in a radpanle themplate?

 <div> 
        <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Default2006"> 
            <CollapseAnimation Type="None" Duration="100"></CollapseAnimation> 
            <Items> 
                <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1"> 
                    <Items> 
                        <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1"> 
                            <ItemTemplate> 
                                <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"  
                                    > 
                                    <ItemTemplate> 
                                        <asp:Label ID="Label1" runat="server" Text='<%#bind ("email") %>'></asp:Label> 
                                        <br /> 
                                    </ItemTemplate> 
                                </asp:Repeater> 
                            </ItemTemplate> 
                        </telerik:RadPanelItem> 
                    </Items> 
                </telerik:RadPanelItem> 
            </Items> 
            <ExpandAnimation Type="None" Duration="100"></ExpandAnimation> 
        </telerik:RadPanelBar> 
    </div> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:test %>" 
        SelectCommand="SELECT [Email] FROM [Person]"></asp:SqlDataSource> 
    <asp:Button ID="Button1" runat="server" Text="Button" /> 


sadeghhp
Top achievements
Rank 1
 asked on 10 Aug 2009
1 answer
231 views
Hi,

I have a radGrid to which I am assigning custom filter menu at runtime as given below. When I click on filter menu, I am getting the following error. Any suggestions please.

Error

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Thu, 30 Jul 2009 13:49:43 UTC


Message: Sys.WebForms.PageRequestManagerServerErrorException:  is neither a DataColumn nor a DataRelation for table Table.
Line: 6
Char: 62099
Code: 0
URI: http://localhost:1168/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.701.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ad5b69bca-cfa7-4e0a-9dd0-824ae4c4ef5a%3a16e4e7cd%3af7645509%3a24ee1bba%3a19620875%3a874f8ea2%3a33108d14%3abd8f85e4%3a86526ba7%3aed16cbdc%3a1e771326%3aaa288e2d%3a58366029%3ae330518b%3ac8618e41%3ae4f8f289

 

Default.aspx

<telerik:RadGrid ID="radGrid" runat="server" AutoGenerateColumns="false" AllowPaging="true"
                AllowSorting="true" AllowCustomPaging="true" PageSize="5" AllowFilteringByColumn="false"
                OnPageIndexChanged="radGrid_PageIndexChanged" OnPageSizeChanged="radGrid_PageSizeChanged"
                OnSortCommand="radGrid_SortCommand" OnItemCommand="radGrid_ItemCommand">
                <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" />
                <FilterMenu OnItemClick="FilterMenu_ItemClick"></FilterMenu>
                <ClientSettings Scrolling-AllowScroll="false">
                    <ClientEvents OnColumnContextMenu="ColumnContextMenu" />
                </ClientSettings>
            </telerik:RadGrid>
          
Default.aspx.cs

public void AddCustomGridFilters()
        {
            radGrid.FilterMenu.Items.Clear();
            GridFilterMenu filterMenu = radGrid.FilterMenu;

            RadMenuItem[] radMenuItems = new RadMenuItem[7];
            for (int index = 0; index < radMenuItems.Length; index++)
            {
                radMenuItems[index] = new RadMenuItem();
                radGrid.FilterMenu.Items.Add(radMenuItems[index]);
            }

            radMenuItems[0].Text = Constants.EqualTo;
            radMenuItems[1].Text = Constants.StartsWith;
            radMenuItems[2].Text = Constants.EndsWith;
            radMenuItems[3].Text = Constants.LessThan;
            radMenuItems[4].Text = Constants.GreaterThan;
            radMenuItems[5].Text = Constants.Contains;
            radMenuItems[6].Text = Constants.NoFilter;
        }


Thanks,
Mahesh

Yavor
Telerik team
 answered on 10 Aug 2009
2 answers
97 views

I have 5 RadGrids on a page, registered with RadAjaxManager (AddAjaxSetting(grid, grid, loadingpanel)).

All grids use paging and hook the NeedDataSource() event. 

When I page through one grid, there is no full page refresh, the loading panel appears as expected and paging functions correctly. 

However, when I investigated the very slow paging I discovered that NeedDataSource (and infact all the lifecycle events) was firing on all 5 grids and not just the one that I was actually paging.

Is there any way that the RadAjaxManager could be refreshing all it's AjaxSettings regardless of which control is the trigger?

Thanks,

brian
Yavor
Telerik team
 answered on 10 Aug 2009
1 answer
114 views
Hey,

I am having a problem with a RadDatePicker.  My picker is sitting inside a GridTemplateColumn under the EditItem section.  I am wanting to set the SelectedDate and the MaxDateRange from the codebehind but I cannot figure out how to access the control.  Can you please help me out??


Thanks,

Kyle
Princy
Top achievements
Rank 2
 answered on 10 Aug 2009
1 answer
116 views
Hi all,
I have installed for Insert Command with code in ItemCommand event:
if (e.CommandName == RadGrid.InitInsertCommandName)
            {
                e.Canceled = true;
                e.Item.OwnerTableView.InsertItem();
                e.Item.OwnerTableView.IsItemInserted = true;
                GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();
                String MyUserControlId = GridEditFormItem.EditFormUserControlID;
                UserControl userControl = insertedItem.FindControl(MyUserControlId) as UserControl;               
            }
this run well.

However, I don't know how to find my usercontrol when click Edit command. Please help me!

Thanks!

Princy
Top achievements
Rank 2
 answered on 10 Aug 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?