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

I am using Q2 2009 version of Telerik. I have a grid control. I want coulmn Header Text when i click on particular column  through JavaScript. i tried to get the value with  innerText and innerHTML.but  i think it is not supporting.

Please give me the solutions ASAP

Regards

Rahul
Rahul Khinvasara
Top achievements
Rank 1
 answered on 09 Oct 2009
3 answers
104 views
Hello,

I'm using EntityDataSource with table User. I have also included table Transport related to User.
I have a column in my grid
<telerik:GridBoundColumn DataField="Transport.City" DataType="System.String" HeaderText="Transport" UniqueName="Transport" /> 

Filtering "IsEmpty" and "IsNull" and "NotIsNull" always return empty grig, while "NotIsEmpty" works perfect.
I guess it's because User can have Transport = null, and I'm binding column to Transport.City.

Please help, I realy need "IsEmpty" filter to work.
Tsvetoslav
Telerik team
 answered on 09 Oct 2009
5 answers
98 views
hey.. I am attempting to get my grid to save their custom grouped setting for each of my users via the asp.net profile objects. this works for me when i am not using the ajax manager. (I am using the grid settings persistor sample for the guidelines. )
My question is this.. how to save the grid settings when the ajax call avoids the Render Sub.. I hae tried the goups changing but found that really ugly as you would have to apply it on each grid in the page.  ( it also blew up each time saying the object no longer existed if you moved an item out)
If you have any ideas I would appreciate hearing them
.class file
Imports Microsoft.VisualBasic  
'Namespace WebApplication1  
Imports System  
Imports System.Collections  
Imports System.IO  
Imports System.Web.UI  
Imports System.Web.UI.WebControls  
Imports Telerik.Web.UI  
 
 
Public Class GridSettingsPersister  
 
    Private gridInstance As RadGrid  
 
    Public Sub New(ByVal gridInstance As RadGrid)  
        MyBase.New()  
        Me.gridInstance = gridInstance  
    End Sub  
 
    'this method should be called on Render  
    Public Function SaveSettings() As String  
        Dim gridSettings() As Object = New Object((4) - 1) {}  
        'Save groupBy  
        Dim groupByExpressions As GridGroupByExpressionCollection = gridInstance.MasterTableView.GroupByExpressions  
        Dim groupExpressions() As Object = New Object((groupByExpressions.Count) - 1) {}  
        Dim count As Integer = 0 
        For Each expression As GridGroupByExpression In groupByExpressions  
            groupExpressions(count) = CType(expression, IStateManager).SaveViewState  
            count = (count + 1)  
        Next  
        gridSettings(0) = groupExpressions  
        'Save sort expressions  
        gridSettings(1) = CType(gridInstance.MasterTableView.SortExpressions, IStateManager).SaveViewState  
        'Save columns order  
        Dim columnsLength As Integer = (gridInstance.MasterTableView.Columns.Count + gridInstance.MasterTableView.AutoGeneratedColumns.Length)  
        Dim columnOrder() As Pair = New Pair(columnsLength - 1) {}  
 
        Dim allColumns As ArrayList = New ArrayList(columnsLength)  
        allColumns.AddRange(gridInstance.MasterTableView.Columns)  
        allColumns.AddRange(gridInstance.MasterTableView.AutoGeneratedColumns)  
        Dim i As Integer = 0 
        For Each column As GridColumn In allColumns  
            Dim p As Pair = New Pair  
            p.First = column.OrderIndex  
            p.Second = column.HeaderStyle.Width  
            columnOrder(i) = p  
            i = (i + 1)  
        Next  
        gridSettings(2) = columnOrder  
        'Save filter expression  
        gridSettings(3) = CType(gridInstance.MasterTableView.FilterExpression, Object)  
 
        Dim formatter As LosFormatter = New LosFormatter  
        Dim writer As StringWriter = New StringWriter  
        formatter.Serialize(writer, gridSettings)  
        Return writer.ToString  
    End Function  
 
    'this method should be called on PageInit  
    Public Sub LoadSettings(ByVal settings As String)  
        Dim formatter As LosFormatter = New LosFormatter  
        Dim reader As StringReader = New StringReader(settings)  
        Dim gridSettings() As Object = CType(formatter.Deserialize(reader), Object())  
        'Load groupBy  
        Dim groupByExpressions As GridGroupByExpressionCollection = Me.gridInstance.MasterTableView.GroupByExpressions  
        groupByExpressions.Clear()  
        Dim groupExpressionsState() As Object = CType(gridSettings(0), Object())  
        Dim count As Integer = 0 
        For Each obj As Object In groupExpressionsState  
            Dim expression As GridGroupByExpression = New GridGroupByExpression  
            CType(expression, IStateManager).LoadViewState(obj)  
            groupByExpressions.Add(expression)  
            count = (count + 1)  
        Next  
        'Load sort expressions  
        Me.gridInstance.MasterTableView.SortExpressions.Clear()  
        CType(Me.gridInstance.MasterTableView.SortExpressions, IStateManager).LoadViewState(gridSettings(1))  
        'Load columns order  
        Dim columnsLength As Integer = (Me.gridInstance.MasterTableView.Columns.Count + Me.gridInstance.MasterTableView.AutoGeneratedColumns.Length)  
        Dim columnOrder() As Pair = CType(gridSettings(2), Pair())  
        If (columnsLength = columnOrder.Length) Then  
            Dim allColumns As ArrayList = New ArrayList(columnsLength)  
            allColumns.AddRange(Me.gridInstance.MasterTableView.Columns)  
            allColumns.AddRange(Me.gridInstance.MasterTableView.AutoGeneratedColumns)  
            Dim i As Integer = 0 
            For Each column As GridColumn In allColumns  
                column.OrderIndex = CType(columnOrder(i).First, Integer)  
                column.HeaderStyle.Width = CType(columnOrder(i).Second, Unit)  
                i = (i + 1)  
            Next  
        End If  
        'Load filter expression  
        Me.gridInstance.MasterTableView.FilterExpression = CType(gridSettings(3), String)  
    End Sub  
 
 
 
 
