This is a migrated thread and some comments may be shown as answers.

RadTextBox issue(inside RadGrid) in IE 8

1 Answer 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ramesh kumar Kuppusamy
Top achievements
Rank 1
Ramesh kumar Kuppusamy asked on 19 May 2010, 12:39 PM
Hi,

      I have a RadTextBox inside my RadGridTemplate Column , The RadText box is not maintaining the value , this Problem occurs in
IE 8 , in my Vista machine ... Other browsers could able retain the values ..

   Please Help me to retain values ,when browsed in IE 8 . .

i have attached sample code and screen shots ...

Note: - 
   In my IE 8 browser , when i change to Compatability Mode , radtextBox inside radgrid retains values , but not in Normal mode ...


Imports System.Data  
Imports Telerik.Web.UI  
 
Partial Class Filter  
    Inherits System.Web.UI.Page  
 
    Private m_objDTColumns As New DataTable  
    Private m_objDTColumns1 As New DataTable  
    Private m_objDTFilter As New DataTable  
    Private m_strReturn As String = String.Empty  
    Private l_intRowCount As Integer = 0  
    Private l_strColumns() As String 
    Private arr As New ArrayList  
 
    
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
          
 
        m_objDTFilter.Columns.Add("Operator")  
        m_objDTFilter.Columns.Add("Value")  
        m_objDTFilter.Columns.Add("Logical")  
 
 
        If Not Page.IsPostBack Then 
            m_objDTFilter.Rows.Add()  
            gvFilter.DataSource = m_objDTFilter  
            gvFilter.DataBind()  
        End If 
    End Sub 
 
    Protected Sub btnAdd_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles btnAdd.Click  
        FilterAddRow()  
    End Sub 
 
    Private Sub FilterAddRow()  
 
        Dim gridRows As GridItemCollection = gvFilter.Items  
        For Each data As GridDataItem In gridRows  
 
 
            Dim l_objDDLOperator As RadComboBox = DirectCast(data.FindControl("ddlOperator"), RadComboBox)  
            Dim l_objDDLLogical As RadComboBox = DirectCast(data.FindControl("ddlLogical"), RadComboBox)  
            Dim l_objTxtValue As RadTextBox = DirectCast(data.FindControl("txtValue"), RadTextBox)  
 
            m_objDTFilter.Rows.Add(New Object() {l_objDDLOperator.SelectedValue.ToString(), l_objTxtValue.Text, l_objDDLLogical.SelectedValue.ToString})  
        Next 
 
 
        m_objDTFilter.Rows.Add()  
 
        gvFilter.DataSource = m_objDTFilter  
        gvFilter.Rebind()  
 
    End Sub 
 
    Protected Sub gvFilter_ItemCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gvFilter.ItemCreated  
 
 
    End Sub 
    Protected Sub gvFilter_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gvFilter.ItemDataBound  
 
        Dim l_intRCnt As Integer = e.Item.ItemIndex  
        Dim l_objDDLColumnName As RadComboBox  
        Dim l_objDDLOperator As RadComboBox  
        Dim l_objDDLLogical As RadComboBox  
        Dim l_objTxtValue As RadTextBox  
 
 
        Dim l_objDDLRowID As Label  
        Dim l_intRIndex As Integer 
        If (e.Item.ItemType = GridItemType.Item Or e.Item.ItemType = GridItemType.AlternatingItem) Then 
            e.Item.Attributes.Add("onclick""javascript:GetRowID('" + e.Item.ItemIndex.ToString() + "');")  
            l_objDDLColumnName = CType(e.Item.FindControl("ddlColumn"), RadComboBox)  
            l_objDDLOperator = CType(e.Item.FindControl("ddlOperator"), RadComboBox)  
            l_objTxtValue = CType(e.Item.FindControl("txtValue"), RadTextBox)  
            l_objDDLLogical = CType(e.Item.FindControl("ddlLogical"), RadComboBox)  
            l_objDDLRowID = CType(e.Item.FindControl("lblRowID"), Label)  
 
            l_intRIndex = e.Item.ItemIndex + 1  
            l_objDDLRowID.Text = l_intRIndex.ToString()  
 
            l_objDDLOperator.SelectedValue = m_objDTFilter.Rows(l_intRCnt)(0).ToString()  
            l_objTxtValue.Text = m_objDTFilter.Rows(l_intRCnt)(1).ToString()  
            l_objDDLLogical.SelectedValue = m_objDTFilter.Rows(l_intRCnt)(2).ToString()  
        End If 
 
    End Sub 
    Protected Sub LinkButton1_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles LinkButton1.Click  
 
        If radGridColumnsFilter.Value <> "" Then 
            l_strColumns = radGridColumnsFilter.Value.Split(",")  
 
            For index = 0 To l_strColumns.Length - 1  
                arr.Add(l_strColumns(index).ToString)  
            Next 
        Else 
            Exit Sub 
        End If 
 
        For l_intRCnt = 0 To l_strColumns.Length - 1  
            m_objDTColumns.Rows.Add(New Object() {l_strColumns.GetValue(l_intRCnt).ToString().ToLower(), l_strColumns.GetValue(l_intRCnt).ToString().ToLower()})  
        Next 
 
        'If Not Page.IsPostBack Then  
        m_objDTFilter.Rows.Add()  
        gvFilter.DataSource = m_objDTFilter  
        gvFilter.DataBind()  
    End Sub 
 
      
    
