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

Help to group in TreeGrid

Hello,

I need to make groups in my treegrid but i didn't really understood how make it.
Here is my Treegrid

 <ej:TreeGrid ID="TreeGrid" runat="server"
        ChildMapping=""
        CssClass=""
        DataSourceCachingMode="None"
        DataSourceID="SqlDataSourceOrdinateurs"
        Locale="fr-FR"
        IdMapping=""
        ParentIdMapping=""
        AllowFiltering="True"
        AllowColumnResize="true">
        <Columns>
            <ej:TreeGridColumn Field="Client" FilterEditType="Dropdown" Width="120">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="Type" FilterEditType="Dropdown" Width="80">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="Etiquette" Width="80">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="Marque" Width="80" FilterEditType="Dropdown">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="PN" Width="80">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="SN" Width="80">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="Nom" Width="80">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="Affectation" Width="120">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="Stock" Width="50">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="DateDébut" Width="80" HeaderText="Entrée">
            </ej:TreeGridColumn>
            <ej:TreeGridColumn Field="DateFin" Width="80" HeaderText="Sortie">
            </ej:TreeGridColumn>
        </Columns>
    </ej:TreeGrid>

I need to Group by Client 1st and Type 2nd. 
Is it possible to display number of row for each grouping level ?

Thank you for help :)

4 Replies

JS Jonesherine Stephen Syncfusion Team November 15, 2016 03:43 PM UTC

Hi Guyot, 
Thanks for contacting Syncfusion support. 
We have analyzed the provided code snippet. By using “idMapping” and “parentIdMapping” property we can achieve the hierarchy [parent-child] in TreeGrid. 
For parent records the “parentId” should be null. For child records we need to map the required parentRecord’s Id as its parentId to achieve the hierarchy. 
Please find the code example below: 
      <ej:TreeGrid ID="TreeGrid1" runat="server" 
                IdMapping="CatUniqueID" 
                ParentIdMapping="CatBranchID" 
                DataSourceID="SQL1">                 
            </ej:TreeGrid>         
      <asp:SqlDataSource runat="server" ID="SQL1" ConnectionString="DefaultConnection" 
            SelectCommand="SELECT * FROM treedatatable"></asp:SqlDataSource> 
    </form> 
We have also prepared the sample and rendered the Tree Grid with SQL database for your reference. 
Please find the sample from below location. 
Is this your requirement? If not could you please share more details regarding your requirement with us. It would be helpful for us to serve you better. 
 
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include Syncfusion.EJ and Syncfusion.EJ.Web dlls to render the TreeGrid control which is available in Essential Studio installed location.   
Regards, 
Jone sherine P S 



GU GUYOT November 16, 2016 10:45 AM UTC

Thank you for help but i don't understand what to do to make it works. May be my dat are not well designed.
Here's what I have and what i want :


Is it possible to make this with treegrid ?
What must be my treegrid parameters ?

Thank you very much


GU GUYOT replied to GUYOT November 16, 2016 10:47 AM UTC

Thank you for help but i don't understand what to do to make it works. May be my dat are not well designed.
Here's what I have and what i want :


Is it possible to make this with treegrid ?
What must be my treegrid parameters ?

Thank you very much

Sorry image won't work, i uploaded it in attached zip

Attachment: Capture_cf688a.zip


JS Jonesherine Stephen Syncfusion Team November 17, 2016 10:37 AM UTC

Hi Guyot, 
In TreeGrid we can achieve the hierarchy by following ways: 
1. For self-reference data source we can achieve the hierarchy by using “idMapping” and “parentIdMapping”. 
2. For hierarchical data we need to map “childMapping” to achieve this hierarchy. 
We have analyzed the attached screen shots. As this feature is not available TreeGrid, we will consider this a feature request 
Please refer the below link regarding Grouping property of Grid.  
Please refer the above sample and let us know if it conforms to your requirement. If our definition of this feature is different from your requirement, then let us know the specific details, so that we can work towards fulfilling your requirement. 
Regards, 
Jone sherine. P S 


Loader.
Live Chat Icon For mobile
Up arrow icon