Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
214 views
Hello,

I've created a site management system that has a base theme that is loaded via the pages directive in the web.config:
<pages ... styleSheetTheme="Base">...</pages> 

Then, to customize the look and feel for an individual site, I reference a theme in the Page_PreInit method:
Me.Theme = "SiteTheme" 

This works great.  Anything defined in the Base theme gives you a standard appearance for any given component of the system.  However, if you want to override the look and feel for an individual site, you can declare the same CSS definitions inside the Site Theme.

If I were to use the StyleSheet Manager to combine CSS files, when would they get loaded.  My goal would be to manage all of the Base theme information with the StyleSheet Manager and still allow them to be overridden by the Site Theme.

Another side question:  Would the StyleSheet Manager help beyond just combining all of the CSS files in my Base theme into a single CSS file?

Thank you.
LeBear
Top achievements
Rank 1
 answered on 15 Sep 2009
2 answers
170 views
Greetings,

I create a RadComboBox at runtime based on a user's selection of items in a grid.  As the user selects items in the gird, I add an entry to the RadComboBox.  The RadComboBox serves as a 'breadcrumb' strategy to move the user back to a position in the grid based on what they've selected in the RadComboBox.  I use the OnClientSelectedIndexChanged event to reposition the user's location in the grid.  My problem is this strategy fails when only one item is found in the RadComboBox.  Clearly, OnClientSelectedIndexChanged won't work because they can never change the selected item.  Can anybody suggest a strategy to avoid this problem or to overcome it?  It would be nice to handle a RadComboBoxItem click event but I don't see that as supported.  I could add a blank item to the combo box, but it does not meet user requirements.  Any suggestions would be appreciated.  Thanks.
Kurt Boeckman
Top achievements
Rank 1
 answered on 15 Sep 2009
2 answers
160 views

Let me explain.
I have a grid which is made like that:

<td valign=bottom>  
                                    <telerik:RadGrid   
                                        ID="RadGrid2"   
                                        Skin="Vista"   
                                        runat="server"   
                                        OnNeedDataSource="RadGrid2_NeedDataSource" 
                                        ShowFooter=true   
                                        CommandItemStyle-HorizontalAlign=Center>    
                                          <MasterTableView   
                                            ShowFooter=true    
                                            CommandItemDisplay="bottom"   
                                            EditMode="InPlace" >    
                                              <CommandItemTemplate> 
                                                  <asp:LinkButton ID="LinkButton1" CommandName="UpdateChanges" Runat="server" CssClass="TexteBlanc16">Importer tous</asp:LinkButton> 
                                              </CommandItemTemplate> 
                                              <Columns>                       
                                                  <telerik:GridTemplateColumn UniqueName="CodePermanent" HeaderText="Code Permanent">    
                                                      <ItemTemplate>    
                                                          <asp:TextBox ID="TxtCodePermanent" runat="server"></asp:TextBox>    
                                                      </ItemTemplate>    
                                                  </telerik:GridTemplateColumn>    
                                             </Columns>    
                                       </MasterTableView>    
                                    </telerik:RadGrid>   
                                </td> 
                                <td valign=bottom>  
                                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Ajouter une ligne" /> 
                                </td> 

Public Sub RadGrid2_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)  
        If Not IsPostBack Then  
            dt = AddRow(dt)  
            ' call the method to create row   
            ViewState("dt") = dt  
        End If  
        dt = DirectCast(ViewState("dt"), DataTable)  
        RadGrid2.DataSource = dt 
    End Sub  
 