End Class  
 
<Serializable()> Public Class Pet  
    Public Sub New()  
        ' default ctor required for serializer   
    End Sub  
 
    Private _names As New Hashtable()  
    Public Property Names() As Hashtable  
        Get  
            Return _names  
        End Get  
        Set(ByVal value As Hashtable)  
            _names = value 
        End Set  
    End Property  
 
 
    Public Sub SavePetNames(ByVal Grid As RadGrid, ByVal GridName As String)  
        Dim settings As New GridSettingsPersister(Grid)  
        Dim settingvalue As String = settings.SaveSettings()  
        _names(GridName) = settingvalue  
        '   _names.Add(GridName, settingvalue)  
    End Sub  
 
 
 
End Class  
 
 
 
 
 
 
'End Namespace 

.ascx file
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init  
        '   export.Visible = True 
        For Each c As Control In Me.Controls  
            If TypeOf c Is RadGrid Then  
                Dim settings As New GridSettingsPersister(c)  
                If Profile.Pet.Names.ContainsKey(functions.getunique(c)) Then  
                    settings.LoadSettings(Profile.Pet.Names(functions.getunique(c)).ToString())  
                End If  
            End If  
        Next  
 
    End Sub  
 
 
    Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)  
        MyBase.Render(writer)  
        For Each c As Control In Me.Controls  
            If TypeOf c Is RadGrid Then  
                Profile.Pet.SavePetNames(c, functions.getunique(c))  
            End If  
        Next  
    End Sub  
 
 
Protected Sub RadGrid1_GroupsChanging(ByVal source As Object, ByVal e As Telerik.Web.UI.GridGroupsChangingEventArgs) Handles RadGrid1.GroupsChanging  
'This doesn't work    
    '   Profile.Pet.SavePetNames(RadGrid1, functions.getunique(RadGrid1))  
 
    End Sub  
 
 

source
<telerik:RadAjaxManager   ID="RadAjaxManager1" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
</telerik:RadAjaxManager> 

Tsvetoslav
Telerik team
 answered on 09 Oct 2009
0 answers
117 views
hi....
i hav a table in sql database.I want keep track of the table if i do any updation and deletion in  that table.How can i do with the help of sql logs....
Harry
Top achievements
Rank 1
 asked on 09 Oct 2009
3 answers
143 views
Is it possible to get the changed value of readonly numeric text box during javascript processing on postback?
Tsvetoslav
Telerik team
 answered on 09 Oct 2009
1 answer
303 views
Hi,
We have rad window appear issue in google chrome, in chrome the rad window is cutting from header and in header there is one dot symbol and "=" symbol appear. I have attached the image "radwin.jpg".  
It works fine in IE 7 and mozilla.

