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

Customized grid look..

4 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Milan Gurung
Top achievements
Rank 1
Milan Gurung asked on 09 Mar 2009, 11:21 AM
Hi,

Please have a look on the following sample report data I am tring to display -

Supplier  OrderNo GrossCost  Inv.No  Inv.Cost  Difference
Dell         301         500 S12      250
S13      250 0
HP          302          800 S21     200
S22     400 200

We have two suppliers and each having two Inv.No but it can be more than two. Difference column =   Gross Cost  - total Inv.Cost for an order number.

Could you please suggest me if this is possible to implement? If so, hints please.


Thanks a lot.

Milan G 

4 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 11 Mar 2009, 11:06 AM
Hello Milan,

You can implement the relation via standard hierarchy. Additionally, the difference can be handled via a calculated column. More on this second option is shown in the following example.
I hope this gets you started properly.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Milan Gurung
Top achievements
Rank 1
answered on 12 Mar 2009, 11:58 AM
Hi,

Thanks for the reply. I am curious is it possible to avoid expand button (+) for those records that don't have any detail record in detail table?

I triend to handle it in the DetailTableDataBind event by binding to nothing  but t is failing.

Code snippet below: 

Protected Sub gridPOMedia_DetailTableDataBind(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles gridPOMedia.DetailTableDataBind
        'Media PO's Supplier Invoice
        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
        Select Case e.DetailTableView.Name
            Case "Supplier"
                Dim orderNumber As Integer = 0
                orderNumber = Convert.ToInt32(dataItem.GetDataKeyValue("OrderNumber"))
                Dim ds As DataSet
                Dim manager As New ReportManager()
                ds = manager.RunPOControlSupplierInvoiceByOrderNumber(orderNumber)
if ds.tables(0).rows.count> 0 then
                e.DetailTableView.DataSource = ds.Tables(0)
end if 
        End Select
    End Sub


Thanks.

Milan G

0
Princy
Top achievements
Rank 2
answered on 13 Mar 2009, 04:51 AM
Hello Milan,

Check out the following help document which explains on how to hide the expand/collapse images when there are no detail records under parent row.
Hiding expand/collapse images when no records

Thanks
Princy.
0
Milan Gurung
Top achievements
Rank 1
answered on 13 Mar 2009, 08:33 AM
Thanks.

Milan G
Tags
Grid
Asked by
Milan Gurung
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Milan Gurung
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or