Private Function AddRow(ByVal dt As DataTable) As DataTable  
        ' method to create row   
        Dim dr As DataRow = dt.NewRow()  
        dr("RowNumber") = ""  
        dt.Rows.Add(dr)  
        Return dt  
    End Function  
 
 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)  
        Dim countitem As Integer  
        Dim dt As DataTable = DirectCast(ViewState("dt"), DataTable)  
 
        countitem = RadGrid2.Items.Count  
        Dim cpt As Integer = 0 
        For Each Item As GridDataItem In RadGrid2.Items  
 
            Dim txtcode As TextBox = DirectCast(Item("CodePermanent").FindControl("TxtCodePermanent"), TextBox)  
            If Not (txtcode.Text Is Nothing) And txtcode.Text <> "" Then  
                liste.Add(txtcode.Text)  
 
            End If  
 
        Next  
        ViewState("dt") = AddRow(dt)  
        listcount = liste.Count  
 
        RadGrid2.Rebind()  
        While cpt < listcount 
            Dim txtcode As TextBox = DirectCast(RadGrid2.Items(cpt)("CodePermanent").FindControl("TxtCodePermanent"), TextBox)  
            txtcode.Text = liste.Item(cpt)  
            cptcpt = cpt + 1  
        End While  
    End Sub  
 
    Public Sub RadGrid2_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid2.ItemCommand  
        If e.CommandName = "UpdateChanges" Then  
            For Each Item As GridDataItem In RadGrid2.Items  
                Dim txtcode As TextBox = DirectCast(Item("CodePermanent").FindControl("TxtCodePermanent"), TextBox)  
                If Not (txtcode.Text Is Nothing) Then  
                    ImporterEtudiants(txtcode.Text)  
 
                End If  
            Next  
            Me.RadGrid_BanqueCV.Rebind()  
            If CodePermInvalide <> "" Then  
                Session("sCodePermInvalide") = CodePermInvalide  
 
                Response.Redirect("FEN_ERREUR.aspx?NoErreur=3")  
            End If  
 
        End If  
    End Sub  
 
    Public Function ImporterEtudiants(ByVal sCodePerm As String) As Boolean  
        Dim strSQLIdent As String  
        Dim cmdIdent As New SqlCommand  
        Dim myDAIdent As New SqlDataAdapter  
        Dim dsIdent As New DataSet  
        Dim strSQLIdentValide As String  
        Dim cmdIdentValide As New SqlCommand  
        Dim myDAIdentValide As New SqlDataAdapter  
        Dim dsIdentValide As New DataSet  
        Dim strSQLIdentInsert As String  
        Dim cmdIdentInsert As New SqlCommand  
        Dim myDAIdentInsert As New SqlDataAdapter  
        Dim dsIdentInsert As New DataSet  
        Dim DatedeNaissance As Date  
 
        strSQLIdentValide = "SELECT * FROM T_USAGER WHERE CODE_PERMANENT ='" & sCodePerm & "'"  
        cmdIdentValide = New SqlCommand(strSQLIdentValide, Conn)  
        myDAIdentValide = New SqlDataAdapter(cmdIdentValide)  
        Conn.Open()  
        myDAIdentValide.Fill(dsIdentValide)  
        Conn.Close()  
        If dsIdentValide.Tables(0).Rows.Count > 0 Then 'L'usager existe déjà dans la table T_USAGER  
            Effacer = 1 
            Return True  
        Else  
 
            strSQLIdent = "SELECT E_Ele.Fiche,CodePerm,DateNaiss,Nom,Pnom,NoCiv,Rue,Ville,CodePost,IndReg,Tel " & _  
            "FROM E_Ele " & _  
            "INNER JOIN E_Adr " & _  
            "ON E_Ele.Fiche = E_Adr.Fiche " & _  
            "INNER JOIN E_Freq ON E_Ele.Fiche = E_Freq.Fiche " & _  
            "GROUP BY E_Ele.Fiche, E_Ele.CodePerm, E_Ele.DateNaiss, E_Ele.Nom, E_Ele.Pnom, E_Adr.NoCiv, E_Adr.Rue, E_Adr.Ville, E_Adr.CodePost, E_Adr.IndReg, E_Adr.Tel, E_Adr.DateFin, E_Adr.EnvoiMeq " & _  
            "HAVING (((Max(E_Freq.DateFin))>'2008-01-01') AND ((E_Adr.DateFin)='') AND ((E_Adr.EnvoiMeq)='1')) AND CodePerm='" & sCodePerm & "'"  
 
            cmdIdent = New SqlCommand(strSQLIdent, ConnJadeAdulte)  
            myDAIdent = New SqlDataAdapter(cmdIdent)  
            ConnJadeAdulte.Open()  
            myDAIdent.Fill(dsIdent)  
            ConnJadeAdulte.Close()  
            If dsIdent.Tables(0).Rows.Count > 0 Then  
                DatedeNaissance = Left(dsIdent.Tables(0).Rows(0).Item("DateNaiss"), 4) & "-" & Mid(dsIdent.Tables(0).Rows(0).Item("DateNaiss"), 5, 2) & "-" & Right(dsIdent.Tables(0).Rows(0).Item("DateNaiss"), 2)  
                strSQLIdentInsert = "INSERT INTO T_USAGER (CODE_PERMANENT,MOT_PASSE,PRENOM,NOM,ADRESSE,VILLE,CODE_POSTAL,NO_TEL,COURRIEL,DATE_NAISSANCE,LETTRE_CONSENTEMENT,RECEVOIR_NOUVELLE_OFFRE,DIPLOME, PREMIERE_FOIS) " & _  
                                    "VALUES ('" & sCodePerm & "'," & dsIdent.Tables(0).Rows(0).Item("DateNaiss") & ",'" & Replace(Trim(dsIdent.Tables(0).Rows(0).Item("Pnom")), ",", "''") & "', '" & Replace(Trim(dsIdent.Tables(0).Rows(0).Item("Nom")), "'", "''") & "','" & Replace(Trim(dsIdent.Tables(0).Rows(0).Item("NoCiv")), "'", "''") & " " & Replace(Trim(dsIdent.Tables(0).Rows(0).Item("Rue")), "'", "''") & "','" & Replace(Trim(dsIdent.Tables(0).Rows(0).Item("Ville")), "'", "''") & "','" & dsIdent.Tables(0).Rows(0).Item("CodePost") & "','" & dsIdent.Tables(0).Rows(0).Item("IndReg") & dsIdent.Tables(0).Rows(0).Item("Tel") & "','','" & DatedeNaissance & "',0,0,0,1)"  
                cmdIdentInsert = New SqlCommand(strSQLIdentInsert, Conn)  
                myDAIdentInsert = New SqlDataAdapter(cmdIdentInsert)  
                Conn.Open()  
                myDAIdentInsert.Fill(dsIdentInsert)  
                Conn.Close()  
                Effacer = 1 
                Return True  
            Else  
                If CodePermInvalide = "" Then  
                    CodePermInvalide = sCodePerm 
                Else  
                    CodePermInvalideCodePermInvalide = CodePermInvalide & " <br> " & sCodePerm  
                End If  
                Effacer = 0 
                Return False  
            End If  
        End If  
         
          
    End Function  
 
     
    Private Sub RadGrid2_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid2.PreRender  
        RadGrid2.MasterTableView.RenderColumns(1).Display = False 
        RadGrid2.MasterTableView.RenderColumns(3).Display = False 
    End Sub 
