Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
1.4K+ views
hi,

I have rad grid control and it has template Column, i want to find the control ID(e.g rtpTime)  inside the rad grid using java script.
As well as im using Master page.
Can you plz tell me the way of doing this, because this is ugent.

 <telerik:GridTemplateColumn HeaderText="Time" UniqueName="time" > 
            <EditItemTemplate> 
                <telerik:RadTimePicker ID="rtpTime" runat="server" > 
                </telerik:RadTimePicker> 
                 </EditItemTemplate> 
            <ItemTemplate> 
            <asp:Label ID="lbltime" runat="server" Text='<%# Eval "Time","{0:t}") %>' ></asp:Label> 
            </ItemTemplate> 
        </telerik:GridTemplateColumn> 

Thanks
Waruni
Radoslav
Telerik team
 answered on 04 Aug 2011
3 answers
115 views
Hi,

I have recently upgraded my project to use .Net 4.0 and all seemed fine until I started trying to run some reports using Crystal which were all fine previously.  I get the following error when I try to run the report and print to PDF. The message seems to indicate some issue with the Script Manager or Compression, both of which are enabled.

  SCRIPT5007: 'undefined' is null or not an object  Telerik.Web.UI.WebResource.axd?
_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-GB%3a1f68db6e-ab92-4c56-8744-13e09bf43565%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.3.1317.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-GB%3a9506cff2-3a86-46c5-b869-6ba1478f3c27%3a16e4e7cd%3af7645509%3a24ee1bba%3af46195d3%3a1e771326%3aaa288e2d%3a19620875%3a874f8ea2%3a490a9d4e%3abd8f85e4%3aed16cbdc, line 6 character 55898

length,n=b.length;g<n;g++,m++)d[m]=b[g]}else if(typeof b==="object"&&Object.getType(b)===Object){d=f.apply(a);Sys$Component$_setProperties(d,b)}}}if(h)a.endUpdate()}function Sys$Component$_setReferences(c,b){for(var a in b){var e=c["set_"+a],d=$find(b[a]);e.apply(c,[d])}}var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,b=Sys.Application,i=b.get_isCreatingComponents();a.beginUpdate();if(f)Sys$Component$_setProperties(a,f);if(d)for(var e in d)a["add_"+e](d[e]);if(a.get_id())b.addComponent(a);if(i){b._createdComponents[b._createdComponents.length]=a;if(c)b._addComponentToSecondPass(a,c);else a.endUpdate()}else{if(c)Sys$Component$_setReferences(a,c);a.endUpdate()}return a};Sys.UI.MouseButton=function(){throw Error.notImplemented()};Sys.UI.MouseButton.prototype={leftButton:0,middleButton:1,rightButton:2};Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");Sys.UI.Key=function(){throw Error.notImplemented()};Sys.UI.Key.prototype=

When I debug the following line is highlighted (shown in bold below):

{backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127};Sys.UI.Key.registerEnum("Sys.UI.Key");Sys.UI.Point=function(a,b){this.x=a;this.y=b};Sys.UI.Point.registerClass("Sys.UI.Point");Sys.UI.Bounds=function(c,d,b,a){this.x=c;this.y=d;this.height=a;this.width=b};Sys.UI.Bounds.registerClass("Sys.UI.Bounds");Sys.UI.DomEvent=function(e){var a=e,b=this.type=a.type.toLowerCase();th


Any ideas why this is happening?

Dave Penny
David Penny
Top achievements
Rank 2
 answered on 04 Aug 2011
1 answer
89 views
Hi,

I am using telerik grid and editfromtemplate, and what happen is that whenever I refresh the page after inserting a record in telerik grid. It makes one more entry in the grid and in the database. I want to prevent this behaviour of grid because it's causing duplicate number of records in my grid.

Imports Telerik.Web.UI
 
Partial Class SNR_Config
    Inherits System.Web.UI.UserControl
 
    Private dbContext As New SNRDentonDBLayerDataContext
 
   Protected Sub rgConfiguration_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgConfiguration.NeedDataSource
 
        BindGrid()
 
    End Sub
 
    Protected Sub BindGrid()
 
        Dim IConfig = From Config In dbContext.SNR_Configurations Order By Config.ID Descending
              Select Config
 
        rgConfiguration.DataSource = IConfig.ToList
 
 
    End Sub
 
 
    Protected Sub rgConfiguration_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgConfiguration.ItemCommand
 
        If e.CommandName = RadGrid.PerformInsertCommandName Then
            Insert(e)
        ElseIf e.CommandName = RadGrid.UpdateCommandName Then
            Update(e)
        ElseIf e.CommandName = "Delete" Then
            Delete(e)
        End If
 
    End Sub
 
    Protected Sub Insert(ByVal e As Telerik.Web.UI.GridCommandEventArgs)
 
        If TypeOf e.Item Is GridEditFormInsertItem AndAlso e.Item.IsInEditMode Then
 
            If e.Item.OwnerTableView.IsItemInserted Then
 
                Dim txtKey As TextBox = e.Item.FindControl("txtKey")
                Dim txtValue As TextBox = e.Item.FindControl("txtValue")
                Dim chkIsAdmin As CheckBox = e.Item.FindControl("chkIsAdmin")
 
                Dim con As New SNR_Configuration
                con.ConfigKey = txtKey.Text.Trim
                con.ConfigValue = txtValue.Text.Trim
                con.CreatedOn = DateTime.Now
                con.CreatedBY = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.UserID
                con.IsDeleted = False
                con.IsAdmin = IIf(chkIsAdmin.Checked, True, False)
 
                dbContext.SNR_Configurations.InsertOnSubmit(con)
                dbContext.SubmitChanges()
 
            End If
 
        End If
 
    End Sub
 
    Protected Sub rgConfiguration_ItemDataBound(ByVal source As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgConfiguration.ItemDataBound
 
 
        If TypeOf e.Item Is GridEditableItem And e.Item.IsInEditMode Then
 
            If TypeOf e.Item Is GridEditableItem And TypeOf e.Item Is GridEditFormInsertItem Then
 
                Dim btnInsert As Button = e.Item.FindControl("btnInsert")
                btnInsert.Visible = True
 
            Else
 
                Dim btnUpdate As Button = e.Item.FindControl("btnUpdate")
                btnUpdate.Visible = True
 
            End If
 
        End If
 
 
    End Sub
    
 
 
 
End Class
Tsvetina
Telerik team
 answered on 04 Aug 2011
11 answers
533 views
We have a RadGrid that has mostly bound columns but a few template columns.  When grouping by any or all of the bound columns and then the template columns, there are no issues.  However, when choosing a template column first and then a bound column, we always get the error "An error occured adding a relation to DataRelationCollection. Please, make sure you have configured the expressions properly - both GroupByFields and SelectFields are required".
Pavlina
Telerik team
 answered on 04 Aug 2011
2 answers
130 views
hi i want to set mastertableview itemtemplate from code behind
like this example :
http://www.telerik.com/help/aspnet/grid/grdprogrammaticcreation.html
but for the mastertableview itemtemplate not the column itemtemplate 
Tsvetina
Telerik team
 answered on 04 Aug 2011
3 answers
230 views
I am following this forum post:
 http://www.telerik.com/community/forums/thread/b311D-mgcch.aspx

I can get the MasterTableView successfully client side, but when I do this:
var rows = $find(this._gridid).MasterTableView.SelectedRows;
rows is undefined

The grid I am using is a custom rad grid that inherits from RadGrid
public class CustomRadGrid : RadGrid  
 
{  
 
public CustomRadGrid(){  
 
 
ClientSettings.Selecting.EnableDragToSelectRows = false;  
 
ClientSettings.Resizing.AllowColumnResize = true;  
 
MasterTableView.AllowFilteringByColumn = false;  
 
EnableEmbeddedSkins = false;  
 
AllowMultiRowSelection = true;  
 
ClientSettings.Selecting.AllowRowSelect = true;  
 
 
}  
 
}   
 
 


The above snippet is just a portion of my class

Does anyone have any idea why SelectedRows would be undefined?

I originally had this posted in the older (non ajax) forum, so you may see a duplicate of this message there.

Thanks!
Nicole

Genti
Telerik team
 answered on 04 Aug 2011
1 answer
127 views

I started using Telerik controls for past 3 weeks…..

I am creating a Rad Grid Programmatically based on let’s say Query 2: is how many columns it is going to return from database. Query 2 results are based on Query1.

 

If Query 1 product type id is Q1A then Query 2 has 4 columns in it.

If Query 1 product type id is Q1B then Query 2 has 6 columns in it.

If Query 1 product type id is Q1C then Query 2 has 7 columns in it….So on.

 

Aspx page exactly looks like:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">

<asp:View ID="View1" runat="server">

      '     Some CONTROLS in this VIEW1

</asp:View>

               

<asp:View ID="View2" runat="server">

 <asp:UpdatePanel ID="UpdatePanel2" runat="server">

  <ContentTemplate>

<telerik:RadGrid ID="rgvModels" runat="server" Width="950px" AutoGenerateColumns="False" Skin="SDDC" EnableEmbeddedSkins="False" AllowSorting="true">

<MasterTableView>

    

<Columns>

 

</Columns>

</MasterTableView> 
<ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" />       </ClientSettings>                                           </telerik:RadGrid>

</ContentTemplate>

</asp:UpdatePanel>

</asp:View>

 

</ContentTemplate>

</asp:UpdatePanel>

 


Protected
Function ProdGrid(ByVal aid As String, ByVal pid As String) As DataTable

        Dim table2 As New DataTable

        Dim pConn As New OracleConnection(SQLConnStr)

        Dim ptID As String = String.Empty

        Label3.Text = String.Empty

        Dim archSQL As String = "select column1 from table 1 where id = '" & pid & "' "

        Dim aConn As New OracleConnection(SQLConnStr)

        aConn.Open()

        Try

            Dim aComm As OracleCommand = New OracleCommand(archSQL, aConn)

            ptID = aComm.ExecuteScalar

        Catch ex As Exception

            ptID = "no data available"

        End Try

        If System.String.IsNullOrEmpty(ptID.ToString) Then ptID = 0

 

        Select Case ptID

            Case 1, 2

                prodSQL = "select distinct c1, c2, c3 from table4 where prod='" & pid & "' order by c1"

                rgvModels.MasterTableView.Columns.Clear()

                ' ----- column 1: -----

                boundColumn = New Telerik.Web.UI.GridBoundColumn

                rgvModels.MasterTableView.Columns.Add(boundColumn)

                boundColumn.DataField = "c1"

                boundColumn.HeaderText = "c1"

                boundColumn.SortExpression = "ia"

                ' ----- column 2: -----

                boundColumn = New Telerik.Web.UI.GridBoundColumn

                rgvModels.MasterTableView.Columns.Add(boundColumn)

                boundColumn.DataField = "c1"

                boundColumn.HeaderText = "c2"

                boundColumn.SortExpression = "c2"

               

                   '  ----- column 3: -----

                boundColumn = New Telerik.Web.UI.GridBoundColumn

                rgvModels.MasterTableView.Columns.Add(boundColumn)

                boundColumn.DataField = "c3"

                boundColumn.HeaderText = "c3"

                boundColumn.SortExpression = "c3"

            Case 3                  

 

                            prodSQL = "select distinct c1, c2, c3,c4,c5 from table4 
                where prod='"
& pid & "'order by c1"

                rgvModels.MasterTableView.Columns.Clear()

                ' ----- column 1: -----

                boundColumn = New Telerik.Web.UI.GridBoundColumn

                rgvModels.MasterTableView.Columns.Add(boundColumn)

                boundColumn.DataField = "c1"

                boundColumn.HeaderText = "c1"

                boundColumn.SortExpression = "c1"

                ' ----- column 2: -----

                boundColumn = New Telerik.Web.UI.GridBoundColumn

                rgvModels.MasterTableView.Columns.Add(boundColumn)

                boundColumn.DataField = "c2"

                boundColumn.HeaderText = "c2"

                boundColumn.SortExpression = "c2"

               

                '  ----- column 3: -----

                boundColumn = New Telerik.Web.UI.GridBoundColumn

                rgvModels.MasterTableView.Columns.Add(boundColumn)

                boundColumn.DataField = "c3"

                boundColumn.HeaderText = "c3"

                boundColumn.SortExpression = "c3"

 

                '     ----- column 4: -----

                boundColumn = New Telerik.Web.UI.GridBoundColumn

                rgvModels.MasterTableView.Columns.Add(boundColumn)

                boundColumn.DataField = "c4"

                boundColumn.HeaderText = "c4"

                boundColumn.SortExpression = "c4"

                '     ----- column 5: -----

                boundColumn = New Telerik.Web.UI.GridBoundColumn

                rgvModels.MasterTableView.Columns.Add(boundColumn)

                boundColumn.DataField = "c5"

                boundColumn.HeaderText = "c5"

                boundColumn.SortExpression = "c5"

 

        End Select

        Dim adapter As OracleDataAdapter = New OracleDataAdapter

        adapter.SelectCommand = New OracleCommand(prodSQL, pConn)

        pConn.Open()

        adapter.SelectCommand = New OracleCommand(prodSQL, pConn)

        adapter.Fill(table2)

        rgvModels.DataSource = table2

        Catch ex As Exception

            Label3.Text = "<b class='red'>There was a problem:</b><br/>" & ex.Message.ToString

        Finally

            pConn.Close()

            pConn.Dispose()

            OracleConnection.ClearPool(pConn)

        End Try

        Return table2

    End Function

'     ----- NEEDDATASOURCE EVENT DEFINITION ----
Public

 

Sub rgvModels_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgvModels.NeedDataSource

 

ProdGrid(rqVal, Session(

"ProdID"))

 

 

End Sub

 

 

 

 

'     ----- SORT COMMAND EVENT DEFINITION ----

Protected Sub rgvModels_SortCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridSortCommandEventArgs) Handles rgvModels.SortCommand

        rgvModels.MasterTableView.SortExpressions.Clear()

        ProdGrid(rqVal, Session("ProdID"))

        rgvModels.DataSource = Nothing

        rgvModels.Rebind()

End Sub

'     ----- BUTTON CLICK EVENT DEFINITION ----

 

On the link button click event which actually loads the RAD grid I have following code…

'     This is where product id comes from or Query 1 is based on this user clicked value

rgvModels.MasterTableView.SortExpressions.Clear()

rgvModels.DataSource = Nothing

rgvModels.Rebind()

 

MY QUESTION:

1) My rad grid will sort the first time very fine ascendingly.

