Hi. I'm using RadControls for ASP.NET AJAX 2009_2_826_dev. I'm trying to set the tooltip on all columns to be the same. Everything works except the GridHyperLinkColumn(s). I can set the 'text' property okay, so I know my code behind is trying to set it on the correct grid item. Thanks in advance.
Daniel
Daniel
protected void rgPeople_ItemCreated(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem) |
{ |
GridDataItem gridItem = e.Item as GridDataItem; |
foreach (GridColumn column in rgPeople.MasterTableView.RenderColumns) |
{ |
if (column is GridBoundColumn) |
{ |
gridItem[column.UniqueName].ToolTip = gridItem.OwnerTableView.DataKeyValues[gridItem.ItemIndex]["pkEmployeeNumber"].ToString(); |
} |
} |
} |
} |
<telerik:RadGrid ID="rgPeople" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" |
GridLines="None" Skin="Simple" OnPreRender="rgPeople_PreRender" DataSourceID="sdsPeople" EnableLinqExpressions="False" |
runat="server" OnItemCreated="rgPeople_ItemCreated"> |
<MasterTableView AutoGenerateColumns="False" DataKeyNames="pkEmployeeNumber"> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px" /> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px" /> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridHyperLinkColumn DataNavigateUrlFields="pkEmployeeNumber" SortExpression="firstName" |
UniqueName="firstName" DataNavigateUrlFormatString="/people/profiles/?empno={0}" |
HeaderText="First Name" DataTextField="firstName" DataType="System.String"> |
</telerik:GridHyperLinkColumn> |
<telerik:GridBoundColumn DataField="firstName" HeaderText="First Name" SortExpression="firstName" |
UniqueName="firstNameSort" Display="false" DataType="System.String"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="lastName" HeaderText="Last Name" SortExpression="lastName" |
UniqueName="lastName"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="positionDescription" HeaderText="Title" SortExpression="positionDescription" |
UniqueName="positionDescription"> |
</telerik:GridBoundColumn> |
<intra:FilteringColumnPeople DataField="directorate" FilterControlWidth="180px" HeaderText="Directorate"> |
<headerstyle width="15%" /> |
<itemtemplate> |
<%# Eval("directorate")%> |
</itemtemplate> |
</intra:FilteringColumnPeople> |
<telerik:GridBoundColumn DataField="phone" HeaderText="Phone" SortExpression="phone" |
UniqueName="phone"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="email" HeaderText="Email" SortExpression="email" |
UniqueName="email"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="pkEmployeeNumber" HeaderText="pkEmployeeNumber" SortExpression="pkEmployeeNumber" |
UniqueName="pkEmployeeNumber" Display="false"> |
</telerik:GridBoundColumn> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |