Hi,
I have datagrid with GridButtonColumn. I would like to change the text on ItemDataBound. However, it doesn't work.
Please let me know what the problem is with my code provided above.
Chris
I have datagrid with GridButtonColumn. I would like to change the text on ItemDataBound. However, it doesn't work.
<telerik:RadGrid ID="dgDFR" runat="server" AutoGenerateColumns="False" GridLines="None" EnableEmbeddedSkins="false" Skin="Windows" OnItemDataBound="dgDFR_ItemDataBound"> |
<MasterTableView CommandItemDisplay="None" CurrentResetPageIndexAction="SetPageIndexToFirst" Width="900px" |
Dir="LTR" Frame="Border" TableLayout="Auto" DataKeyNames="ID" AlternatingItemStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"> |
<NoRecordsTemplate>There is no data product for you at this time.</NoRecordsTemplate> |
<Columns> |
<telerik:GridButtonColumn UniqueName="Action" HeaderText="Action"></telerik:GridButtonColumn> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |
protected void dgDFR_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem) |
{ |
GridDataItem item = (GridDataItem)e.Item; |
GridButtonColumn gbtnCol = item.OwnerTableView.Columns.FindByUniqueName("Action") as GridButtonColumn; |
gbtnCol.Text = "Resume"; |
gbtnCol.DataTextFormatString = "Resume"; |
} |
} |
Please let me know what the problem is with my code provided above.
Chris