Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
249 views
Hi,

I have a case where I don't know which columns that should be generated for a grid until I am in NeedDataSource.
Then I tried to add the columns in that event. I would really like to use the built in EnableColumnViewState since that simplifies a lot, but the problem is that some (most?) properties are lost on postback, for example the HeaderText of the column in the following sample:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication4.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <script runat="server">
        Sub rg_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rg.NeedDataSource
            rg.Columns.Clear()
            Dim col As New Telerik.Web.UI.GridBoundColumn()
            col.DataField = "Col2"
            col.HeaderText = "My header text"
            rg.Columns.Add(col)
             
            Dim dt As New System.Data.DataTable()
            dt.Columns.Add("Col1", GetType(String))
            dt.Columns.Add("Col2", GetType(String))
            For i As Integer = 0 To 10
                dt.Rows.Add({"Row" & i, "Data"})
            Next
            rg.DataSource = dt
        End Sub
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <div>
        <telerik:RadGrid ID="rg" runat="server" AutoGenerateColumns="false">
        </telerik:RadGrid>
        <asp:Button ID="aaa" runat="server" Text="Postback" />
    </div>
    </form>
</body>
</html>

From what I can see in your source code it should work, but it doesn't, or am I missing something?

Regards
Caesar
Caesar
Top achievements
Rank 1
 answered on 15 Feb 2011
1 answer
175 views
Hi, I've searched for the validation term and i'm finding nothing in the results. Is the slider css valid? I'm using a default skin and it will not validate using the w3c validation page, I'm xhtml valid but would like to add the css validation.

This is a Sitefinity based site that I've just uploaded a couple of weeks back, although I do also have the Premium collection independently, the url if a Telerik member of staff would like to use the w3c validation service is at http://www.oaksoft.co.uk to view the results, the errors are virtually all linked to the radslider, I believe,

thanks for any assistance you can give,
regards,
John C.

P.S. Please forgive the freaky amount of time my site takes to load, asp.net is cycling down and taking around 40 seconds to spool back up, the site is quick thereafter, I'm talking to my hoster re this matter...
Tsvetie
Telerik team
 answered on 15 Feb 2011
4 answers
114 views
Hi there,

my browser Chrome was automatically updated monday (I think) from version 8 to version 9  (9.0.597.84)
my release is Q3 2010.3.1109.40 / dotnet 4

All my grids edit forms in MasterTableView.EditFormSettingEditFormType = GridEditFormType.WebUserControl became rendering totally crazy .
I mean really really crazy with part of the control appearing/disappearing just moving the mouse over the control
the form control resizes automatically, subcontrols appears/disappears
nothing logical, no ajax call or postback, just crazy client javascript.

Note : 
- I tested on two different computer
- Safari & Opera are working normally.
- the edit form control ascx has RadTabStrip & RadTabs and RadFormDecorator is used.
- two skins have been tested (Web20 & Default), same results

does anybody encounter the same issue ?

cdt
Francis

Johny
Top achievements
Rank 1
 answered on 15 Feb 2011
1 answer
182 views
Hello,

I am attempting to create a RadPageView and add it to my MultiPage control via JavaScript.

Everything works server side ,but the problem that I have is when I do post backs, it reloads every control in every page view that I create dynamically.

Example:

public void CreateReport(string reportName)
        {
            var tab = new RadTab(reportName);
 
            tabReports.Tabs.Add(tab);
 
            var newView = new RadPageView
                              {
                                  ID = "ReportView" + Guid.NewGuid().ToString().Replace("-", string.Empty)
 
                              };
            newView.Attributes.Add("ReportTitle", reportName);
            multiPage.PageViews.Add(newView);
 
            tab.Selected = true;
            newView.Selected = true;
 
        }

Then I have: 

protected void multiPage_PageViewCreated(object sender, RadMultiPageEventArgs e)
        {
            string reportTitle = e.PageView.Attributes["ReportTitle"];
            e.PageView.Style.Add("padding", "20px;");
            GenerateQuartileReport(reportTitle, e.PageView);
        }
 
        protected void cmdViewChart_Click(object sender, EventArgs eventArgs)
        {
            var button = (RadButton)sender;
            CreateReport(button.CommandArgument);
        }

I have sevaral rad buttons on my page that will create a new tab with page view when clicked, it will generate a report and display it to the customer. This works great, until I go to do anything that requires a post back, such as creating another report. It reloads all my pages that I created and the sub controls that are on those pages.

I am using the RadAjaxManager so I can get the loading panels and stuff.

I have tried wrapping sections in asp:panels and I still get the same result.

