How to add a DataGridColumn in code behind [SOLVED]

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

How to add a DataGridColumn in code behind [SOLVED]

Postby CyborgDE » Thu Sep 17, 2015 1:08 pm

Hello,

how can I add a DataGridTextColumn in code behind ???

This does not work ...

Code: Select all

currentGrid.Columns.Add(new DataGridTextColumn() { Header = "Name", Binding = new Binding("Name") });

Regards, Uwe

CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

Re: DataGridColumn

Postby CyborgDE » Fri Sep 18, 2015 3:57 am

I have found the answer :

Code: Select all

DataGridBoundColumn column = new DataGridTextColumn();
column.Header = "Name";
column.SetBinding(DataGridBoundColumn.BindingProperty, new Binding("Name"));
Columns.Add(column);


Regards, Uwe


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 4 guests

 

 

cron