Hi
I'm trying to change the caption/text on a GridButtonColumn, by code.
What i want is that the text on the PushButton is dependent on the value of a field.
The result is that I don’t see the push button, but only a text.
Can anybody tell me what I do wrong?
Thanks
Erik
aspx
| <telerik:GridButtonColumn ButtonType="PushButton" text="Create" |
| UniqueName="versionFunction" HeaderText="Function"> |
| <HeaderStyle Width="100px"></HeaderStyle> |
| </telerik:GridButtonColumn> |
C#
| protected void Grid_Versioner_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
| GridDataItem dataItem = (GridDataItem)e.Item; |
| switch (dataItem["Status"].Text) |
| { |
| case "Created": |
| dataItem["versionFunction"].Text = "Execute"; |
| break; |
| case "Executing": |
| dataItem["versionFunction"].Text = "Executeing"; |
| break; |
| } |
| } |
| } |