Here is my RadAjaxManager and other bits of code:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="pnlMain">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tabReports" />
                <telerik:AjaxUpdatedControl ControlID="multiPage" />
                <telerik:AjaxUpdatedControl ControlID="pnlMain" LoadingPanelID="loadingControl" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadScriptBlock ID="scriptBlock" runat="server">
    <script type="text/javascript">
        var tabStrip = null;
 
        function pageLoad() {
            tabStrip = $find("<%= tabReports.ClientID%>");
        }
 
        function CheckExistingTab(sender, args) {
            var tabText = sender.get_commandArgument();
 
 
            var checkTab = tabStrip.findTabByText(tabText);
 
            if (checkTab) {
                sender.set_autoPostBack(false);
                checkTab.select();
            }
        }
 
    </script>
</telerik:RadScriptBlock>
<telerik:RadAjaxLoadingPanel runat="server" ID="loadingControl" Skin="Black" />


Here are my tabs and multi page:

<telerik:RadTabStrip ID="tabReports" ScrollChildren="true" ScrollButtonsPosition="Middle"
    MultiPageID="multiPage" Orientation="HorizontalTop" runat="server" ShowBaseLine="true"
    Width="1024">
    <Tabs>
        <telerik:RadTab Text="Trend Finding Search" Selected="true" />
    </Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="multiPage" runat="server" CssClass="MultiPageView" OnPageViewCreated="multiPage_PageViewCreated">
    <telerik:RadPageView ID="SearchPage" runat="server" Selected="true">
        <asp:Panel ID="pnlMain" runat="server">

 </asp:Panel>
    </telerik:RadPageView>
</telerik:RadMultiPage>

Inside the first page I have several buttons, but here is one as an example:

<telerik:RadButton ID="RadButton1" Image-EnableImageButton="true" CommandArgument="Report Number 1"
                                                                    runat="server" OnClientClicked="CheckExistingTab"
                                                                    Height="24px" Width="24px">
                                                                    <Image ImageUrl="~/App_Themes/Default/Images/chart.png" />
                                                                </telerik:RadButton>
 
<telerik:RadButton ID="RadButton2" Image-EnableImageButton="true" CommandArgument="Report Number 2"
                                                                    runat="server" OnClientClicked="CheckExistingTab"
                                                                    Height="24px" Width="24px">
                                                                    <Image ImageUrl="~/App_Themes/Default/Images/chart.png" />
                                                                </telerik:RadButton>

Any thoughts to how I can load my tab/pageview without having to reload all my dynamically created page views when I go to create another one?

I was thinking with JavaScript, but there might be a better solution.

Thoughts?

Jason
Dimitar Terziev
Telerik team
 answered on 15 Feb 2011
2 answers
170 views

Hi guys,
I am re-writing aspx page to telerik web control.
And there is a code in aspx page:
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True" PopupButtonID="Image1" PopupPosition="BottomRight"

 

 

 

 

TargetControlID="TextBoxSec4Date1">

 

 

 

 

</cc1:CalendarExtender>
I have no AJAXCONTROLTOOLKIT.What is a similar control in telerik that I can use it?
This is not inside the grid.

Thanks so much for your help

 

Vasya Ivanov
Top achievements
Rank 1
 answered on 15 Feb 2011
2 answers
114 views
I've often wondered why it is that we can have only one RadScriptManager on a page and we can have only one RadAjaxManager on a page but we can have lots of RadWindowManagers on a page.

I have to say that my life would have been easier if I could have just said RadWindowManager.GetCurrent(Page) on more than one occasion. 

Just an idle question.

-- 
Curious of Grantham
Stuart Hemming
Top achievements
Rank 2
 answered on 15 Feb 2011
2 answers
129 views
I am using a RadContextMenu and RadGrid in combiation. The RadContextMenu is showing possible actions for a row in the RadGrid. Some of the actions are loading using a WCF service.

After upgrading to .NET 4.0 this has stopped working.

Using Firebug I can see that the RadContextMenu is getting the extra actions from the WCF service and the menu that appears is sized as if there is something to display, but its all blank and nothing happens when I click in it.

I am using VS2010, IIS7, the latest Telerik version, ASP.NET 4.0.

Hope someone can offer some help.

Regards
Thomas

My menu:
<telerik:RadContextMenu ID="rcmLines" runat="server" OnItemClick="rcmLines_ItemClick" >
  <WebServiceSettings Path="~/BudgetServices.svc" Method="GetEntryAccountMenuItems" />
  <Items>
    <telerik:RadMenuItem Text="Ignore" Value="I" />
    <telerik:RadMenuItem Text="Locate pair" Value="P" />
    <telerik:RadMenuItem Text="Set entry account" ExpandMode="WebService" >
      <GroupSettings Height="300px" />
    </telerik:RadMenuItem>
  </Items>
</telerik:RadContextMenu>

