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

[Solved] Add Comments Image to Row

2 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 19 Nov 2009, 02:05 PM
I am trying to add a 4px by 4px comment image to a row if "CommentLength" returned
from datasource is greater than 0.  I am trying to place it in the upper left hand corner
of the row (Kind of like Excel does with the upper right hand corner).  Does anyone
know how I can go about this.  Thanks in advance.

Joshua

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 19 Nov 2009, 04:30 PM
Hello Josh,

It is possible to achieve this with CSS:
<style type="text/css">
    .commentClass
    {
        background: url(comment.gif) no-repeat;
        background-position: top left;
    }
</style>

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        ...
        (e.Item as GridDataItem)["myCommentColumn"].CssClass = "commentClass";
    }
}

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Josh
Top achievements
Rank 1
answered on 19 Nov 2009, 05:00 PM
Thanks Daniel.
Tags
Grid
Asked by
Josh
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Josh
Top achievements
Rank 1
Share this question
or