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

Radgrid disappear

2 Answers 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kiran
Top achievements
Rank 1
Kiran asked on 20 Oct 2010, 04:11 PM
Dear team

I am facing an issue with the radgrid in IE8 (Compatibitily view / IE7),  When i set gridlines = both, Radgrid gets disappeared on this browser I can see only header , its work fine with IE8

check attached screens

Below is my code,

<

 

telerik:RadGrid ID="RadGrid1" ShowFooter="true"

 

 

Width="99%" EnableLinqExpressions="false" FooterStyle-CssClass="GridColHeadNormal"

 

 

AllowSorting="True" runat="server">

 

 

<MasterTableView ClientDataKeyNames="KEYID">

 

 

<Columns>

 

 

 

 

<telerik:GridBoundColumn HeaderText="Employee Name" DataField="Name" UniqueName="Name"

 

 

SortExpression="Name" FilterControlWidth="100%" AutoPostBackOnFilter="true"

 

 

CurrentFilterFunction="contains" ShowFilterIcon="false" Resizable="False" />

 

 

 

<telerik:GridBoundColumn HeaderText="SSN" DataField="EMP_SSN"

 

 

UniqueName="SSN" SortExpression="EMP_SSN" FilterControlWidth="100px" AutoPostBackOnFilter="true"

 

 

CurrentFilterFunction="contains" ShowFilterIcon="false" Resizable="False" />

 

 

 

<telerik:GridBoundColumn HeaderText="Pay Period" DataField="CODE" SortExpression="CODE"

 

 

UniqueName="CODE" AutoPostBackOnFilter="true" Resizable="False" >

 

 

<FilterTemplate>

 

 

<telerik:RadComboBox ID="RadComboBoxPP" DataSourceID="SqlDataSourcePP" DataTextField="Code" Width="100px"

 

 

DataValueField="Code" Height="100px" AppendDataBoundItems="true" OnClientSelectedIndexChanged="SelectedIndexChanged"

 

 

SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Code").CurrentFilterValue %>'

 

 

runat="server">

 

 

<Items>

 

 

<telerik:RadComboBoxItem Text="All" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

 

 

<script type="text/javascript">

 

 

function SelectedIndexChanged(sender,args) {

 

 

var tableView=$find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");

 

sender.value= args.get_item().get_value();

tableView.filter(

"CODE",args.get_item().get_value(),"EqualTo");

 

}

 

</script>

 

 

</telerik:RadScriptBlock>

 

 

</FilterTemplate>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn HeaderText="Department" Aggregate="Count" DataField="Department" SortExpression="Department"

 

 

UniqueName="Department" AutoPostBackOnFilter="true" Resizable="False" >

 

 

 

<FilterTemplate>

 

 

<telerik:RadComboBox ID="RadComboBoxDep" DataSourceID="SqlDataSourceDepartment" DataTextField="Department"

 

 

DataValueField="Department" Height="100px" AppendDataBoundItems="true" OnClientSelectedIndexChanged="SelectedIndexChanged2"

 

 

SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Department").CurrentFilterValue %>'

 

 

runat="server">

 

 

<Items>

 

 

<telerik:RadComboBoxItem Text="All" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

<telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">

 

 

<script type="text/javascript">

 

 

function SelectedIndexChanged2(sender,args) {

 

 

var tableView=$find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");

 

sender.value= args.get_item().get_value();

tableView.filter(

"Department",args.get_item().get_value(),"EqualTo");

 

}

 

</script>

 

 

</telerik:RadScriptBlock>

 

 

 

</FilterTemplate>

 

 

<FooterStyle CssClass="GridColHeadNormal" />

 

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridNumericColumn Aggregate="Count" DataField="KEYID" Display="false"

 

 

UniqueName="KEYID" SortExpression="KEYID" ShowFilterIcon="false" AllowFiltering="false" />

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings AllowGroupExpandCollapse="False" AllowExpandCollapse="False" ReorderColumnsOnClient="False" Resizing-AllowColumnResize="False" Resizing-ClipCellContentOnResize="True" Scrolling-ScrollHeight="350px">

 

 

<ClientEvents OnRowSelected="RowSelected" />

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

css

 

.normal

 

