We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to has checkbox template in treegrid

Hi all.
I'm using treegrid (TreeGridTemplateControl ). Now, how can I add checkbox in every row of grid
 <syncfusion:GridGroupingControl EnableCallbacks="false" ShowGroupDropArea="False"
                                                                            ID="GridGroupingControl1" runat="server" BorderCollapse="Separate" DragSelectionBackColor="Yellow"
                                                                            ShowLoadingIndicatorOnCallback="True" HotTrackButtons="False" AutoFormat="MAC"
                                                                            ClientObjectID="GridControl" ClientSideColumnResizing="False" PostBackOnRowDblClick="False"
                                                                            EnsureSelection="true" PageSize="3000" ExcelEditMode="true" OnQueryCellStyleInfo="GridGroupingControl1_QueryCellStyleInfo"
                                                                            TableLayoutMode="Fixed">
                                                                            <TableOptions ListBoxSelectionMode="None" ShowRowHeader="False" SelectionBackColor="101, 110, 151">
                                                                            </TableOptions>
                                                                            <TableDescriptor AllowNew="False" AllowEdit="False" AllowFilter="False">
                                                                                <RowBtnTemplate>
                                                                                    <asp:CheckBox ID="cbRowBtnTemplate" runat="server" OnCheckedChanged="cbRowBtnTemplate_CheckedChanged"
                                                                                        onclick="CheckAll(this);" AutoPostBack="true"></asp:CheckBox>
                                                                                </RowBtnTemplate>
                                                                                <Columns>
                                                                                    <syncfusion:GridColumnDescriptor MappingName="RegionName" HeaderText="Đơn vị hành chính"
                                                                                        Width="300">
                                                                                        <ItemTemplate>
                                                                                            <syncfusion:TreeGridTemplateControl ID="WebCustomControl1_1" runat="server" Expanded="<%#GetExpanded(Container)%>"
                                                                                                Text="<%#GetName(Container)%>" PlusMinusVisible="<%#GetPlusMinus(Container)%>"
                                                                                                Level="<%#GetLevel(Container)%>" RowIndex="<%#GetRowIndex(Container)%>" OnClick="WebCustomControl1_1_Click" />                                                                                                
                                                                                        </ItemTemplate>
                                                                                    </syncfusion:GridColumnDescriptor>
                                                                                    <syncfusion:GridColumnDescriptor MappingName="EvenFrom" HeaderText="Bên chẵn - Từ">
                                                                                    </syncfusion:GridColumnDescriptor>
                                                                                    <syncfusion:GridColumnDescriptor MappingName="EvenTo" HeaderText="Bên chẵn - Đến">
                                                                                    </syncfusion:GridColumnDescriptor>
                                                                                    <syncfusion:GridColumnDescriptor MappingName="OddFrom" HeaderText="Bên lẻ - Từ">
                                                                                    </syncfusion:GridColumnDescriptor>
                                                                                    <syncfusion:GridColumnDescriptor MappingName="OddTo" HeaderText="Bên lẻ - Đến">
                                                                                    </syncfusion:GridColumnDescriptor>
                                                                                    <syncfusion:GridColumnDescriptor MappingName="Total" HeaderText="Tổng">
                                                                                    </syncfusion:GridColumnDescriptor>
                                                                                    <syncfusion:GridColumnDescriptor MappingName="Note" HeaderText="Ghi chú" Width="300">
                                                                                    </syncfusion:GridColumnDescriptor>
                                                                                </Columns>
                                                                            </TableDescriptor>
                                                                        </syncfusion:GridGroupingControl>
RowBtnTemplate not work for me
Pls help me. Thank you very much.


3 Replies

SS Satheeskumar S Syncfusion Team June 21, 2013 04:50 AM UTC

Hi Ngatq,

 

 

Thanks for your interest in Syncfusion Products.

 

We have checked your sample code. In that you set ShowRowHeader Property to false, which is the cause of issue and we suggest you set the ShowRowHeader Property to true for using RowBtnTemplate in Treegrid.

 

 

Let us know if you have any other concerns.

 

 

Regards,

Satheeskumar S



NG ngatq June 26, 2013 08:01 AM UTC

Wow. Thank you very much. It worked


SS Satheeskumar S Syncfusion Team June 27, 2013 04:40 AM UTC

Hi Ngatq,

 

 

Thanks for the update.

 

We are happy to hear that your issue has been resolved.

 

Please let us know if you have any other concerns.

 

 

Regards,

Satheeskumar S


Loader.
Live Chat Icon For mobile
Up arrow icon