Aspx page where I have written code for opening rad window.

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../App_Themes/Office2009/Window.Office2009.css"rel="Stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function OpenCopyPath(sUserName)
{
    var page = "test_RadWindow.aspx";
    var oWnd = $find("RadWindow1"); 
    oWnd.setSize(380,345);//W,H
    oWnd.setUrl(page);
    oWnd.show();
    oWnd.center();
    return false;
}
</script>
</head>
<body >
<form id="form1" runat="server">
 <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
<asp:Button ID="btnGoheIL" runat="server" CssClass="btn" Text="Go"
             onClientClick="return OpenCopyPath('PatniDev');" Width="45px" />
    <telerik:RadWindowManager   ID="Singleton"
            EnableEmbeddedSkins="False" Skin="Office2009"
            VisibleStatusbar="False" Behavior="Close" 
            IconUrl="~/Images/logo_popup.png" runat="server" Behaviors="Close"
            InitialBehavior="None" Left="" 
            style="display: none;" Top="" >
            <Windows>
                <telerik:RadWindow ID="RadWindow1" VisibleStatusbar="false" Height="420px"
                    Width="575px" Modal="true" runat="server"  >
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
   
 </form>
</body>
</html>

Let me know if you have any suggestion
Waiting for your response.

Thanks,
Jalpesh
Georgi Tunev
Telerik team
 answered on 09 Oct 2009
1 answer
136 views
Hi

I have built a simple application that uses the rad grid and rad menu, that I am going to demonstrate to our company.

I have seen from your website that "The Telerik ASP.NET Controls suite ships with 12 great looking and customizable skins for a consistent look and feel of Vista, Office 2007, Outlook, etc."

If I wanted to switch the theme from the default to one of these 12 themes, how would I go about doing that in my application?
Do I need to add the css / theme files within my application?

I would appreciate a little guidance with this please.

Thanks
Paolo
Princy
Top achievements
Rank 2
 answered on 09 Oct 2009
1 answer
628 views
Hi Telerik,

I have a Radgrid with EditForm of type "Template".

On Server side at one point I need to traverse through all controls inside the Edit Form  template and their values.
Usually to get a reference to a control I do something like:
         
RadComboBox cntrlDDLhippingAccountType = null; 
cntrlDDLhippingAccountType = (RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)[0]).FindControl("ddlID") as RadComboBox; 
 
 
Since, I need to reference all of the controls this time I tried to do the following:
       foreach (Control c in (RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)[0]).Controls) 
        { 
            if (c is RadInputControl) 
            { 
                ((RadInputControl)c).Text = String.Empty; 
            } 
            else if (c is RadComboBox) 
            { 
                ((RadComboBox)c).SelectedIndex = 0; 
            } 
        } 

But this did not work, because Controls collection returns only EditFormTableCell control(s).
So the question is how can I Loop through all editable controls inside Edit Form template and set their values.

Sebastian
Telerik team
 answered on 09 Oct 2009
1 answer
228 views
I am using Telerik version 2008.3.1125.35.
what I am trying to achieve is to have scoll bar on tooltips.

I tried

ContentScrolling

 

="Auto" in my aspx page ..the problem with this is that we have to specify height and width with it .

 

I don't want to do that because I sometime have to display only 5 characters where I don't need a height on 400px where as sometime i need to show a lot.

 

<telerik:RadToolTip ID="AcuityToolTip" runat="server" RelativeTo="Element" Position="TopRight" Sticky="true" OffsetX="0" OffsetY="0" >

 

 

</telerik:RadToolTip>

 


I am not using RadToolTipsmanager because it was creating a lot of problem , so i have one RadToolTips and I hide and show same tooltps again and again.So far everything is great except the condition for scroll bar from client side.

if(List too long)
{

tooltip.set_contentScrolling(0)

tooltip.set_height(

"200px");

 

tooltip.set_width(

400px");

 


}
else
{
    //hide scrolling and height and width should be auto
}

could you tell me how can this be implemented..

thanks,
DIP
Tsvetie
Telerik team
 answered on 09 Oct 2009
2 answers
91 views
Hello,
I am not able to successfully implement custom attributes. i am following steps in http://www.telerik.com/help/aspnet-ajax/schedule_advancedformtemplate.html
this link.. and getting red lines under <AdvancedForm Modal="true" /> this perticuler line.
 
please tell me what exactly i am missing here




jayant bhagwat
Top achievements
Rank 1
 answered on 09 Oct 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?