Often, the user want to add more than one data at the time so I put 15 lines which are in edit mode. The user can enter 3 rows and then click on the "importer tous" button which valid if the values are ok. If they are, it's working fine. But if only 1 is not good I put it in a variable "CodePermInvalide" and redirect to an error page which display the CodePermInvalide value. Then I got a button on my error page like this:
<A HREF="Javascript:history.go(-1)" >Retour</a> 
When I click on this link, I'm back to my first page and I see all my 3 records, but I would like to see only the values which are not good. It insert the good value in my database so I would like to not see them when I come back to the first page.
Hope that make sense. If you need more informations, please be free to ask as I don't know if I'm clear enought.
Thank you!
Myriam
Top achievements
Rank 1
 answered on 15 Sep 2009
0 answers
85 views
Hi guys,

I have enabled the  client side, drag and drop functionality on my page.
The treview is populated in the code behind and the nodes have a css class applied to them based on their type. One of the types has a blue border around the text.
When I drag this type of node on top of a textbox, in IE6 only , while I drag it, it shows a huge box with the blue border around it and it only dissapears once I drop the text in the textbox.
In any other browser the blue border does not show, only the text.
Any hints how to get rid of it ?


Andrei Dragotoniu
Top achievements
Rank 1
 asked on 15 Sep 2009