The JavaScript invoked from the RadGrid:
    function PopLineMenu(sender, eventArgs) {
      var menu = $find("<%= rcmLines.ClientID %>");
      var evt = eventArgs.get_domEvent();

      if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
        return;
      }

      var index = eventArgs.get_itemIndexHierarchical();
      document.getElementById("lineIndex").value = index;

      sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);

      menu.show(evt);

      evt.cancelBubble = true;
      evt.returnValue = false;

      if (evt.stopPropagation) {
        evt.stopPropagation();
        evt.preventDefault();
      }
    }
 
The method being called:
        [OperationContract]
        public RadMenuItemData[] GetEntryAccountMenuItems() {
            var list = AppContext.DefaultAccountPlan.NonSumEntryAccounts;
            var array = list.ConvertAll(x => new RadMenuItemData {Text = x.NameAndNumber, Value = "Id:"+x.Id}).ToArray();
            
            return array;
        }


Marco
Top achievements
Rank 1
 answered on 15 Feb 2011
3 answers
493 views
Hi there,

Is there a way to DISABLE the Enter Key's functionality while in Edit/Insert Mode? I have tried a couple different Java functions and also played with the "AllowKeyboardNavigation" Client Setting on the grid but have had no luck.

Currently the problem only occurs only while in Edit/Insert Mode, and causes Clients to lose information entered in the Edit/Insert Form if they accidentally hit the enter key.

Any Ideas?

Regards,

Landon

Landon
Top achievements
Rank 2
 answered on 15 Feb 2011
1 answer
98 views
Hi,

We have a page where the RADEditor is used to render rich text content. The page works fine when it is deployed stand alone. When we deploy the page as a content page in a sharepoint site, the RADEditor is not populating the content.

The only difference i can see is that, when the page is rendered from a CMS we have document.domain being set to a specific domain.

eg. document.domain  = 'test.com'

We use the following version - Telerik RadControls for ASP.NET Ajax --> v2.0.50727 (2008.3.1314.35)

Can someone please help me with this issue.

Thanks,
Sudhakar G
Stanimir
Telerik team
 answered on 15 Feb 2011
4 answers
183 views
Hello Telerik,

I have this in my .ASPX page:

<div id="divTabs" runat="server">
    <telerik:RadTabStrip ID="rtsArticles" runat="server" SelectedIndex="0" MultiPageID="rmpArticles" Skin="Default" Width="100%">
      </telerik:RadTabStrip>
      <telerik:RadMultiPage ID="rmpArticles" runat="server" SelectedIndex="0" Height="100%" Width="100%">
      </telerik:RadMultiPage>
</div>
<div id="divGroups" runat="server">
    <asp:Panel ID="pnlGroups" runat="server">
        <asp:Repeater ID="rptGroups" runat="server" EnableTheming="True" OnItemDataBound="GroupRepeater_ItemDataBound">
            <ItemTemplate>
                    <div id="divDivGroups" runat="server" style="border-bottom:1px dashed silver;">
                     <asp:Label ID="hlGroups" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "group_text") %>'></asp:Label>
                    </div>
            </ItemTemplate>
        </asp:Repeater>
    </asp:Panel>
</div>

I am trying to create dynamic Tabs in a single Tabstrip that points to dynamic PageViews in a single MultiPage with the dynamic PageViews pointing to dynamic Contents within dynamic UserControls.

I have this in my code behind:

Protected Sub GroupRepeater_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs)
Dim item As RepeaterItem
  item = e.Item
  Dim userCtrl As HtmlControl = item.FindControl("divDivGroups")
  If item.ItemType = ListItemType.Item Or item.ItemType = ListItemType.AlternatingItem Then
        Dim strGroupNumber As String = item.DataItem("group_id").ToString
        Dim tab As New RadTab
        Dim rtsArticles As RadTabStrip
        Dim rpageView As New RadPageView
        Dim rmpArticles As RadMultiPage 
        tab.Text = strGroupNumber
        tab.PageViewID = "rpv" & strGroupNumber
        rtsArticles = item.Parent.Parent.Parent.Parent.FindControl("divTabs").FindControl("rtsArticles")
        rtsArticles.Tabs.Add(tab)
        rpageView.ID = "rpv" & strGroupNumber
        userCtrl.ID = "divUser" & strGroupNumber
        rmpArticles = item.Parent.Parent.Parent.Parent.FindControl("divTabs").FindControl("rmpArticles")
        rpageView.Controls.Add(userCtrl)
        rmpArticles.PageViews.Add(rpageView)
    End If
End Sub

I can't seem to make it work.

Any ideas, suggestions, feedback or sample application would be much appreciated.

Thanks in advance,

Virgil Rodriguez


Virgil Rodriguez
Top achievements
Rank 1
 answered on 15 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?