I followed the instructions on this thread
http://www.telerik.com/community/forums/aspnet-ajax/gauge/how-to-use-gauge-inside-the-grid.aspx
But the find control line does not find the control and turns up with nothing.
'here is my aspx
MasterTableView>
note that I am coding the rest of the columns in the code behind to save viewstate:
'then in my itemdatabound I am trying to set the pointer value
Any ideas?
http://www.telerik.com/community/forums/aspnet-ajax/gauge/how-to-use-gauge-inside-the-grid.aspx
But the find control line does not find the control and turns up with nothing.
'here is my aspx
<telerik:RadGrid ID="rgCARS" runat="server" ClientSettings-Scrolling-AllowScroll="true" AllowSorting="true" ShowFooter="true"
OnSortCommand="RadGrid1_SortCommand" AutoGenerateColumns=False height="400px" EnableViewState="true" > <
MasterTableView>
<Columns >
<telerik:GridTemplateColumn UniqueName="Progress" AllowFiltering="false" HeaderText="Progress" DataField="Progress">
<ItemTemplate>
<telerik:RadRadialGauge ID="RadRadialGauge1" Width="100" Height="100" runat="server" Min="0" Max="100">
</telerik:RadRadialGauge>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings EnablePostBackOnRowClick="true">
<Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" AllowResizeToFit="true" />
<Selecting AllowRowSelect= "true"/>
</ClientSettings>
</telerik:RadGrid>
note that I am coding the rest of the columns in the code behind to save viewstate:
Me.rgCARS.MasterTableView.Columns.Clear()
Dim column1 As New GridBoundColumn
Dim column2 As New GridDateTimeColumn
Dim column3 As New GridBoundColumn
Dim column4 As New GridBoundColumn
Dim column5 As New GridBoundColumn
Dim column6 As New GridNumericColumn
Dim column7 As New GridBoundColumn
Dim column8 As New GridBoundColumn
Me.rgCARS.MasterTableView.Columns.Add(column1)
Me.rgCARS.MasterTableView.Columns.Add(column2)
Me.rgCARS.MasterTableView.Columns.Add(column3)
Me.rgCARS.MasterTableView.Columns.Add(column4)
Me.rgCARS.MasterTableView.Columns.Add(column5)
Me.rgCARS.MasterTableView.Columns.Add(column6)
Me.rgCARS.MasterTableView.Columns.Add(column7)
Me.rgCARS.MasterTableView.Columns.Add(column8)
'Me.rgCARS.MasterTableView.Columns.Add(column9)
'Then set properties
column1.DataField =
"Project #"
column1.HeaderText =
"Project #"
column2.DataField =
"Date Initiated"
column2.HeaderText =
"Date Initiated"
column2.UniqueName =
"DateInitiated"
column3.DataField =
"Title"
column3.HeaderText =
"Title"
column4.DataField =
"Main Type"
column4.HeaderText =
"Main Type"
column5.DataField =
"Type"
column5.HeaderText =
"Type"
column6.DataField =
"Total"
column6.HeaderText =
"Total"
column7.DataField =
"Waiting on"
column7.HeaderText =
"Waiting on"
column8.DataField =
"Waiting on 2"
column8.HeaderText =
""
'then in my itemdatabound I am trying to set the pointer value
Private Sub rgCARS_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles rgCARS.ItemDataBound
If e.Item.ItemType = GridItemType.Item Or e.Item.ItemType = GridItemType.AlternatingItem Then
Dim item As GridDataItem = CType(e.Item, GridDataItem)
Dim currentRow As DataRowView = CType(item.DataItem, DataRowView)
Dim currValue As Decimal = Decimal.Parse(currentRow.Row("Progress").ToString())
Dim radialGauge1 As RadRadialGauge = CType(item.FindControl("RadRadialGauge1"), RadRadialGauge)
Dim value As Integer
If currValue = 0 Then
value = 0
Else
value = currValue / 2
End If
'RaidalGuage is nothing and throws an error
radialGauge1.Pointer.Value =
Math.Ceiling(value)
End If
Any ideas?