3 answers
94 views
If I want to determine whether a particular Rad Grid, Rad List  or RadTreeview has an item which is selected (or checked node in the case of Rad TReeview), I can use the inherent selectedItems or checkednodes properties that these controls expose. However, to determine if a single item is selected, it is not necessery to return all the selected items. Therefore it would seem to me, that a more efficient method of determining whether an item is selected is to loop through all the items and if you come across one which is selected, return true (ie exit the loop) This would be the case unless Telerik used some sort of optimization technique for storing the selecteditems collection without looping through the entire set to setermine it. So, my questions is, does this kind of optimization exists, or is my method of looping instead of using the inherent selecteditems collection a more optimized way of determining whether an item has been selected.

On a related note, is there a way to get a list of all the nodes in a treeveiw without actually traversing the tree in a recursive fashion (ie is there some sort of optimized method of obtaining the full node list)
Veselin Vasilev
Telerik team
 answered on 15 Sep 2009
2 answers
979 views
I am getting this error when I try to click spell checker in IE 7 inside RadEditor

A Runtime Error has occurred.
Do you wish to Debug?

Line:4723
Error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
Parameter name: data

I am using latest version of RadEditor dated Aug 2009. I tried all the solutions available on the forum.
Anyone else is having same kind of problem.
v4rcool
Top achievements
Rank 1
 answered on 15 Sep 2009
1 answer
133 views
Hi
I get WebService on Grid and Scheduler but when I drop to Scheduler and have Week view got error:
'0.tBodies.0.rows[...].cells' is empty or not is object
Line: 131
Char: 2
Code: 0
URI: http://localhost/sys/ScriptResource.axd?d=RovX1UydcrVALVcVQq5SXcuabiO4i76DHtMgfVJwqprZqkDSfq4Ji2L_DBJRYh9Nb-Yanqv_khq-dpXz5smlOA2&t=3f3d994a

<telerik:RadScheduler ID="RadScheduler1" runat="server" Width="100%" DataKeyField="idraport" 
                        DataStartField="raportdatastart" DataEndField="raportdatakoniec" DataSubjectField="opis" 
                        Skin="Office2007" Height="400px" ShowFooter="false" RowHeaderWidth="52" CustomAttributeNames="Due, Priority" 
                        OverflowBehavior="Scroll" HoursPanelTimeFormat="H:mm" TimelineView-UserSelectable="false"> 







                        <WebServiceSettings Path="SchedulerWebService.asmx" ResourcePopulationMode="ServerSide" /> 
                    </telerik:RadScheduler> 

Ok Ajax generiting error:
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" ClientEvents-OnRequestStart="OnRequestStart" ClientEvents-OnResponseEnd="OnResponseEnd" 
        OnAjaxRequest="RadAjaxManager1_AjaxRequest" UpdatePanelsRenderMode="Inline" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadGrid1"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 

how to rectify this error?

T. Tsonev
Telerik team
 answered on 15 Sep 2009
1 answer
93 views
Hi,

How can I integrate the paging(such as paging in data list) with the RadSlider?

Anyone can help? Thanks.

Regards,

Jessie
Tsvetie
Telerik team
 answered on 15 Sep 2009
1 answer
58 views
To reproduce:
1. browse to http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx
2. in the second grid (bound to Data Service), filter by two or more columns

The count (number of records) does not update when filtering by more than one column.
Nikolay Rusev
Telerik team
 answered on 15 Sep 2009
4 answers
257 views
Hi,

We are using radwindow control of Prometheus Q2 2009 version.  We have a requirement display some data in the radwindow when a button of the page is clicked. In the radwindow we can save and edit some data. While saving if mandatory fields are not entered a alert should be displayed to the user. For displaying the alert we use radwindow.

The problem is, when opening a radwindow from another radwindow, the popup is not getting displayed.

I tried with code below, which display the rad window and but not in the front of the first opened radwindow.

        var parentPage = GetRadWindow().BrowserWindow;
        var parentRadWindowManager = parentPage.GetRadWindowManager();
        var wnd = parentRadWindowManager.open("../../Shared/AlertPopup.aspx", "radAlertWindow");
        wnd.setSize (300, 150);
        wnd.SetModal(true);
        return false;

Is there any option to make the radwindow open from another radwindow and display it inside the first opened radwindow. (as "Modal" window).

Thanks
Meenakshi Nagalingam
Top achievements
Rank 1
 answered on 15 Sep 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?