Gridview show image but hide column header? And a few other questions...

0 Answers 139 Views
GridView
Willy
Top achievements
Rank 2
Iron
Iron
Willy asked on 08 Apr 2022, 05:36 PM

Hello, I am trying to use the gridview to try to display data...this is kind of a work in progress as I don't know what best approach is that I should be taking to display the data or if I am even using the right control.  I am trying to piece things together from some of the examples I can find. My questions are:

1. In the column named "img" is it possible to just hide that header and place the image next to the text? 

2. Can those expanded columns be auto sized instead of manual sized?

3. Is there an example of a dropdown box in one of these expanded row?  

 

Here is my rough code  creating the expanded rows: 

    'create out custom datasource containing all the apps 
        Dim BusinessAppsDT As New DataTable("Apps")
        With BusinessAppsDT
            .Columns.Add("id", GetType(Guid))
            .Columns.Add("img", GetType(Byte()))
            .Columns.Add("name", GetType(String))
        End With

        For Each row As DataRow In dt.Rows
            For Each itm As MyPortalObjects.Objects.ListItem In DeSerializeListview(Of MyPortalObjects.Objects.ListItem)(row("User_Needed_BusinessApps"))
                 BusinessAppsDT.Rows.Add(row("id"), itm.IconByteArray, itm.Name)
            Next
        Next

        'gridview templates are the tabs?
        Dim BusinessAppsTemplate As New GridViewTemplate
        BusinessAppsTemplate.Caption = "Apps"
        BusinessAppsTemplate.DataSource = BusinessAppsDT
        gvQueue.Templates.Add(BusinessAppsTemplate)

        Dim BusinessAppsRelation As New GridViewRelation(gvQueue.MasterTemplate)
        With BusinessAppsRelation
            .ChildTemplate = BusinessAppsTemplate
            .ParentColumnNames.Add("id")
            .ChildColumnNames.Add("id")
        End With
        gvQueue.Relations.Add(BusinessAppsRelation)

        Dim BusinessAppsView As New HtmlViewDefinition()
        With BusinessAppsView
            .RowTemplate.Rows.Add(New RowDefinition())
            .RowTemplate.Rows(0).Cells.Add(New CellDefinition("img", 3, 1, 3))
            .RowTemplate.Rows(0).Cells.Add(New CellDefinition("name", 10, 1, 3))

        End With
        BusinessAppsTemplate.ViewDefinition = BusinessAppsView
Willy
Top achievements
Rank 2
Iron
Iron
commented on 12 Apr 2022, 12:30 AM

This question can be deleted. I took a different approach. 

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Willy
Top achievements
Rank 2
Iron
Iron
Share this question
or