Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
59 views
Hi. I'm programming an application that works weekly, setting the raddatepicker mindate and maxdate between monday and next sunday (I'm from Spain). All works fine for me with the exception when weeks are between two months (i.e. mindate 01/31/2011 and maxdate 02/06/2011). I view in the calendar the final month selected (i.e. february), I can select the previous days of january but I want to view these days "active" (in bold style) like the rest of february days in the same week. How can I do that?

Thanks in advance.
Maria Ilieva
Telerik team
 answered on 10 Feb 2011
3 answers
313 views
Hello,

Let me explain my situation I can not solve that contains a RadGrid.

In the name WebUserControl ListTable.ascx I put inside a RadGrid that lists my records and a select button and Delete.

Then I create a control named ViewModules.ascx.

Inside ViewModules.ascx I create dynamically in my div PlaceHolder and using a variable in my QueryString, add dynamically in my ListTable.ascx PlaceHolder.

I put in my Session variable control ListTable.ascx then replaced in the page when I press a Delete event of RadGrid is within ListTable.ascx.

You find my code below because I can not provide an example as it uses several library of our platform.

Have you any idea how to make my event the delete button or trigger and be able to see more control in my page?

You will find 3 screenshots that show you the steps to view my shares.

This error only happens with all Telerik controls. If I use Microsoft's control that we have by default with Visual Studio, my control works without error.

Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    If Me.IsPostBack AndAlso Not Session.Item("ViewModule") Is Nothing Then
        ModuleItemPlaceHolder.Controls.Add(DirectCast(Session.Item("ViewModule"), Control))
        Session.Remove("ViewModule")
    End If
End Sub
 
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Me.IsPostBack Then
        Dim site As CMS.Site.Item = CMS.Site.Provider.GetSite(Application)
        If Not site Is Nothing Then
            InitHeader(site)
            If Me.ModuleType = [Module].Enumeration.ModuleType.None Then
                ' Loading module icons
                ViewIcons(site)
            Else
                ' Loading module
                ViewModule(site)
            End If
        End If
    End If
End Sub
 
Private Sub ViewModule(ByVal site As CMS.Site.Item)
    Session.Remove("ViewModule")
    If Me.ModuleType = [Module].Enumeration.ModuleType.None Then
        Response.Redirect(String.Concat(site.Url, "/Gestion/"))
    Else
        Select Case True
            Case Me.ModuleType = [Module].Enumeration.ModuleType.News OrElse Me.ModuleType = [Module].Enumeration.ModuleType.SlideShows OrElse _
                 Me.ModuleType = [Module].Enumeration.ModuleType.Testimonials OrElse Me.ModuleType = [Module].Enumeration.ModuleType.User
 
                If Me.RecordID Is Nothing OrElse Not IsNumeric(Me.RecordID) Then
                    Dim ctrl As CMS.Controls.ListTable = DirectCast(LoadControl("~/CMSControls/Generic/ListTable.ascx"), CMS.Controls.ListTable)
                    ctrl.Module = Me.ModuleType
                    ctrl.EnableNewRecord = True
 
                    Dim handled As Boolean = False
                    RaiseEvent InitListTable(ctrl, handled)
 
                    Session.Add("ViewModule", ctrl)
                    ModuleItemPlaceHolder.Controls.Add(ctrl)
                Else
 
                End If
        End Select
    End If
End Sub
Maxime Bellemare
Top achievements
Rank 2
 answered on 10 Feb 2011
4 answers
223 views
Hi,
I'm having problem with calculated column in RadGrid (2010-02).  Code:
...
<telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" UniqueName="colQuantity"></telerik:GridBoundColumn>
<
telerik:GridBoundColumn DataField="Price" HeaderText="Price" SortExpression="Price" UniqueName="colPrice" DataFormatString="{0:C}"></telerik:GridBoundColumn>
                           
<
telerik:GridCalculatedColumn  HeaderText="Total Cost" UniqueName="colTotalCost" DataType="System.Double" DataFields="Quantity, Price" Expression="{0}*{1}" />
...

