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

Using RadRadialGuage inside radgrid

1 Answer 28 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
Sandra
Top achievements
Rank 1
Sandra asked on 24 Jun 2013, 03:18 PM
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

 

<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?

 

 

 


1 Answer, 1 is accepted

Sort by
0
Misho
Telerik team
answered on 27 Jun 2013, 01:03 PM
Hello Sandra,

I tried to replicate the issue you are experiencing using the markup provided but no avail.
It looks like the markup and the code is partially incomplete and I was not able to run it. I am willing to help you resolve the problem, but I need to reproduce the issue first.
What I could suggest you at this point is to try to isolate the issue in a simple, fully runnable project and send it back, which will allow us to run and examine it locally.
Since I've verified the solution provided by Danail on the following forum thread is runnable, you could use it for a reference.

Best Regards,
Misho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Gauge
Asked by
Sandra
Top achievements
Rank 1
Answers by
Misho
Telerik team
Share this question
or