{

 

 

font-family: Verdana, 'MS Sans Serif';

 

 

font-weight: normal;

 

 

font-size: 8pt;

 

}

 


 

.GridColHeadNormal

 

{

 

 

background-color: #3969A5;

 

 

color:White ;

 

 

font-weight:normal;

 

 

font-size: 8pt;

 

 

width: 1%;

 

 

text-align: center;

 

}

 

 

.GridRow

 

{

 

 

padding-right: 5px;

 

 

padding-left: 3px;

 

 

cursor: pointer;

 

 

background-color: white;

 

 

height: 18px;

 

 

white-space: nowrap;

 

 

vertical-align: top;

 

 

text-align: left;

 

}

 

 

.GridAltRow

 

{

 

 

padding-right: 5px;

 

 

padding-left: 3px;

 

 

/*background-color: #EFE7EF;*/

 

 

 

 

 

background-color: #efefef;

 

 

cursor: pointer;

 

 

height: 18px;

 

 

white-space: nowrap;

 

 

vertical-align: top;

 

 

text-align: left;

 

}

 


Base class page load

 

 

Protected Sub SetRadGridProperties(ByVal grd As RadGrid)

 

 

Try

 

 

 

 

grd.EnableEmbeddedSkins =

False

 

 

 

 

grd.AutoGenerateColumns =

False

 

 

 

 

grd.CssClass =

"normal"

 

 

 

 

 

'grd.ShowFooter = False

 

 

 

 

grd.BorderColor = System.Drawing.Color.FromArgb(66, 105, 99)

grd.BorderWidth =

New System.Web.UI.WebControls.Unit("1")

 

 

'grd.GridLines = GridLines.Both

 

 

 

 

grd.CellPadding = 0

grd.CellSpacing = 0

grd.BorderStyle = System.Web.UI.WebControls.BorderStyle.Outset

grd.HeaderStyle.Height =

New System.Web.UI.WebControls.Unit("24")

 

grd.HeaderStyle.Width =

New System.Web.UI.WebControls.Unit("1")

 

grd.HeaderStyle.VerticalAlign = VerticalAlign.NotSet

grd.HeaderStyle.CssClass =

"GridColHeadNormal"

 

 

 

 

grd.ItemStyle.CssClass =

"GridRow"

 

 

 

 

grd.AlternatingItemStyle.CssClass =

"GridAltRow"

 

 

 

 

grd.PagerStyle.Height =

New System.Web.UI.WebControls.Unit("18")

 

grd.PagerStyle.HorizontalAlign = HorizontalAlign.NotSet

grd.PagerStyle.Mode = System.Web.UI.WebControls.PagerMode.NumericPages

grd.AllowSorting =

True

 

 

 

 

grd.EnableLinqExpressions =

False

 

 

 

 

grd.AllowFilteringByColumn =

True

 

 

 

 

grd.ClientSettings.Selecting.AllowRowSelect =

True

 

 

 

 

grd.ClientSettings.Scrolling.UseStaticHeaders =

True

 

 

 

 

grd.AllowMultiRowSelection =

True

 

 

 

 

grd.GridLines = GridLines.Both

 

''grd.ClientSettings.Scrolling.ScrollHeight = Unit.Percentage(60)

 

 

 

 

grd.ClientSettings.Scrolling.AllowScroll =

True

 

 

 

 

 

grd.FilterItemStyle.Height = Unit.Pixel(30)

 

 

 

Catch ex As Exception

 

 

End Try

 

 

 

 

 

End Sub

 

 

 


Bindgrid

Protected

 

Sub BindGrid2()

 

 

Dim sFilter As String = ""

 

 

Dim ssnLookUp As String = "" '--filter text box type #+, etc

 

 

Dim nKeyID As Integer = -1 '--selected criteria id

 

 

Dim iMode As Integer = 0 '--filter combo

 

 

Dim sEnhSQL As String = "1=1"

 

 

Dim blnTerm As Boolean = False '--Not clear

 

 

Dim sNumEmpNo As String = "Y" '--if emp no is numeric > global setting

 

 

Dim sValidateEmp As String = "N" '--if validate emp > global setting

 

 

Dim obj As New PerfectEmployee

 

 

Dim strExcep As String = ""

 

 

Try

 

 

If Not Page.IsPostBack Then

 

