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

Hiding/Showing Detail Indicator

2 Answers 254 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 22 May 2012, 12:20 AM

Is there a way to control whether or not the detail indicator shows?

I have a data set that may or may not have detail data and I want the indicator to reflect that.  

Basically in my data I get a value back that tells me if there are detail records and if there are none, I don't want it to show.

What is the best way to do this?

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 22 May 2012, 08:41 AM
Hello Steven,

After the grid is populated(i.e DataBound event is triggered) you can remove the css class for desired .k-master-row>.k-hierarchy-cell>a element. That is the only way to hide the expand/collapse arrow.

Greetings,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
kevin zhu
Top achievements
Rank 1
answered on 07 Nov 2012, 03:40 AM
Hi Nikolay Rusev,

can you please tell me how to get value of field in dataBound? so that i can check if need to hide the detail
do you have some sample code for that? below it's my code.


$("#grid").kendoGrid({
                                                                    dataSource: { data: data, pageSize: 10},
                                                                    pageable: false,
                                                                    scrollable: false,
                                                                    detailInit: detailInit,
                                                                    dataBound: function(e) {
                                                                          if(e.data.Price==0)    //here i am not able to get the value.
                                                                              this.tbody.find("tr.k-master-row>.k-hierarchy-cell>a").hide();
                                                                    },
                                                                    columns: [
                                                                        { title: "Remove", template: "<img src='@Url.Content("~/Images/delete.png")' alt='Remove' border='0' style='cursor:pointer' onclick='RemoveSPRow(\"#=kendo.toString(Guid)#\");' />" },
                                                                        { field:"PackageName", title: "Package - Category - Service Order " },
                                                                        { field:"Price", title : "Price" },
                                                                        { field:"Gst", title : "GST" }
                                                                    ]
                                                                });

Tags
Grid
Asked by
Steven
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
kevin zhu
Top achievements
Rank 1
Share this question
or