Columns Price and Quantity are correct, without calculated column it is grid OK, but when I add it, I got cryptic error:

')' or ',' expected

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Telerik.Web.UI.ParseException: ')' or ',' expected


Can anybody tell me, what's wrong?

Thank you,
Zdenek
Pavlina
Telerik team
 answered on 10 Feb 2011
1 answer
128 views
Hi,

I have a series of RegularExpressionValidators in an asp:panel which is marked Visible="false".  This panel is later made visible and the page is updated with a RadAjaxManagerProxy control.  When I later submit the form, using a button in the same panel, one of the RegularExpressionValidators does not fire.  It does not even fire on the server-side.  What can I do to resolve this?

Thanks.
Craig Wallace
Top achievements
Rank 1
 answered on 10 Feb 2011
1 answer
55 views

I need a bigger icons (48x48 or more) used in grid Skins Default, Office 2007 to use them in my user manual document. Because of high resolution of document for printing the existing icons (16x16) does not look good scaled. I have downloaded the Grid.PSD files from your site but there still icons in size 16x16 pixels. Can you send me the bigger icons ?

I use the Telerik.Web.UI.dll  with Product Version =2009.02.0826.35

Pavlina
Telerik team
 answered on 10 Feb 2011
1 answer
82 views
Hi,

I am having some issues with getting the RadTreeView and RadAjaxManager to work. After the page loads for the first time, I am still able to collapse/expand the RadTreeView that I've added on the page. As soon as I select and item from the dropdownlist to update the RadTreeView, it no longer allows me to expand/collapse or even click the the nodes. I don't get any errors either.

Note that the code below is inside a ".ascx" file which will be used as a SharePoint webpart. I am currently using VS2010, .NET Framework 3.5, MOSS 2007.

Please help.

Thank you so much!

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
<AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="dropdownlist1" EventName="onselectedindexchanged">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID = "RadTreeView1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadTreeView ID="RadTreeView1" runat="server">
        <Nodes>
            <telerik:RadTreeNode runat="server" Text="Root RadTreeNode1">
                <Nodes>
                    <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 1">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 2">
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeNode>
            <telerik:RadTreeNode runat="server" Text="Root RadTreeNode2">
            </telerik:RadTreeNode>
        </Nodes>
    </telerik:RadTreeView>
<asp:DropDownList ID="drpTaxonomyType" runat="server"
                CssClass="taxonomy_type"
                onselectedindexchanged="drpTaxonomyType_SelectedIndexChanged"
                AutoPostBack="True">
        <asp:ListItem Selected="True">Choose One</asp:ListItem>
        <asp:ListItem>Practice Areas</asp:ListItem>
        <asp:ListItem>Geography</asp:ListItem>
        <asp:ListItem>Court</asp:ListItem>
        <asp:ListItem>Industry</asp:ListItem>
    </asp:DropDownList>

Master page:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
   </telerik:RadScriptManager>
Maria Ilieva
Telerik team
 answered on 10 Feb 2011
5 answers
127 views
I have a RadGrid that is filled with a SqlDataSource and an Export to ExcelML button that throws the following error when i try to export it:

Telerik.Web.UI.NullEnumerableException: Cannot perform this operation when DataSource is not assigned

There is obviously data in the grid so the DataSource must be assigned. I can find no reference to this error anywhere.
Daniel
Telerik team
 answered on 10 Feb 2011
5 answers
568 views
Hi,

I'm testing the new Auto Resize facility and so far, it has not been successful.

function openRadWin(id) { 
            radopen("http://www.telerik.com""radWindowFareRules"); 
        } 

Above is the example test Javascript I used to open my RadWindow.

<telerik:RadWindowManager ID="radWindowManager" runat="server" AutoSize="True"  
                Behavior="None" InitialBehavior="None"  
                KeepInScreenBounds="True"
            <Windows> 
                <telerik:RadWindow  
                    id="radWindowFareRules"  
                    runat="server" 
                    showcontentduringload="false" 
                    title="Telerik RadWindow" Behavior="Close" AutoSize="true" 
                    KeepInScreenBounds="True" Modal="True" Overlay="True" 
                    VisibleStatusbar="False"
                </telerik:RadWindow> 
            </Windows> 
            </telerik:RadWindowManager> 