sourceMode =

"(For Groups)"

 

 

If obj.GetData(SqlDataSourceGroups, strExcep, "groups") = False Then

 

 

Throw New Exception(strExcep.ToString)

 

 

End If

 

sourceMode =

"(For Users)"

 

 

If obj.GetData(SqlDataSourceUsers, strExcep, "users") = False Then

 

 

Throw New Exception(strExcep.ToString)

 

 

End If

 

 

End If

 

 

If isSelIndex = False Then BindFilters()

 

sourceMode =

"(For Departments)"

 

 

If obj.GetData(SqlDataSourceDepartment, strExcep, "departments") = False Then

 

 

Throw New Exception(strExcep.ToString)

 

 

End If

 

sourceMode =

"(For Payperiods)"

 

 

If obj.GetData(SqlDataSourcePP, strExcep, "payperiods") = False Then

 

 

Throw New Exception(strExcep.ToString)

 

 

End If

 

iDisplayMode = 1

'--Name

 

sFilter = txtSearch.Text &

""

 

 

If sFilter.Trim <> "" Then

 

 

If sFilter.Substring(0, 1) >= "0" And sFilter.Substring(0, 1) <= "9" Then

 

ssnLookUp =

"TRUE"

 

iDisplayMode = 2

'--SSN Mumber

 

 

End If

 

 

If sFilter.Substring(0, 1) = "#" Then

 

iDisplayMode = 3

'--emp number

 

 

ElseIf sFilter.Substring(0, 1) = "+" Then

 

iDisplayMode = 4

'--Pay File Number

 

 

End If

 

 

End If

 

G_StrAdCriteria =

"1=1"

 

iMode = cmbMode.SelectedIndex

 

If (cmbCriteria.SelectedIndex >= cmbCriteria.Items.Count - 1) Then

 

G_StrAdCriteria = Request.Form(

"hdAdCriteria") & ""

 

 

If IsNumeric(G_StrAdCriteria) Then

 

nKeyID =

CInt(G_StrAdCriteria)

 

G_StrAdCriteria = GetCriteriaFormula(nKeyID)

G_StrAdCriteria = NulltoNone(G_StrAdCriteria,

"1=1")

 

 

End If

 

 

ElseIf (cmbCriteria.SelectedIndex <> 0) Then

 

 

Dim sPart1 As String = cmbCriteria.SelectedItem.Value.Split("|")(0).ToString()

 

 

Dim sPart2 As String = cmbCriteria.SelectedItem.Value.Split("|")(1).ToString()

 

sFlagForCrit = sPart2

nKeyID =

CInt(sPart1)

 

 

Dim sSelText As String

 

sSelText = cmbCriteria.SelectedItem.Text

 

'-- to avoid unhandled NULL statements.

 

 

If InStr(sSelText, "(filter)") > 0 Then

 

G_StrAdCriteria =

""

 

 

Else

 

G_StrAdCriteria = GetCriteriaFormula(nKeyID) &

"" '--check if criteria selected

 

 

End If

 

 

End If

 

G_StrAdCriteria = NulltoNone(G_StrAdCriteria,

"1=1")

 

 

'Code to filter employees based on groups, department and Payperiods

 

 

If radioGD.Items(1).Selected = True Then

 

G_StrAdCriteria = G_StrAdCriteria &

" and employee_main.keyid in (Select emp_key from employee_group where GRP_Key = " & cmbGroup.Items(cmbGroup.SelectedIndex).Value & ") "

 

 

'ElseIf radioGD.Items(2).Selected = True Then

 

 

' G_StrAdCriteria = G_StrAdCriteria & " and employee_main.keyid in (Select emp_key from employee_Department where DEP_KEY = " & cmbDepartment.Items(cmbDepartment.SelectedIndex).Value & ") "

 

 

'ElseIf radioGD.Items(3).Selected = True Then

 

 

' G_StrAdCriteria = G_StrAdCriteria & " and employee_main.EmpPayPeriodCd=" & cmbPayPeriod.Items(cmbPayPeriod.SelectedIndex).Value & " "

 

 

End If

 

 

'grid

 

RadGrid1.MasterTableView.GetColumn(

"Name").HeaderStyle.Width = Unit.Percentage(25)

 