End Class 
 
<%@ Page Language="VB" EnableViewState="true" AutoEventWireup="false" CodeFile="Filter.aspx.vb" enableEventValidation="false" Inherits="Filter" %> 
 
<%@ 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 runat="server">  
    <title></title>  
 
     <script type ="text/javascript" src="FilterRadWindow.js" > 
     </script> 
 
    <script language="javascript" type="text/javascript">  
// <!CDATA[  
 
        function GetRadWindow()   
        {  
            var oWindow = null;  
            if (window.radWindow)  
                oWindow = window.radWindow;  
            else if (window.frameElement.radWindow)  
                oWindow = window.frameElement.radWindow;  
            return oWindow;  
        }  
          
        function returnArg(arg1)   
        {  
              
            var oWnd = GetRadWindow();  
            oWnd.close(arg1);  
 
        }  
          
        function Close()  
         {  
             var oWnd = GetRadWindow();  
             oWnd.close();  
            }  
 
            function GetRowID(iRowID) {  
                try { document.getElementById("hidSelectedRow").value = iRowID; } catch (e) { }  
            }     
          
        
// ]]> 
    </script> 
</head> 
<body > 
    <form id="form1" runat="server">  
    <div> 
      <table cellpadding="1" cellspacing="1">  
            <asp:ScriptManager ID="ScriptManager1" runat="server">  
            </asp:ScriptManager> 
            <tr> 
                <td> 
                    &nbsp;</td> 
            </tr> 
            <tr valign="top">  
                <td> 
                    <asp:UpdatePanel ID="AjxGrid" UpdateMode="Conditional" runat="Server" > 
                        <ContentTemplate> 
                            <table> 
                                <tr valign="top">  
                                    <td> 
                                        <asp:Panel ID="pnlNewCriteria" runat="server" GroupingText="New Filter Criteria" 
                                            CssClass="pnlClass1">  
                                            <telerik:RadGrid ID="gvFilter" runat="server"  AutoGenerateColumns="false" CssClass="gvHeaderClass">  
                                          <MasterTableView runat ="server"  > 
                                                <Columns >    
                                                <telerik:GridTemplateColumn > 
                                                <ItemTemplate > 
                                                <asp:Label ID="lblRowID" runat="Server" CssClass="lblClass"></asp:Label> 
                                                </ItemTemplate> 
                                                  <ItemStyle Font-Bold="False" Font-Names="Arial" Font-Size="Small" /> 
                                                </telerik:GridTemplateColumn>                                            
                                                   
                                                        <telerik:GridTemplateColumn HeaderText="Operator">  
                                                            <ItemTemplate> 
                                                                <telerik:RadComboBox  ID="ddlOperator" runat="server" CssClass="ddlClass" AutoPostBack="true" 
                                                                    EnableViewState="true">  
                                                                    <Items > 
                                                                      
                                                                    <telerik:RadComboBoxItem Text="Equals" Value="="/>  
                                                                    <telerik:RadComboBoxItem Text="Greater Than" Value=">"/>  
                                                                     <telerik:RadComboBoxItem Text="Less Than" Value="<" /> 
                                                                     <telerik:RadComboBoxItem Text="> Than or Equal" Value="&gt;="/>  
                                                                    <telerik:RadComboBoxItem Text="< Than or Equal" Value="<="/>  
                                                                     <telerik:RadComboBoxItem Text="Doesn't Equal" Value="<>"/>  
                                                                     <telerik:RadComboBoxItem Text="Start With" Value="=%"/>  
                                                                    <telerik:RadComboBoxItem  Text="Anywhere" Value="=%="/>  
                                                                   <telerik:RadComboBoxItem  Text="End With" Value="%="/>  
                                                                    </Items> 
                                                                   </telerik:RadComboBox>   
                                                            </ItemTemplate> 
                                                        </telerik:GridTemplateColumn>     
                                                         <telerik:GridTemplateColumn HeaderText="Value">  
                                                            <ItemTemplate> 
                                                            <telerik:RadTextBox  ID="txtValue" runat="server" EnableViewState="true" style="position:relative;" /> 
                                                             </ItemTemplate> 
                                                        </telerik:GridTemplateColumn>    
                                                         <telerik:GridTemplateColumn HeaderText="Logical">  
                                                            <ItemTemplate> 
                                                               <telerik:RadComboBox ID="ddlLogical" runat="server" AutoPostBack="true" EnableViewState="true">  
                                                               <Items > 
                                                                                                                      
                                                                   <telerik:RadComboBoxItem Text="And" Value="And" />                                                        
                                                                   <telerik:RadComboBoxItem Text="Or" Value="Or" /> 
                                                                   </Items> 
                                                                 </telerik:RadComboBox> 
                                                            </ItemTemplate> 
                                                       </telerik:GridTemplateColumn>    
                                                   </Columns> 
                                                   </MasterTableView> 
                                                    <HeaderStyle BackColor="Control" Font-Bold="False" Font-Names="Arial" Font-Size="Smaller" /> 
                                                </telerik:RadGrid> 
                                        </asp:Panel> 
                                    </td> 
                                </tr> 
                               <tr valign="top">  
                                    <td align="center">  
                                        <asp:Button ID="btnAdd" runat="server" Text="Add" CssClass="btnClass" /> 
                                    </td> 
                                </tr> 
   
                            </table> 
                        </ContentTemplate> 
                    </asp:UpdatePanel> 
                </td> 
            </tr> 
        </table> 
         <input type="hidden" runat="server" name="h_col" id="h_col" value="" /> 
        <input type="hidden" runat="server" name="h_filter" id="h_filter" value="" /> 
        <input type="hidden" name="h_ScrName" id="h_ScrName" runat="server" value="" /> 
        <input type="hidden" runat="server" name="h_count" id="h_count" value="0" /> 
        <asp:HiddenField ID="hidSelectedRow" runat="Server" /> 
        <asp:HiddenField runat ="server"  id="radGridColumnsFilter"/>  
        <asp:LinkButton ID="LinkButton1" runat="server"></asp:LinkButton> 
    </div> 
    </form> 
</body> 
</html> 
 

1 Answer, 1 is accepted

Sort by
0
Nikita Gourme
Top achievements
Rank 1
answered on 25 May 2010, 11:24 AM
Do you use the latest version 2010.1.519 of Telerik.Web.UI.dll in the project? Reported issues concerning IE8 compatibility should be addressed by the Telerik team in the latest releases. Also bind your grid using NeedDataSource event handling instead of assigning a data source and calling DataBind() - this will save you some manual coding.

Nikita
Tags
General Discussions
Asked by
Ramesh kumar Kuppusamy
Top achievements
Rank 1
Answers by
Nikita Gourme
Top achievements
Rank 1
Share this question
or