Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
137 views
I have a grid that has a nested view.  When the parent is expanded depending on the user type I want to hide a column.  I know how to do this for the master table.

RadGrid1.MasterTableView.RenderColumns[10].Display = false; 

but RadGrid2 is a NestedViewTemplate.  When ever I attempt to reference RadGrid2 it tells me it does not exist in current context.  I am assuming I still need to do this in the RadGrid2_PreRender event.
Eric Klein
Top achievements
Rank 1
 answered on 03 Dec 2009
2 answers
157 views
I have a two date pickers on a page. They allow the user to select a from and to date. My page then queries a database and returns all entries within that date range. The page is working fine when you select the date for the first time. However if you change anything and try to submit again the date stays the same as the first time that you picked. Does anyone have any idea why. You can see it here alpha.clickablecommunity.com/printSelect.aspx

Here is my aspx
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.Master"
    CodeBehind="printSelect.aspx.vb" Inherits="ClickableCommunity.printSelect" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="headerContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="viewMenuContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="leftMenu" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="mainContentPlaceHolder" runat="server">
    <telerik:RadFormDecorator ID="formSkin" runat="server" Skin="Web20" DecoratedControls="Buttons" />
    <div style="padding-top: 20px; padding-left: 20px;">
        <h3>Print Events</h3>        
        <table cellpadding="5">
            <tr>
                <td>
                    From:
                    </td>
                    <td>
                    <telerik:RadDatePicker ID="startDate" runat="server" Skin="Web20">
                    </telerik:RadDatePicker>
                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="startDate"
                        ErrorMessage="Please enter a start date." CssClass="errorMessage" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    To:
                </td>
                <td>
                    <telerik:RadDatePicker ID="finishDate" runat="server" Skin="Web20">
                    </telerik:RadDatePicker>
                    <asp:RequiredFieldValidator runat="server" ID="Requiredfieldvalidator2" ControlToValidate="finishDate"
                        ErrorMessage="Please select an end date." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="dateCompareValidator" runat="server" ControlToValidate="finishDate"
                        ControlToCompare="startDate" Operator="GreaterThan" Type="String" ErrorMessage="The end date must be later than the start date."
                        CssClass="errorMessage" Display="Dynamic">
                    </asp:CompareValidator>
                </td>
            </tr>
        </table>

        <asp:Button ID="print" Text="Print" runat="server" />
    </div>
    <asp:Label ID="output" runat="server"></asp:Label>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="footerContent" runat="server">
</asp:Content>

And here is my vb
Imports Telerik.Web.UI
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient

Partial Public Class printSelect
    Inherits System.Web.UI.Page

    'my sql connection string
    Dim conn As String = System.Configuration.ConfigurationManager.ConnectionStrings("connectionString").ToString

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not (Page.IsPostBack) Then
            startDate.SelectedDate = Date.Now
        End If
    End Sub

    Private Sub print_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles print.Click

        Dim beginDate As Date = startDate.DbSelectedDate
        Dim stopDate As Date = finishDate.DbSelectedDate
        Dim html As String

        'my sql connection
        Dim myConn As New Data.SqlClient.SqlConnection(conn)

        'the name of the stored procedure
        Dim strSQL = "getEventsInRange"

        Dim returnCommand As New Data.SqlClient.SqlCommand(strSQL, myConn)

        'add the parameters
        returnCommand.Parameters.AddWithValue("@start", beginDate)
        returnCommand.Parameters.AddWithValue("@stop", stopDate)

        'tell the system it is a stored procedure
        returnCommand.CommandType = CommandType.StoredProcedure

        Try
            myConn.Open()
            Dim dr As SqlDataReader = returnCommand.ExecuteReader()

            html = "<table cellpadding='3' border='0'><tr><td>" & beginDate.ToString & " test " & stopDate.ToString & "</td><td></td></tr>"

            While dr.Read()
                '0 events.name, 1 description, 2 businesses.name,
                '3 starttime, 4 stoptime, 5 locations.street, 6 locations.city, 7 locations.state,
                '8 locations.zip, 9 categories.name, 10businesses.website
                html &= "<tr><td><h3>" & dr.Item(0) & "</h3></td></td></tr>" & _
                        "<tr><td>Start: </td><td>" & dr.Item(3) & "</td></tr>" & _
                        "<tr><td>Stop: </td><td>" & dr.Item(4) & "</td></tr>" & _
                        "<tr><td>Location: </td><td>" & dr.Item(2) & "</td></tr>" & _
                        "<tr><td>Address: </td><td>" & dr.Item(5) & " " & dr.Item(6) & ", " & dr.Item(7) & " " & dr.Item(8) & "</td></tr>" & _
                        "<tr><td>Website: </td><td>" & dr.Item(10) & "</td></tr>" & _
                        "<tr><td>Description: </td><td>" & dr.Item(1) & "</td></tr>" & _
                        "<tr><td>Category: </td><td>" & dr.Item(9) & "</td></tr>"


            End While 'while dr.read()
            html += "</table>"
        Catch ex As Exception
            output.Text = ex.ToString

            'output.Text = ("<span class='textRed'>There was an error in retrieving the entity information,<br>" & _
            '               " please contact the system administrator if the problem persists.</span>")

        End Try
        If (output.Text = "") Then
            output.Text = html & "test"
        End If
    End Sub
