10 Answers, 1 is accepted
For more information about RadGrid resizing, please refer to the links bellow:
http://www.telerik.com/help/aspnet-ajax/grdresizingcolumns.html
http://demos.telerik.com/aspnet-ajax/grid/examples/client/resizing/defaultcs.aspx
Sincerely yours,
Pavlina
the Telerik team
when i am trying to fire oncolumnresize event,it is not working.
suggest me how to fire OnColumnResize event.
OnColumnResized event is fired after a column is resized. More information is available here:
http://www.telerik.com/help/aspnet-ajax/grid_oncolumnresized.html
Kind regards,
Pavlina
the Telerik team
In my application,in ItemDatabound event
protected void gvResourceTasks_ItemDataBound(object sender, GridItemEventArgs e)
{
string tasknamecellText = (e.Item as GridDataItem)["Task_Name"].Text;
//here ((int)clsGeneric.gridtooltip.task_name)=15
if (Convert.ToInt16(tasknamecellText.Length) > ((int)clsGeneric.gridtooltip.task_name))
{
(e.Item as GridDataItem)["Task_Name"].Text = tasknamecellText.Substring(0, (int)clsGeneric.gridtooltip.task_name);
string task_namelength = (e.Item as GridDataItem)["Task_Name"].Text;
if (Convert.ToInt16(task_namelength.Length) == (int)clsGeneric.gridtooltip.task_name)
{
//string length1 = length + "......";
(e.Item as GridDataItem)["Task_Name"].Text = task_namelength +"......";
//(e.Item as GridDataItem)["Description"].Text = length1;
}
}
}
So,when I resize taskname column,entire text not displaying.
When I am resizing,the total text has to be displayed.
In function columnresized(sender,eventargs),how I have to write?
Can you please open a formal support ticket and send us a simplified version of the project, demonstrating the problem? We will do our best to find what's wrong and help immediately.
Thank you!
Sincerely yours,
Pavlina
the Telerik team
Hello ,
I know this is a very old post .But exactly I have to do the same.
(item[col.UniqueName] as TableCell).ToolTip = item[col.UniqueName].Text;
item[col.UniqueName].Text = item[col.UniqueName].Text.Substring(0, 29) + "...";
now in the ClientEvents.OnColumnResizing event I want to show the full text ( when the Column size is larger and apply the sub string again Column size is shorter dynamically with .... )
Anyone can help me please
Thanks
Sanjukta
Hi Sanjukta,
As we already have reached to a working option in the support thread you have opened I will post the suggested solution here as well:
Assigning a Substring of the original value to the Cell text will replace the initial string in the cell and therefore it cannot be recovered when enlarging the column width.
I would suggest avoiding the text modification inside the cells and use custom CSS to achieve the desired appearance.
Sample CSS:
html body .RadGrid tbody > tr.rgRow > td,
html body .RadGrid tbody > tr.rgAltRow > td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Find more about the used CSS properties below:
Kind regards,
Doncho
Progress Telerik
Thank you so much. it was a great help.
Is there any way I can show tooltip when the ellipsis is activated ? Only for those RadGrid Column cell where Ellipsis ( .... ) there
Thanks
Sanjukta
Hi Sanjukta,
I have sent an answer to your question in the support ticket you have opened on the same topic.
I would suggest you proceed with the communication there only. Once we reach the resolution I will post it in this forum so that it is visible to others facing the same problem.
Kind regards,
Doncho
Progress Telerik
Sanjukta,
As I intended, I am sharing the proposed approach for achieving the desired behavior using RadToolTipManager.
- Declare a RadToolTipManager with enabled AutoTooltipify and wire up the OnClientBeforeShow event listener:
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" AutoTooltipify="true" OnClientBeforeShow="onClientBeforeShow"></telerik:RadToolTipManager>
- In the event listener, check if the text inside the target control is wrapped by comparing the offsetWidth and scrollWidth (in the current scenario target is the Grid cell <td> element). If text is wrapped, cancel the event:
function onClientBeforeShow(sender, args) { var target = sender.get_targetControl(); if (target.offsetWidth >= target.scrollWidth) { args.set_cancel(true); } }
Here you can find resources related to the sample above:
Kind regards,
Doncho
Progress Telerik