This is my page content where I have my RadWindows and my RadWindowManager.

When the RadWindow opens up, it does not resize by the content size eventhough I have set AutoSize to be true. I assumed it will do the work and resize itself but it didn't.

So I tried the old method that people said have been useful.

In my default page, I had this code as my javascript code.

<script type="text/javascript"
        function openRadWin(id) { 
            radopen("FareRules.aspx?id=" + id, "radWindowFareRules"); 
        } 
 
        function GetRadWindow() { 
            var oWindow = null
            if (window.radWindow) oWindow = window.radWindow; 
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; 
            return oWindow; 
        } 
 
        function resetWindow() { 
            window.setTimeout(function() { 
                var oWnd = GetRadWindow(); 
                oWnd.SetWidth(300px); 
                oWnd.SetHeight(200px); 
            }, 400); 
        } 
    </script> 

And in my FareRules.aspx page, I had this Javascript

<script type="text/javascript"
        function resizeWindow() { 
            window.setTimeout(function() { 
                var oWnd = GetRadWindow(); 
                oWnd.SetWidth(document.body.scrollWidth + 20); 
                oWnd.SetHeight(document.body.scrollHeight + 70); 
            }, 400); 
        } 
        
        function GetRadWindow() 
        { 
            var oWindow = null
            if (window.radWindow) oWindow = window.radWindow; 
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; 
            return oWindow; 
        } 
    </script> 

And on page's body Onload, I called resizeWindow method which seemed to work fine. On execution, the window seemed to resize based on the contents. However, the problem I had with that is that when I close to RadWindow and open it the 2nd time, the 2nd execution opens with the size of the 1st execution and then resizes. So if 1st execution had contents that was in the size of 800x600, then 2nd execution starts as 800x600 and then resizes to the 2nd execution's content which can be like 640x480. I want all the RadWindows to start with it's default small size and then expand to fit the content. Is it achievable?

Please let me know if I made any mistakes or if you require anymore info regarding this problem. I want to find a solution for this.

Svetlina Anati
Telerik team
 answered on 10 Feb 2011
1 answer
48 views
...curious
Georgi Tunev
Telerik team
 answered on 10 Feb 2011
1 answer
110 views
I have a Radgrid control on a page that users a master/detail table to display data. In this scenario not every master record will have a detail record so I don't want to display the No Record line item.  This all works fine on the initial load of the page and grid, see image 1.  When a user selects a filter such a Region or Client is when I start having problems, see image 2.  All of the details rows are now displayed even it there is not data.  I've tried several of the code examples online but can't seem to get them working with the filters.

