1) response write script alert box thrown on page causes the UltraWebGrids on the page to lose roughly 50 pixels of height.
2) Not setting Framestyle width fixes scrollbar covering portion of last column, but as a result the footer does not appear anymore.
I agree with the approach suggested by shravan501. You might alternately use the page's ClientScriptManager property to emit out JavaScript you want run when the page is loaded on the client, if you need to use server-side code to generate the JavaScript you want to run.
My suspicion is that the use of Response.Write may be causing the browser to ignore the DOCTYPE, which would put it into "quirksmode." This may cause the browser to interpret the same HTML differently.
Hey,
I too got the same problem.But instead of Response.Write use alert statements in java script.Don't mention scripts on the page directly.
Use java scripts in .js file. Give that file reference in script manager of the page.Inside script manager you will have a tag <scipt path="~" /> .
This appears to be a new issue with Infragistics 2008 Hot fix version 2039. No AJAX controls are being used on the page. The grids functioned perfectly in the previous version 6.3 2006 version 1069. Basically all that is needed to recreate the issue is in VS 2008 create a ultrawebgrid and create an ASP.NET button. On the event of the button on the code behind page, Response.Write("<script language='javascript'>alert('Save Error.');</script>"). Load the grid when the page loads, then click the button, after the alert box is displayed the grid height and width change. The change appears to be more dramatic when columns contain webcombo's or other controls other than straight text. I have pasted the code below of the example, vb, html, javascript
---------------- VB CODE ------------
Partial
Public Class _Default
Inherits System.Web.UI.Page
Button1.Click
Response.Write(
"<script language='javascript'>alert('Test Alert.');</script>")
Sub
UltraWebGrid1.InitializeDataSource
)
dc =
New DataColumn
dc.ColumnName =
"col" + i.ToString
dt.Columns.Add(dc)
Next
dr = dt.NewRow
dr(
"col" + k.ToString) = "Row" + j.ToString
dt.Rows.Add(dr)
UltraWebGrid1.DataSource = dt
UltraWebGrid1.InitializeLayout
UltraWebGrid1.Height = Unit.Pixel(459)
UltraWebGrid1.DisplayLayout.FrameStyle.Height = Unit.Pixel(459)
dgProjAdminCostSupp.InitializeDataSource
New
DataColumn dc.ColumnName = "col" + i.ToString
dgProjAdminCostSupp.DataSource = dt
dgProjAdminCostSupp.InitializeLayout
e.Layout.ScrollBar = Infragistics.WebUI.UltraWebGrid.ScrollBar.Never
e.Layout.StationaryMargins = Infragistics.WebUI.UltraWebGrid.StationaryMargins.HeaderAndFooter
e.Layout.ColFootersVisibleDefault = Infragistics.WebUI.UltraWebGrid.ShowMarginInfo.Yes
dgProjAdminCostSupp.DisplayLayout.RowHeightDefault = Unit.Pixel(20)
dgProjAdminCostSupp.Height = Unit.Pixel(45)
dgProjAdminCostSupp.DisplayLayout.FrameStyle.Height = Unit.Pixel(145)
e.Layout.ClientSideEvents.AfterCellUpdateHandler =
"dgProjAdminSupp_AfterCellUpdateHandler"
e.Layout.ClientSideEvents.InitializeLayoutHandler =
"dgProjAdminSupp_InitializeLayoutHandler"
e.Layout.Bands(0)
.RowSelectorStyle.Width = Unit.Percentage(1)
.HeaderStyle.Font.Size = WebControls.FontUnit.Point(7)
.HeaderStyle.VerticalAlign = VerticalAlign.Bottom
.HeaderStyle.HorizontalAlign = HorizontalAlign.Center
.AllowColSizing = Infragistics.WebUI.UltraWebGrid.AllowSizing.Fixed
.HeaderStyle.Height = Unit.Percentage(3)
.AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes
.RowStyle.VerticalAlign = VerticalAlign.Bottom
.Columns(0).CellStyle.Font.Size = FontUnit.Point(8)
.Columns(1).CellStyle.Font.Size = FontUnit.Point(8)
.Columns(2).CellStyle.Font.Size = FontUnit.Point(8)
.Columns(0).HeaderText =
""
.Columns(0).AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.No
.Columns(0).Type = Infragistics.WebUI.UltraWebGrid.ColumnType.DropDownList
.Columns(0).ValueList.WebCombo =
Me.cboProjAdminTitleSupp
.Columns(0).Width = Unit.Percentage(12)
.Columns(0).FooterStyle.HorizontalAlign = HorizontalAlign.Left
.Columns(0).FooterText =
"Admin. Costs charged"
.Columns(0).Key =
"1"
.Columns(1).HeaderText =
"This <BR> Reporting <BR> Period"
.Columns(1).Width = Unit.Percentage(6)
.Columns(1).CellStyle.HorizontalAlign = HorizontalAlign.Right
.Columns(1).EditorControlID =
Me.amount.UniqueID
.Columns(1).Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom
.Columns(1).FooterStyle.HorizontalAlign = HorizontalAlign.Right
.Columns(1).Key =
.Columns(2).HeaderText =
"Approved <BR> This <BR> Period"
.Columns(2).Width = Unit.Percentage(6)
.Columns(2).CellStyle.HorizontalAlign = HorizontalAlign.Right
.Columns(2).EditorControlID =
.Columns(2).Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom
.Columns(2).FooterStyle.HorizontalAlign = HorizontalAlign.Right
.Columns(2).Key =
With
End
Class
---------------- HTML ------------
<%
@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TestInfragisticsHeightIssue._Default" %>
@ Register assembly="Infragistics35.WebUI.UltraWebGrid.v8.3, Version=8.3.20083.2039, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid" tagprefix="igtbl" %>
@ Register TagPrefix="igcmbo" Namespace="Infragistics.WebUI.WebCombo" Assembly="Infragistics35.WebUI.WebCombo.v8.3, Version=8.3.20083.2039, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ Register TagPrefix="igtxt" Namespace="Infragistics.WebUI.WebDataInput" Assembly="Infragistics35.WebUI.WebDataInput.v8.3, Version=8.3.20083.2039, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>
<
html xmlns="http://www.w3.org/1999/xhtml">
head id="Head1" runat="server">
<title></title>
</
head>
script type="text/javascript" language="javascript" src="FndSupport.js"></script>
body>
<form id="form1" runat="server">
<div>
</div>
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" Height="459px"
Width="691px">
<Bands>
<igtbl:UltraGridBand>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
</igtbl:UltraGridBand>
</Bands>
<DisplayLayout AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer"
AllowDeleteDefault="Yes" AllowSortingDefault="OnClient"
AllowUpdateDefault="Yes" BorderCollapseDefault="Separate"
HeaderClickActionDefault="SortMulti" Name="UltraWebGrid1"
RowHeightDefault="20px" RowSelectorsDefault="No"
SelectTypeRowDefault="Extended" StationaryMargins="Header"
StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00"
ViewType="OutlookGroupBy">
<HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid"
HorizontalAlign="Left">
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"
WidthTop="1px" />
</HeaderStyleDefault>
<FrameStyle BackColor="Window" BorderColor="InactiveCaption"
BorderStyle="Solid" BorderWidth="1px" Font-Names="Microsoft Sans Serif"
Font-Size="8.25pt" Height="459px" Width="691px">
</FrameStyle>
<Pager MinimumPagesForDisplay="2">
<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
</PagerStyle>
</Pager>
<EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
</EditCellStyleDefault>
<FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
</FooterStyleDefault>
<RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">
<Padding Left="3px" />
<BorderDetails ColorLeft="Window" ColorTop="Window" />
</RowStyleDefault>
<GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
</GroupByRowStyleDefault>
<GroupByBox>
<BoxStyle BackColor="ActiveBorder" BorderColor="Window">
</BoxStyle>
</GroupByBox>
<AddNewBox Hidden="False">
<BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid"
BorderWidth="1px">
</AddNewBox>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
<FilterOptionsDefault>
<FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
BorderWidth="1px" CustomRules="overflow:auto;"
Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px" Height="300px"
Width="200px">
<Padding Left="2px" />
</FilterDropDownStyle>
<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
</FilterHighlightRowStyle>
<FilterOperandDropDownStyle BackColor="White" BorderColor="Silver"
BorderStyle="Solid" BorderWidth="1px" CustomRules="overflow:auto;"
Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px">
</FilterOperandDropDownStyle>
</FilterOptionsDefault>
</DisplayLayout>
</igtbl:UltraWebGrid>
<asp:Button ID="Button1" runat="server" Text="TEST BUTTON" />
<igtbl:UltraWebGrid ID="dgProjAdminCostSupp" runat="server" Width="400px" Height="145px"
DESIGNTIMEDRAGDROP="71">
<DisplayLayout AllowDeleteDefault="Yes" AllowAddNewDefault="Yes" RowHeightDefault="20px"
Version="4.00" SelectTypeRowDefault="Single" BorderCollapseDefault="Separate"
Name="dgProjAdminCostSupp" AllowUpdateDefault="Yes">
<HeaderStyleDefault Font-Names="Verdana" Font-Bold="True" BorderStyle="Solid" HorizontalAlign="Left"
BackColor="#EBF0F9">
<BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White">
</BorderDetails>
<FrameStyle Width="400px" BorderWidth="1px" Font-Size="8pt" Font-Names="Verdana"
BorderColor="#517DBF" BorderStyle="Solid" Height="145px">
<FooterStyleDefault BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">
<ActivationObject BorderColor="1, 68, 208">
<EditCellStyleDefault BorderWidth="0px" BorderStyle="None">
<SelectedRowStyleDefault BackColor="#9FBEEB">
</SelectedRowStyleDefault>
<RowAlternateStyleDefault BackColor="White">
</RowAlternateStyleDefault>
<RowStyleDefault BorderWidth="1px" BorderColor="#517DBF" BorderStyle="Solid">
<Padding Left="3px"></Padding>
<BorderDetails WidthLeft="0px" WidthTop="0px"></BorderDetails>
<igtbl:UltraGridBand HeaderClickAction="SortMulti" AllowUpdate="Yes" CellClickAction="Edit">
<HeaderStyle BackColor="#EAF2F7"></HeaderStyle>
<igcmbo:WebCombo ID="cboProjAdminTitleSupp" runat="server" Width="80px" ForeColor="Black"
Height="22px" BorderWidth="1px" Version="4.00" BorderStyle="Solid" BorderColor="LightGray"
BackColor="White">
<DropDownLayout BorderCollapse="Separate" RowHeightDefault="20px" HeaderClickAction="Select">
<RowStyle BorderWidth="1px" BorderColor="Gray" BorderStyle="Solid" BackColor="White">
</RowStyle>
<SelectedRowStyle ForeColor="White" BackColor="DarkBlue"></SelectedRowStyle>
<HeaderStyle BorderStyle="Solid" BackColor="LightGray">
</HeaderStyle>
<FrameStyle Width="325px" Cursor="Default" BorderWidth="2px" Font-Size="10pt" Font-Names="Verdana"
BorderStyle="Ridge" BackColor="Silver" Height="130px">
</DropDownLayout>
<ExpandEffects ShadowColor="LightGray"></ExpandEffects>
</igcmbo:WebCombo>
<igtxt:WebCurrencyEdit ID="amount" runat="server" Width="72px" MinDecimalPlaces="Two">
</igtxt:WebCurrencyEdit>
</form>
<p>
html>
----------------JAVASCRIPT ------------
//javascript for the SupportingDocumentation.aspx
function
dgPer_AfterCellUpdateHandler(gridName, cellId)
{
dgPerUpdateCell( gridName, cellId );
dgPerUpdateFooter( gridName, cellId );
}
dgPerUpdateCell( gridName, cellId )
var cell=igtbl_getCellById(cellId);
if ( cell.Index >= 7 )
var row=cell.getRow()
var salary=row.getCell(7).getValue();
var benefit=row.getCell(13).getValue();
if ( cell.Index > 7 )
var val;
var total=0;
for(i=8; i<=12; i++)
val=row.getCell(i).getValue();
if( ! isNaN( val ) )
total += val;
row.getCell(13).setValue(total);
benefit=total
//alert(total);
row.getCell(14).setValue(benefit+salary);
dgPerUpdateFooter( gridName, cellId )
var index=cell.Index;
if( index >= 7 )
var grid=igtbl_getGridById(gridName);
var rowCount = grid.Rows.length;
var total = 0;
var val
for( i = 0; i < rowCount; ++i )
val = grid.Rows.getRow(i).getCell(index).getValue();
total = formatCurrency(total);
grid.Bands[0].Columns[index].setFooterText(total);
dgNonPer_AfterCellUpdateHandler(gridName, cellId)
dgNonPerUpdateFooter( gridName, cellId );
dgNonPerUpdateFooter( gridName, cellId )
if( cell.Column.Index == 6 )
val = grid.Rows.getRow(i).getCell(6).getValue();
var amount = formatCurrency(total);
grid.Bands[0].Columns[6].setFooterText(amount);
dgProjAdminSupp_InitializeLayoutHandler(gridName, cellId)
var total;
var val1;
var val2;
val1 = grid.Rows.getRow(0).getCell(1).getValue();
val2 = grid.Rows.getRow(1).getCell(1).getValue();
if ( val2 != null && val1 != null )
total = val2 * val1 / 100;
grid.Bands[0].Columns[1].setFooterText(formatCurrency(total));
dgProjAdminSupp_AfterCellUpdateHandler(gridName, cellId)
dgProjAdminSuppUpdateFooter( gridName, cellId );
dgProjAdminSuppUpdateFooter( gridName, cellId )
if( cell.Column.Index == 1 )
if (val1 > 100)
grid.Rows.getRow(0).getCell(1).setValue(
'');
alert(
'The % rate can not over 100');
return 1;
dgProjAdminSupp_AfterExitEditModeHandler(gridName, cellId)
test( gridName, cellId );
test ( gridName,cellId )
var row=cell.getRow();
var rIndex = grid.Rows.indexOf(row);
if ( rIndex == 0 )
var val1 = grid.Rows.getRow(0).getCell(2).getValue();
row.getCell(2).setValue(val1 +
'%');
formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,
if
(isNaN(num))
num =
"0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
(cents<10)
cents =
"0" + cents;
for
(var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+
','+
num.substring(num.length-(4*i+3));
return
(((sign)?'':'-') + '$' + num + '.' + cents);
DoConfirm()
if (!CheckGrid( 'dgPersonExp' ) )
return false
else if (!CheckGrid( 'dgNonPersonExp' ) )
else if (!CheckGrid( 'dgCapOutExp' ) )
else if (!CheckGrid( 'dgProjAdminCostSupp' ) )
else
//if(confirm('Do you want save all the changes?')){}else{return false}
CheckGrid( gridName )
var grid =igtbl_getGridById(gridName);
var colCount
if ( rowCount > 0 )
if ( gridName == 'dgPersonExp' )
colCount = 11
else if ( gridName == 'dgNonPersonExp' || gridName == 'dgCapOutExp' )
colCount = 6
else if ( gridName == 'dgProjAdminCostSupp' )
val = grid.Rows.getRow(0).getCell(0).getValue()
if ( val == null )
'Please fill all empty cell(s) in data sheet.');
return false;
for(i=0; i<rowCount; ++i )
for(k=1; k<=colCount; k++)
val = grid.Rows.getRow(i).getCell(k).getValue()
if ( gridName == 'dgPersonExp' && (k==1 || k==2) && val==0)
'Select both Employee and Position for Personnel Expenditures.');
if ( ( gridName == 'dgNonPersonExp' || gridName == 'dgCapOutExp' ) && (k==1 || k==2) && val==0)
'Select Payee and Expenditure Type.');
if ( gridName == 'dgNonPersonExp' || gridName == 'dgCapOutExp' )
if ( grid.Rows.getRow(i).getCell(1).getValue() == '7' )
return true;
Hello,
This one is hard to tell. One thing that I know that interferes with pages when Response.Write is used is when the grid uses AJAX (e.g. one of the XML / LoadOnDemand issues). Is this the case? Response.Write is not compatible with AJAX callback updates.
If not, could you please send us a little bit more information on your scenario -- this will surely provide additional details.