Hi,
If you need to bind your huge text content to some column in a data
control, then in that case, you cld possibly try this option.
Html source:
<asp:GridView ID="gvColWrap" runat="server" AutoGenerateColumns="false" >
<Columns>
<asp:BoundField HeaderText="Your Original contented"
DataField="contentOriginal" />
<asp:BoundField HeaderText="<td colspan=5>Your wraped contented</td>"
HtmlEncode="false" DataField="contentWraped" />
</Columns>
</asp:GridView>
The second column here splits the same huge text content on column one into
5 diffrent columns within the same column itself.
Code to bind data to control:
DataTable dt = new DataTable();
dt.Columns.Add("contentOriginal");
dt.Columns.Add("contentWraped");
DataRow dr = dt.NewRow();
dr[0] =" ------ Huge original text content ------";
dr[1] = "<td> huge content split 1 </td>" +
"<td> huge content split 2 </td>" +
"<td> huge content split 3 </td>" +
"<td> huge content split 4 </td>" +
"<td> huge content split 5 </td>";
dt.Rows.Add(dr);
gvColWrap.DataSource= dt;
gvColWrap.DataBind();
As long as you know where you need to split the text for your five
paragraphs, each of the split content has to be prefixed with "<td>" and
suffixed with "</td>".
the HTMLEncode property of this particular dataBoundField needs to be set to
false.
If you desire to have a header for this field that is as wide as all the 5
columns in that case, for the headertext prefix and suffix it with <td> and
</td> and use the colspan property as in the example above.
I hope this helps.
- Parvathy Padmanabhan