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

Overiding ExpandColumn Control title attr (server side)

2 Answers 12 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 04 Nov 2008, 12:22 AM
Is there a proper way to override the 'Expand' and 'Collapse' values for the title attribute in the <input> control for the ExpandCollapse column when looking at hierarchical data in RadGrid?

I've tried the following during the OnDataBound event, but the title attribute shows up twice. Once with the radgrid value and then mine. Can I even access the opaque(?) object that has these values in it?

BTW, setting the tooltip for the parent <td> element works just fine.
protected void OutsideLawFirmGrid_OnDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = e.Item as GridDataItem;
            item["ExpandColumn"].ToolTip = "View Contacts";
            System.Web.UI.WebControls.Button btn = (System.Web.UI.WebControls.Button)item["ExpandColumn"].Controls[0];
            btn.Attributes.Add("title", "View Contacts");
            btn.ToolTip = "View Contacts";
        }
    }
Is there some later stage on the server where I can intercept things and iteratate over all the GridDataItems and replace this value? I tried to place an iterative version of this in the Page_PreRender w/the same results.

2 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 05 Nov 2008, 12:20 PM
Hi Martin,

One possible approach in this case would be to set these values codelessly, as shown in the code snippet below:

.aspx
<HierarchySettings CollapseTooltip="customCollapseText"   
            ExpandTooltip="customExpandText" />             

I hope this helps.

All the best,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin
Top achievements
Rank 1
answered on 05 Nov 2008, 09:35 PM
That totally did the trick! I would of never really stumbled across that element and its attributes.
Tags
Grid
Asked by
Martin
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Martin
Top achievements
Rank 1
Share this question
or