RadGrid1.MasterTableView.GetColumn(

"SSN").HeaderStyle.Width = Unit.Percentage(25)

 

RadGrid1.MasterTableView.GetColumn(

"CODE").HeaderStyle.Width = Unit.Percentage(20)

 

RadGrid1.MasterTableView.GetColumn(

"Department").HeaderStyle.Width = Unit.Percentage(25)

 

RadGrid1.MasterTableView.GetColumn(

"KEYID").HeaderStyle.Width = Unit.Point(0)

 

SqlDataSourceGrid.ConnectionString = conString

SqlDataSourceGrid.SelectCommand =

"spFilterEmployee"

 

SqlDataSourceGrid.SelectCommandType = SqlDataSourceCommandType.StoredProcedure

SqlDataSourceGrid.SelectParameters.Clear()

SqlDataSourceGrid.SelectParameters.Add(

"Mode", cmbMode.SelectedIndex)

 

SqlDataSourceGrid.SelectParameters.Add(

"gtxtEnhancedSQL", sEnhSQL)

 

SqlDataSourceGrid.SelectParameters.Add(

"Term", 0)

 

SqlDataSourceGrid.SelectParameters.Add(

"strAdditionalCriteria", G_StrAdCriteria)

 

SqlDataSourceGrid.SelectParameters.Add(

"NUMERICEMPNBR", sNumEmpNo)

 

SqlDataSourceGrid.SelectParameters.Add(

"EMPVALIDATION", sValidateEmp)

 

RadGrid1.DataSourceID =

"SqlDataSourceGrid"

 

 

 

 

Catch excep As Exception

 

DisplayError(excep)

 

Finally

 

 

'If (Not objDS Is Nothing) Then

 

 

' objDS.Dispose()

 

 

' objDS = Nothing

 

 

'End If

 

 

'If (Not objDS Is Nothing) Then

 

 

' objDV.Dispose()

 

 

' objDV = Nothing

 

 

'End If

 

 

'If (Not objEmp Is Nothing) Then

 

 

' objEmp.Dispose()

 

 

' objEmp = Nothing

 

 

'End If

 

 

'If (Not objIntegration Is Nothing) Then

 

 

' objIntegration.Dispose()

 

 

' objIntegration = Nothing

 

 

'End If

 

 

'If (Not objCombo Is Nothing) Then

 

 

' objCombo.Dispose()

 

 

' objCombo = Nothing

 

 

'End If

 

 

End Try

 

 

End Sub

 



2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 20 Oct 2010, 05:45 PM
Hi Kiran,

It will be a lot better if you paste your code by using the "Format Code Block" tool available in the editor in which you are typing. Or, paste it as plain text. Thank you.

Now to your question: this definitely looks like one of those IE bugs, which appear randomly and are triggered by specific HTML and CSS code on the page. Here are some suggestions for you.

+ do not define widths for RadGrid cells in CSS code
+ do not define padding and vertical-align styles for table rows. These should be used for table cells only
+ 1px is a too small value - grd.HeaderStyle.Width = New System.Web.UI.WebControls.Unit("1")
+ ScrollHeight should not be set in percent

You can also try applying hasLayout to RadGrid elements with CSS like this:

div, table
{
       zoom: 1 ;
}

Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Danyal Rashid
Top achievements
Rank 1
answered on 10 Mar 2011, 09:39 PM
This might help someone experiencing similar issues.

I found a couple of good solutions for RadGrid disappear problem.

1. SetDataDivHeight (Javascript)
if ($find("RadGrid1")._scrolling != null)
  $find("RadGrid1")._scrolling.setDataDivHeight();

2. Conflicting Ajax settings for RadGrid
If RadGrid is contained inside another parent element (asp:Panel, RadPane, div, table, etc.) and the parent element is Ajaxified, do not add any Ajax settings for the RadGrid
// aspx
<Panel1>
  <RadGrid1>
</Panel1>
// Code behind
AjxMgr.AjaxSettings.AddAjaxSetting(Button1, Panel1)
AjxMgr.AjaxSettings.AddAjaxSetting(Button1, RadGrid1) // should not have this line

Tags
General Discussions
Asked by
Kiran
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Danyal Rashid
Top achievements
Rank 1
Share this question
or