End Class



Web Services
Top achievements
Rank 2
 answered on 03 Dec 2009
1 answer
165 views
Hi,

I have created a web part (which is in fact a smart part where the webpart will load a user control) for a sharepoint site. Inside the user control i have a RadGRid (Rad controls version 2009.1.527.20). Now my problem is that i am constantly getting the exception 'Script control 'RadGrid1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl
' at the following line of code 

_control.RenderControl(writer); Here _control is the user control.

Please let me know how to get around this exception. Also do let me know in case u require anyother info or if i am missing something.

Thanks
Kripa

Tsvetoslav
Telerik team
 answered on 03 Dec 2009
1 answer
212 views
Hi
I am using the radcombobox inside the radgrid. While select the radcombobox need to get the container item value in the client side. I can able to get the combobox text & value. But the problem is, I can't get the "Default_StatusENUM" value which is stored in data container.

ASPX:
<telerik:radgrid ID="gvSOComment" runat="server" Width="100%" GridLines="Both" AutoGenerateColumns="False" 
                                AllowSorting="True" ShowStatusBar="true" OnItemCommand="gvSOComment_ItemCommand" 
                                OnItemDataBound="gvSOComment_ItemDataBound"   
                                OnSortCommand="gvSOComment_SortCommand">  
                                <MasterTableView EditMode="InPlace" EnableViewState="true" GroupLoadMode="Client" 
                                    Width="100%" DataKeyNames="WOID, CodeId, Sequence">  
                                    <ItemStyle Width="120px" /> 
                                    <HeaderStyle Width="120px" /> 
                                    <NoRecordsTemplate> 
                                        No Data found.  
                                    </NoRecordsTemplate> 
                                    <Columns> 
                                        <telerik:GridTemplateColumn HeaderText="Comment Type" SortExpression="CodeId" ShowSortIcon="true">  
                                            <ItemTemplate> 
                                                <asp:Label runat="server" ID="lblWorkCode" Width="250px">  
                                                </asp:Label> 
                                            </ItemTemplate> 
                                            <EditItemTemplate> 
                                                <telerik:RadComboBox ID="cmbWorkCode" runat="server" Width="250px" Height="200px" DataValueField="CodeId" 
                                                    DataTextField="CodeName" SortExpression="CodeName" OnClientSelectedIndexChanged="OnClientSelectedIndexChangedEventHandler">  
                                                    <ItemTemplate> 
                                                    <table><tr>  
                                                    <td><%# DataBinder.Eval(Container.DataItem, "CodeName") %></td>  
                                                    <td><%# DataBinder.Eval(Container.DataItem, "Default_StatusENUM") %></td>  
                                                    </tr></table>  
                                                    </ItemTemplate> 
                                                </telerik:RadComboBox> 
                                            </EditItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                    </Columns> 
                                    <EditFormSettings CaptionFormatString="Edit details for Comments with ID {0}" CaptionDataField="WOID">  
                                        <FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle> 
                                        <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle> 
                                        <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle> 
                                    </EditFormSettings> 
                                </MasterTableView> 
                                <ClientSettings> 
                                    <ClientEvents OnColumnClick="ColumnClick" OnGridCreated="GridCreated"></ClientEvents> 
                                </ClientSettings> 
                                <ItemStyle Wrap="True"></ItemStyle> 
                            </telerik:radgrid> 
