Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
265
Setting CellStyle.Wrap = true causes cell to span its content to the right with Browser=XML
posted

Hello.

I want WebGrid cell to wrap it's content.

In NetAdvantage 2007.1.1071 it could be archieved by setting

e.Layout.Bands[0].Columns[0].CellStyle.Wrap = true;

e.Layout.Bands[0].Columns[0].CellMultiline = Infragistics.WebUI.UltraWebGrid.CellMultiline.Yes;

I installed  NetAdvantage 2008.2.2110 and get some odd result: the cell with such settings span it's content to the right cell and so on. 

It takes plase only when

UltraWebGrid1.Browser = Infragistics.WebUI.UltraWebGrid.BrowserLevel.Xml;

UltraWebGrid1.DisplayLayout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.LoadOnDemand.Xml;

What the problem and how can i handle it?

Thanks in advance,

 Aleksey.

The sample

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v8.2, Version=8.2.20082.2110, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"

Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>

<!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>Untitled Page</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" OnInitializeDataSource="UltraWebGrid1_InitializeDataSource" OnInitializeLayout="UltraWebGrid1_InitializeLayout">

</igtbl:UltraWebGrid>

</div>

</form>

</body>

</html>

pagecode:

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class Default2 : System.Web.UI.Page

{

 

protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)

{

UltraWebGrid1.Browser = Infragistics.WebUI.UltraWebGrid.
BrowserLevel.Xml;

UltraWebGrid1.DisplayLayout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.LoadOnDemand.Xml;

//this is the problem point

e.Layout.Bands[0].Columns[0].CellStyle.Wrap = true;e.Layout.Bands[0].Columns[0].CellMultiline = Infragistics.WebUI.UltraWebGrid.CellMultiline.Yes;

 

}

protected void UltraWebGrid1_InitializeDataSource(object sender, Infragistics.WebUI.UltraWebGrid.UltraGridEventArgs e)

{

DataTable dt = new DataTable();

dt.Columns.Add(new DataColumn("FirstName", typeof(string)));

dt.Columns.Add(new DataColumn("LastName", typeof(string)));dt.Rows.Add(new string[ { "firstname firstname firstname", "Lastname lastname" });

UltraWebGrid1.DataSource = dt;

}

}

 

wrapstyle.zip