<telerik:RadGrid ID="rgVendors" runat="server" Skin="Web20" DataSourceID="edsVendors" 
                    ShowStatusBar="true" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
                    AllowPaging="True" AllowAutomaticDeletes="true" GridLines="None" PageSize="25"
                    SortingSettings-EnableSkinSortStyles="false" OnDetailTableDataBind="rgVendors_DetailTableDataBind"
                    OnItemCommand="rgVendors_ItemCommand" OnItemEvent="rgVendors_ItemEvent" OnItemDataBound="rgVendors_ItemDataBound"
                    OnDeleteCommand="rgVendors_DeleteCommand" OnSelectedIndexChanged="rgVendors_SelectedIndexChanged"
                    OnPreRender="rgVendors_PreRender">
                    <MasterTableView DataKeyNames="ClientID,VendorID,VendorDetailID" Name="rgMaster" HierarchyLoadMode="ServerBind"
                        HierarchyDefaultExpanded="true" HeaderStyle-BackColor="#7FA5D7" ItemStyle-BackColor="#B0C4DE"
                        AlternatingItemStyle-BackColor="White">
                        <Columns>
                            <telerik:GridButtonColumn Text="Select" UniqueName="Select" CommandName="Select">
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn DataField="VendorDetailID" ReadOnly="true" Visible="false"
                                UniqueName="VendorDetailID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Client.ClientID" ReadOnly="true" UniqueName="ClientID"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Client Name" DataField="Client.ClientName" UniqueName="ClientName"
                                HeaderStyle-Width="100px" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Vendor Name" DataField="Vendor.VendorName" UniqueName="VendorName"
                                ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Service Provided" DataField="VendorService.ServiceName"
                                UniqueName="ServiceName" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Address" HeaderStyle-Width="150px">
                                <ItemTemplate>
                                    <asp:Label ID="Address" runat="server" Text='<%# Eval("Vendor.Address") %>'></asp:Label><br />
                                    <asp:Label ID="City" runat="server" Text='<%# Eval("Vendor.City") %>'></asp:Label><br />
                                    <asp:Label ID="State" runat="server" Text='<%# Eval("Vendor.State") %>'></asp:Label><br />
                                    <asp:Label ID="Zip" runat="server" Text='<%# Eval("Vendor.Zip") %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Phone<br>Email<br>Website" HeaderStyle-Width="100px">
                                <ItemTemplate>
                                    <asp:Label ID="Phone" runat="server" Text='<%# Eval("Vendor.Phone") %>'></asp:Label>
                                    <br />
                                    <asp:Label ID="Email" runat="server"><a href='mailto:<%# DataBinder.Eval(Container.DataItem, "Vendor.Email")%>'><%# DataBinder.Eval(Container.DataItem, "Vendor.Email")%></a></asp:Label>
                                    <br />
                                    <asp:HyperLink ID="hlWebsite" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "Vendor.WebSite")%>'
                                        Text='<%# DataBinder.Eval(Container.DataItem, "Vendor.WebSite")%>' Target="_blank"></asp:HyperLink>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Notes">
                                <ItemTemplate>
                                    <asp:Label ID="Notes" runat="server" Text='<%# Eval("Vendor.Notes") %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridButtonColumn ConfirmText="Delete this Client Vendor?" ConfirmDialogType="RadWindow"
                                ConfirmTitle="Delete" ButtonType="ImageButton" ImageUrl="..\Icons\close.gif"
                                CommandName="Delete" />
                        </Columns>
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="VendorID,VendorContactID" Name="rgDetail" Width="100%"
                                runat="server" ItemStyle-BackColor="#6288C2" AlternatingItemStyle-BackColor="#6288C2"
                                AllowAutomaticDeletes="true">
                                <Columns>
                                    <telerik:GridButtonColumn Text="Edit Contact" UniqueName="Select" CommandName="Select">
                                    </telerik:GridButtonColumn>
                                    <telerik:GridBoundColumn DataField="VendorContactID" ReadOnly="true" UniqueName="ClientID"
                                        Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn HeaderText="Contact Name">
                                        <ItemTemplate>
                                            <asp:Label ID="ContactName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Address" HeaderStyle-Width="150px">
                                        <ItemTemplate>
                                            <asp:Label ID="Address" runat="server" Text='<%# Eval("Address") %>'></asp:Label><br />
                                            <asp:Label ID="City" runat="server" Text='<%# Eval("City") %>'></asp:Label><br />
                                            <asp:Label ID="State" runat="server" Text='<%# Eval("State") %>'></asp:Label><br />
                                            <asp:Label ID="Zip" runat="server" Text='<%# Eval("Zip") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Phone">
                                        <ItemTemplate>
                                            <asp:Label ID="Phone" runat="server" Text='<%# Eval("Phone") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Email<br>Website" HeaderStyle-Width="100px">
                                        <ItemTemplate>
                                            <asp:Label ID="Email" runat="server"><a href='mailto:<%# DataBinder.Eval(Container.DataItem, "Email")%>'><%# DataBinder.Eval(Container.DataItem, "Email")%></a></asp:Label>
                                            <br />
                                            <asp:HyperLink ID="hlWebsite" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "WebSite")%>'
                                                Text='<%# DataBinder.Eval(Container.DataItem, "WebSite")%>' Target="_blank"></asp:HyperLink>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Notes">
                                        <ItemTemplate>
                                            <asp:Label ID="Notes" runat="server" Text='<%# Eval("Notes") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridButtonColumn ConfirmText="Delete this Vendor Contact?" ConfirmDialogType="RadWindow"
                                        ConfirmTitle="Delete" ButtonType="ImageButton" ImageUrl="..\Icons\close.gif"
                                        CommandName="Delete" />
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                    </MasterTableView>
                    <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true"
                        HideStructureColumns="true" Pdf-PageBottomMargin=".5" Pdf-PageTopMargin=".5"
                        Pdf-PageLeftMargin=".5" Pdf-PageRightMargin=".5" Pdf-PaperSize="Legal" Pdf-PageWidth="356mm"
                        Pdf-PageHeight="216mm" />
                    <PagerStyle Position="TopAndBottom" />
                </telerik:RadGrid>
                <asp:EntityDataSource ID="edsVendors" runat="server" ConnectionString="name=ProNetData"
                    DefaultContainerName="ProNetData" EnableDelete="true" EnableUpdate="False" EntitySetName="VendorDetails"
                    AutoGenerateWhereClause="false" Include="Vendor,VendorService,Client,RiskAssessment"
                    Where="(it.Client.ClientID = @ClientID or @ClientID is null)
                            and (it.Vendor.VendorID = @VendorID or @VendorID is null)
                            and (it.VendorService.VendorServiceID = @VendorServiceID or @VendorServiceID is null)  
                            and (it.Client.RegionID = @RegionID or @RegionID is null)                         
                            and (it.RiskAssessment.IsCurrent = true)" OrderBy="it.Client.ClientName">
                    <WhereParameters>
                        <asp:ControlParameter ControlID="ddlRegionFilter" Name="RegionID" DbType="Int32"
                            ConvertEmptyStringToNull="true" />
                        <asp:ControlParameter ControlID="ddlClientNameFilter" Name="ClientID" Type="Int32"
                            ConvertEmptyStringToNull="true" />
                        <asp:ControlParameter ControlID="ddlVendorNameFilter" Name="VendorID" Type="Int32"
                            ConvertEmptyStringToNull="true" />
                        <asp:ControlParameter ControlID="ddlServiceNameFilter" Name="VendorServiceID" Type="Int32"
                            ConvertEmptyStringToNull="true" />
                    </WhereParameters>
                </asp:EntityDataSource>

