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

pop up in a gridview

2 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anjali
Top achievements
Rank 1
Anjali asked on 31 May 2011, 07:53 PM
Hi Everyone,

I have a gridview where I am displaying some data, one of the column in the gridview can have up to 4000 characters. Users are asking me to display 100 characters in the grid and then provide either a plus sign or mouse over thing inside the column that will pop up a windows that shows all the 400 characters in the pop up window.

Please let me know if someone has any suggestions on how to accomplish this.


Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 01 Jun 2011, 04:50 AM
Hello Anjali,

One suggestion is to use set the ToolTip for the item with the entire cell text.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
   
       if (e.Item is GridDataItem) 
       
           GridDataItem item = (GridDataItem)e.Item;            
           if (item["ColUniqueName"].Text.Length > 100 ) 
           
               item["ColUniqueName"].ToolTip = item["ColUniqueName"].Text.ToString(); // Set the Tooltip 
               item["ColUniqueName"].Text = (item["ColUniqueName"].Text).Substring(0, 100) + "..."
           
       
   }

Thanks,
Shinu.
0
Anjali
Top achievements
Rank 1
answered on 01 Jun 2011, 09:50 PM
Thanks Shinu, I tried your solution and it worked, but then I saw another solution that you gave to someone else. I found that solution more elegant than this one and put that in my code.
below is the link to that solution

http://www.telerik.com/community/forums/aspnet-ajax/grid/hover-on-grid-item.aspx
Tags
Grid
Asked by
Anjali
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Anjali
Top achievements
Rank 1
Share this question
or