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

VB samples for double grouping and summing

the programmers before me are using vb, all the samples are in c#.. are there any samples anyone can provide?

9 Replies

JS jerome sabourin May 20, 2014 12:03 PM UTC

also in the samples it would be appreciated if someone would include how you set the name of the grouping box so it doesn't use the data column.


JS jerome sabourin May 20, 2014 12:03 PM UTC

I was looking for code more along the lines of this.

.Grouping(Sub(group)
     group.GroupDescriptors(Sub(cols)
        cols.Add(Function(c) c.tc_date)End Sub) End Sub) _

the only problem i have is that in the group box, it is using an ugly column name like tc_date when i want it to show something nicer to the end user like simply date.


MS Madhu Sudhanan P Syncfusion Team May 20, 2014 12:03 PM UTC

Hi Jerome,

 

Thanks for using Syncfusion products.

 

Based on your request, we have created a simple sample using ASP.Net MVC Grid control in VB and the same can be downloaded from the below location.

 

Sample Location: Wrapper_VB.zip


In the above provided sample, we have changed the group area text using Localization property of the grid. Please refer the attachment image.

Please refer the following code snippet.

 

 

  Dim gridbuilder = Html.EJ().Grid(Of Sample.OrdersView)("SampleGrid")

  . . . . .

  gridbuilder.Localization("en-US");

 . . . . .

 

@gridbuilder.Render()

 

<script>

    ej.Grid.localization["en-US"] = {

        GroupDropArea: "Column Grouping Area (Drag columns here to group)"

    }

</script>

 

 

Please let us know if we misunderstood your requirement and provide us more information regarding your requirement. The information provided would be more helpful for us to analyze your requirement and provide better solution as early as possible.

 

Regards,

Madhu Sudhanan. P


Attachment: Capture1_108ed0db.zip


AM Abdul Matin M Syncfusion Team May 26, 2014 05:20 AM UTC

Hi Jerome,

 

Thanks for your update.

 

We have analysed your requirement and we suspect that you need to change the HeaderText. So we suggest you to use .HeaderText() property to give the name you desire. Please refer the below code snippet.

[CSHTML]

@code  

    Dim gridbuilder = Html.Syncfusion.Grid(Of Student)("GenericListGrid").Datasource(Model)

    gridbuilder.Datasource(Model)

    'add grid columns using gridbuilder

    gridbuilder.Column(Function(cols) cols.Add(Of Long)(Function(c As Student) c.UniversityCode).HeaderText("University Code").Width(130))

    gridbuilder.Column(Function(cols) cols.Add(Of System.Nullable(Of Date))(Function(c As Student) c.BirthDate).HeaderText("BirthDate").Width(130))

    gridbuilder.Column(Function(cols) cols.Add(Of String)(Function(c As Student) c.FirstName).HeaderText("Name First").Width(130))

    gridbuilder.Column(Function(cols) cols.Add(Of String)(Function(c As Student) c.LastName).HeaderText("LastName").Width(120))

    gridbuilder.Caption("Student Details")

    gridbuilder.ShowCaption(true)

    gridbuilder.EnablePaging()    'Paging Enabled

    gridbuilder.EnableSorting()    'Sorting Enabled"

    gridbuilder.Grouping(Function(group) group.GroupDescriptors(Function(grouped) grouped.Add(Function(c) c.FirstName)).IsExpanded(True))    'Grouping Enabled for UniversityCode

     gridbuilder.Mappers(Function(map)

                                map.Action("GridFeatures")

                        End Function)

    gridbuilder.Render()

End Code

We have created a simple sample for your requirement and the same can be downloaded from the link below.

Please use the sample and check whether it meets your requirement. If we have misunderstood your requirement please provide us with information so that we could able to sort out the cause of this issue and provide you a better solutions quickly?. The information provided would be a great help for us to resolve this issue.

 

Please let us know if you need any further assistance.

 

Regards,

Abdul Matin M


Attachment: MvcApplication4Sample_cdf9d6e7.zip


JS jerome sabourin May 26, 2014 06:42 PM UTC

check out the image i have attached here. The isssue is not the headers of the table, its the grouping box that appears to represent the columns you are grouping on. Its using the data name of the columns and not the 'header text' i have provided in the table.
Attachment: Grouping_45d6b70f.zip


JS jerome sabourin May 26, 2014 06:42 PM UTC

actually i apologize i think u have answered my question, let me go back and try what you have suggested.


AM Abdul Matin M Syncfusion Team May 30, 2014 09:42 AM UTC

Hi Jerome,

 

Thanks for your update.

 

Please use our suggestion and get back to us if you have any queries. We will be happy to hear from you.

 

Please let us know if you need any further assistance.

 

Regards,

Abdul Matin M



JS jerome sabourin May 30, 2014 06:05 PM UTC

no this does not change the text of the grouping cues. see my above image zipped.


HJ Hariharan J V Syncfusion Team June 5, 2014 05:19 AM UTC

Hi Jerome,

 

Thanks for your update.

 

We are sorry about the inconvenience caused.

 

We are unable to reproduce issue. We have modified the above given sample to demonstrate Initial grouping on grid with multiple columns and video demonstration of a working sample and the same can be downloaded from the below link.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/MvcApplication4-556184026.zip

 

Video: http://www.syncfusion.com/downloads/support/directtrac/general/video162886718.zip

 

Could you please replicate your issue in the above sample and send back to us with more information so that we could able to sort out the cause of this issue and provide you a better solution.

 

Please let us know if you need any further assistance.

 

Regards,

Hariharan J.V.


Loader.
Live Chat Icon For mobile
Up arrow icon