protected void rgVendors_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
   {
       GridDataItem dataItem = e.DetailTableView.ParentItem;
       int vendorID = int.Parse(dataItem.GetDataKeyValue("VendorID").ToString());
       int clientID = int.Parse(dataItem.GetDataKeyValue("ClientID").ToString());
       using (ProNetData d = new ProNetData())
       {
           var contacts = (from c in d.VendorContacts
                           where c.VendorID == vendorID && c.ClientID == clientID
                           select new
                           {
                               VendorID = c.VendorID,
                               VendorContactID = c.VendorContactID,
                               Name = c.Name,
                               Address = c.Address,
                               City = c.City,
                               State = c.State,
                               Zip = c.Zip,
                               Phone = c.Phone,
                               Email = c.Email,
                               Website = c.Website,
                               Notes = c.Notes
                           }).ToList();
           e.DetailTableView.DataSource = contacts;
       }
   }

protected void rgVendors_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
   {
       if (e.CommandName == RadGrid.ExpandCollapseCommandName)
       {
           foreach (GridItem item in e.Item.OwnerTableView.Items)
           {
               if (item.Expanded && item != e.Item)
               {
                   item.Expanded = false;
               }
           }
       }
   }

protected void rgVendors_PreRender(object sender, EventArgs e)
    {
        HideExpandColumnRecursive(rgVendors.MasterTableView);
  
    }
  
  
    public void HideExpandColumnRecursive(GridTableView tableView)
    {
        GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
        foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
        {
            foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
            {
                if (nestedView.Items.Count == 0)
                {
                    nestedView.ParentItem.Expanded = false;
                }
  
                else
                {
                    nestedView.ParentItem.Expanded = true;
                }
            }
        }      
    }
Pavlina
Telerik team
 answered on 10 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?