2) If I try to click it again it will not sort again to descending order. Am I missing something here which it does not make it to sort descending?

3) I am even trying to clear sortexpressions in 3 places.

4) I saw this link

http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-clear-sorting.aspx

If this is the solution. I am sorry I don’t understand the Javascript solution to it. Leave alone the next solution  by Maxim Tairov Posted on Jul 18, 2011. I definitely don’t get this.

PLEASE HELP.

 

Thanks,

Vidya

 

 

 

Pavlina
Telerik team
 answered on 04 Aug 2011
1 answer
61 views
Hi guys,

We have an issue with the RadEditor (version 2009.1.527). We use the Firefox in general.(3.6.xxx). When we start to edit the document and we press ENTER then the cursor jumps to the top of the document, and it is invisible. Only we know that there is the cursor because when we start to type again then the typed chars are in the first line of the document.

Could you give me some quick workaround  for this, because it is very anoying and the users started to be very nervous:)

Regards Elod
Rumen
Telerik team
 answered on 04 Aug 2011
1 answer
283 views

Hai,

I have a problem with telerik ajax "Calendar".

I managed to set the "DateTime.now" on the page load and it is working perfectly for me.

But the problem is when I click to Navigate using the "prev month, prev year, next month or next year" a "default date is to be selected", instead here the prevoiusly selected date (that is DateTime.now value) exists if any one one of the "Navigation is clicked".

