lkrterp:but is there a way to just set that to the url column in the grid and not all the columns?
have tried adding the attributes for that column only?
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
}
}
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
this.GridView1.Columns[0].ItemStyle.Width = new Unit(100);
}
Another way that I could think of is to limit the data to be displayed in the GridView instead and display
the Full content of the data in the ToolTip.. see below
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
ViewState["OrigData"] = e.Row.Cells[0].Text;
if (e.Row.Cells[0].Text.Length >= 30) //Just change the value of 30 based on your requirements
{
e.Row.Cells[0].Text = e.Row.Cells[0].Text.Substring(0, 30) + "...";
e.Row.Cells[0].ToolTip = ViewState["OrigData"].ToString();
}
}
}