Java Script:
<script type="text/javascript" 
    function OnClientSelectedIndexChangedEventHandler(sender, eventArgs) {  
        var item = eventArgs.get_item();  
        var dataItem = eventArgs.get_dataItem();  
        alert(dataItem.CodeName);  
        alert(dataItem.Default_StatusENUM);  
    }  
</script> 

Thanks in advance.

Regards,
RAJASEKAR NAMMALVAR
Shinu
Top achievements
Rank 2
 answered on 03 Dec 2009
1 answer
132 views
Hi All,

How can i manage(visible true/false) command item "add new record" in radgrid using c#.

please help me regarding this.
Pavlina
Telerik team
 answered on 03 Dec 2009
2 answers
178 views
I'm having a problem with the RadEditor; using the image and link managers.  We're seeing a lot of instances of a src_iwe attributes.  These attributes appear to be related to the undo/redo functions of the editor.  We've not nailed down how these attributes are being left unhandled; but any input would be appreciated.

<IMG border=0 alt="" align=left src="/images/570790.jpg" width=113 height=131 src_iwe="https://www.sample.com/images/570790.jpg">  
Phil DeVeau
Top achievements
Rank 1
 answered on 03 Dec 2009
1 answer
93 views
Is it possible to set a parent id or class to an Editor so that all of the actual content will be considered a child of that id/class when css is applied in design/preview?  I have a site where the text being entered via the Editor will always be displayed inside a div with id="content" and would like the Editor to display the appropriate styles from my external css file without having to include that div in the content.

Any help or advice would be greatly appreciated.

Eric
Rumen
Telerik team
 answered on 03 Dec 2009
1 answer
74 views
Hi, by using version (2009.3.1103.35) of the editor and setting the css-classes directly in the aspx-tag I´m getting a really peculiar behaviour in IE8. At first the editor seems to be readonly, if you switch to html-mode and back it starts working. In chrome it works as usual. I fixed this behaviour by adding the css-classes in Page_Load instead(!?). Is this expected behaviour? Can you reproduce it? /Regards

Rumen
Telerik team
 answered on 03 Dec 2009
1 answer
136 views
Hi,

I started developing with a single MOSS Site.
In which I build the config for RadEditor.
ToolsFile.xml. (single config)
It has classes, and a custom Style (for the edit and preview window).
In the ToolsFile.xml I uses the <classes> tags to make sure that only the "needed" classes are visible within the "Apply CSS Class" list. Other customizations are custom Paragraphs, snippets etc.
Everything was working as aspect without any problems.

Until..
We have switched to a mutiple branding solution within MOSS.
So there are mutilpe sitecollections running on the same server and all have different styles and layouts.
Therefor I changed the config files tot the ToolsFiles{SiteID}.xml method (mentioned in the FAQ).

This seems to be working fine because the custom snippets, paragraphs and buttons are working.
However. The "Apply CSS Class" dropdown menu stays empty.

any thoughts on this issue?

kind regards,
Erik


I Found out, that if I remove the guid from ToolsFile.xml the Classes appear again in the "Apply CSS Class" dropdown menu

Extra Info Using:
RadControls_for_ASP.NET_AJAX_2009_3_1103_dev.msi
RadEditorMOSS_5_6_dev.zip


Erik
Top achievements
Rank 1
 answered on 03 Dec 2009
7 answers
247 views
I am using the RadFileExplorer with the ExtendedFileProvider essentially unmodified from the samples provided and the sorting is working great but the filtering is not working. I have set the RadFileExplorer.Grid.AllowFilteringByColumn to true so I see the filters on each column but when you select the filter nothing happens.. Is there something else I need to do to enable the filtering?
Fiko
Telerik team
 answered on 03 Dec 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?