Actually I want a postback on the calendar click and I am plannning to load the data correspending to the "Selected Date". But here the selected date doesnot change on the Navigation Click.

You can see the "system calender" set a default value on the Navigation click to "default 1 st day of the corresponding Month and year".

Is it possible to set a default date on the Navigation month and year click. This is very much needed for this.

And as a workaround "Can we manage to set a default date on the clientside of the navigation cllick"

Any Help is appreciated,

,

Vinu
Tsvetina
Telerik team
 answered on 04 Aug 2011
6 answers
181 views
I'm having a very odd problem with the RadEditor Toolbar and the ForeColor tool. First some background: We are using a DockingZone to place the tool bar in a separate pane from the content window.

The last item in the toolbar (.reGrip .grip_last) is being forced onto a new line. The interesting part about this is if I remove the ForeColor tool from the toolsfile, the issue corrects itself. I've tried removing every other tool, as well as adding tools and the problem only exists when the ForeColor tool is present:

Here's some code although, I'm not sure how much it'll help:
Toolsfile:
<root>  
    <tools name="MainToolbar" dockingzone="editorToolbar" isribbon="false" dockable="true">
    <tool name="Bold"/>
        <tool name="Italic"/>
        <tool name="Underline"/>
        <tool name="StrikeThrough"/>
        <tool name="FontName"/>     
        <tool name="ForeColor"/>
        <tool separator="true"/>
        <tool name="JustifyLeft"/>
        <tool name="JustifyCenter"/>
        <tool name="JustifyRight"/>
        <tool name="JustifyFull"/>
        <tool name="JustifyNone"/>
        <tool separator="true"/>
        <tool name="Superscript"/>
        <tool name="Subscript"/>
        <tool separator="true"/>
        <tool name="ConvertToLower" />
        <tool name="ConvertToUpper" />
        <tool name="Indent" />
        <tool name="Outdent" />
        <tool name="InsertOrderedList" />
        <tool name="InsertUnorderedList" />
  </tools>  
      
      
</root>


HTML:
<PageSubTitleTemplate>      
     <div id="editorToolbarWrapper" runat="server" class="editorToolbarWrapper">                            
                    <div id="editorToolbar"></div>
                </div>
                  
              
    </PageSubTitleTemplate>
    <PageContentTemplate>
        <telerik:RadEditor ID="m_UIEmailEditor" runat="server" SkinID="EmailEditor" OnClientLoad="OnClientLoad"  >
             
        </telerik:RadEditor>        <telerik:RadEditor ID="m_UIEmailEditor" runat="server" SkinID="EmailEditor" OnClientLoad="OnClientLoad"  >
             
        </telerik:RadEditor>
</PageContentTemplate

Attached aer 4 images, the first with ForeColoe enabled, 2nd with it disabled, 3rd with only forecolor, and 4th without forecolor, but with additional tools.
Dobromir
Telerik team
 answered on 04 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?