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

on rad grid column resizing event

10 Answers 225 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shiva
Top achievements
Rank 1
shiva asked on 07 Jul 2010, 01:48 PM
hi,
what is the event for grid column resize?
In my application,when i am resizing the grid column i have to change that column data.

10 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 07 Jul 2010, 02:21 PM
Hello Shiva,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
shiva
Top achievements
Rank 1
answered on 09 Jul 2010, 02:53 PM
Hi,
when i am trying to fire oncolumnresize event,it is not working.
suggest me how to fire OnColumnResize event.
0
Pavlina
Telerik team
answered on 09 Jul 2010, 03:21 PM
Hi Shiva,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
shiva
Top achievements
Rank 1
answered on 10 Jul 2010, 06:04 AM

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?

0
Pavlina
Telerik team
answered on 15 Jul 2010, 09:25 AM
Hello Shiva,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sanjukta
Top achievements
Rank 1
answered on 27 Jul 2020, 10:35 AM

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

 

0
Doncho
Telerik team
answered on 30 Jul 2020, 08:18 AM

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

    0
    Sanjukta
    Top achievements
    Rank 1
    answered on 30 Jul 2020, 04:28 PM

    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

    0
    Doncho
    Telerik team
    answered on 03 Aug 2020, 01:08 PM

    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

    0
    Doncho
    Telerik team
    answered on 04 Aug 2020, 10:23 AM

    Sanjukta,

    As I intended, I am sharing the proposed approach for achieving the desired behavior using RadToolTipManager.

    1. 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>
    2. 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

    Tags
    Grid
    Asked by
    shiva
    Top achievements
    Rank 1
    Answers by
    Pavlina
    Telerik team
    shiva
    Top achievements
    Rank 1
    Sanjukta
    Top achievements
    Rank 1
    Doncho
    Telerik team
    Share this question
    or