View Issue Details

IDProjectCategoryView StatusLast Update
0001398NoesisGUIUnitypublic2023-03-27 12:14
ReporterKhonan Assigned Tosfernandez  
PrioritynormalSeverityfeature 
Status feedbackResolutionopen 
Product Version2.1.0f1 
Target Version3.2 
Summary0001398: Feature Request : DatagridView
Description

DataGridView are not implemented and I use a lot of them ;)

Be great to get them exported ;)

Steps To Reproduce

Try to make a Datagridview in unity from an XAML :)

PlatformAny

Activities

nokola

nokola

2019-01-24 23:01

reporter   ~0005416

Quick idea: You might be able to modify this source to self-implement DataGrid https://github.com/MicrosoftArchive/SilverlightToolkit/tree/master/Release/Silverlight5/SampleSource/Controls/Controls.Samples/DataGrid

Khonan

Khonan

2019-01-25 14:37

reporter   ~0005419

Thanks, I'll have a look.

May be in the wpf source code too : https://github.com/dotnet/wpf

nokola

nokola

2019-01-25 16:41

reporter   ~0005420

good point!

Flem100@live.dk

[email protected]

2021-08-23 14:52

reporter   ~0007375

Last edited: 2021-08-23 14:52

I would also love to get Datagrid in Noesis. Does anyone have a working ported version they could share, or something similar even? (Would love to have autogenerated columns though)
I looked into the WPF source code for Datagrid. That's too difficult for me, sadly...

sfernandez

sfernandez

2021-08-23 16:36

manager   ~0007376

Have you tried ListView?

Flem100@live.dk

[email protected]

2021-08-24 12:04

reporter   ~0007379

I actually thought it wasn't supported with the GridView inside. Mostly because your own example (Scoreboard) didn't use it. I have now tested the ListView with GridView and it works just fine. Now I need to figure a way to generate the columns based on the fields of the objects.
Am I so lucky that you already have an example of that (or just a hint perhaps) or do I need to use my own brain? :)
I started creating my own little control which basically worked but needs a lot of work so I would rather use an existing control and ListView should be the way. I just need to add the following code somehow:
objects = new List<Item>() { new Item { Id = 1, Name = "Item1" }, new Item { Id = 2, Name = "Item2" } };

        int currentRowIndex = 0;

        foreach (var obj in objects)
        {
            int currentColumnIndex = 0;
            g_Root.RowDefinitions.Add(new RowDefinition());
            foreach (PropertyInfo pi in obj.GetType().GetProperties())
            {
                g_Root.ColumnDefinitions.Add(new ColumnDefinition());

                TextBlock tb = new TextBlock();
                tb.Text = obj.GetType().GetProperty(pi.Name).GetValue(obj).ToString();
                g_Root.Children.Add(tb);
                Grid.SetRow(tb, currentRowIndex);
                Grid.SetColumn(tb, currentColumnIndex);
                currentColumnIndex++;
            }
            currentRowIndex++;
        }
Flem100@live.dk

[email protected]

2021-08-24 13:57

reporter   ~0007381

Last edited: 2021-08-25 14:28

Okay it was fairly simple:

object obj = collectionOfWhateverTypeOfObjects.First();
gv_Data.Columns.Clear();
foreach (PropertyInfo pi in obj.GetType().GetProperties())
{
var column = new GridViewColumn()
{
Header = pi.Name,
DisplayMemberBinding = new Binding(pi.Name)
};
gv_Data.Columns.Add(column);
}
lv_Data.ItemsSource = collectionOfWhateverTypeOfObjects;

One problem though. It works fine on the Blend-side, but you seem to have another version of the Binding class which doesn't fit the normal used in DisplayMemberBinding.
To fix the problem I found this post https://www.noesisengine.com/forums/viewtopic.php?f=3&t=1868&p=12469&hilit=DisplayMemberBinding#p12469
That worked :)

sfernandez

sfernandez

2021-08-25 12:25

manager   ~0007382

Great, thanks for sharing your solution.

colin14321

colin14321

2022-08-15 18:37

reporter   ~0008043

Hi there,

The current project I am currently working on porting from WPF to Noesis utilizes a lot of datagrid. I am working on changing them to ListView, however I was wondering if the DataGrid has plans of being implemented in the future?

Thank you!

sfernandez

sfernandez

2022-08-16 11:33

manager   ~0008044

Implementing DataGrid was not planned because using a ListView covers the same scenarios most of the time.
If you think having DataGrid is necessary for your project we can add this task for a future release after our next major version.

nokola

nokola

2022-08-16 18:46

reporter   ~0008046

Not having a DataGrid is OK with me - I implemented the functionality I needed with some combination of list/other views

Issue History

Date Modified Username Field Change
2019-01-23 11:20 Khonan New Issue
2019-01-23 11:20 Khonan Tag Attached: DataGridView
2019-01-24 11:07 sfernandez Assigned To => sfernandez
2019-01-24 11:07 sfernandez Status new => assigned
2019-01-24 23:01 nokola Note Added: 0005416
2019-01-25 14:37 Khonan Note Added: 0005419
2019-01-25 16:41 nokola Note Added: 0005420
2021-08-23 14:52 [email protected] Note Added: 0007375
2021-08-23 14:52 [email protected] Note Edited: 0007375
2021-08-23 16:36 sfernandez Status assigned => feedback
2021-08-23 16:36 sfernandez Note Added: 0007376
2021-08-24 12:04 [email protected] Note Added: 0007379
2021-08-24 13:57 [email protected] Note Added: 0007381
2021-08-24 13:57 [email protected] Note Edited: 0007381
2021-08-24 13:57 [email protected] Note Edited: 0007381
2021-08-24 14:08 [email protected] Note Edited: 0007381
2021-08-24 14:27 [email protected] Note Edited: 0007381
2021-08-25 00:44 [email protected] Note Edited: 0007381
2021-08-25 12:25 sfernandez Note Added: 0007382
2021-08-25 12:38 [email protected] Note Edited: 0007381
2021-08-25 14:28 [email protected] Note Edited: 0007381
2022-08-15 18:37 colin14321 Note Added: 0008043
2022-08-16 11:33 sfernandez Note Added: 0008044
2022-08-16 11:34 sfernandez Target Version => 3.2.0
2022-08-16 18:46 nokola Note Added: 0008046
2023-03-27 12:14 jsantos Target Version 3.2.0 => 3.2
2025-10-10 13:29 jsantos Category Unity3D => Unity