Current filter:
                                You should refresh the page.
                                  • Hi there, i'm trying to create a grid with a TemplateColumn in code (no xaml).

                                    Do you have an example for this? This is my actual code... and i have no clue how to add two Labels inside this TemplateColumn:

                                    gridcontrol.Columns.Add(new TextColumn() { FieldName = "sName", Caption = Translate.StrName }); gridcontrol.Columns.Add(new TemplateColumn() { FieldName = "sDescription", Width = 90, DisplayTemplate = new DataTemplate (typeof(Grid)) { ... } });

                                    Thanks a lot


                                1 Solution

                                Creation Date Importance Sort by

                                Hello Stephan,

                                Currently, we have no such example in our database. However, our developers created a sample project illustrating how to create a TemplateColumn in code behind. Please take a moment to review the attached project.


                                • Stephan Methner 06.18.2015

                                  perfect... exactly what i was looking for... Thanks a lot

                                • Elliot (DevExpress Support) 06.19.2015

                                  Hello Stephan,

                                  I am happy to hear that you have resolved this issue. Please do not hesitate to contact us again if you have any further difficulties. We are always ready to help.


                                • Alan Damper 08.19.2016


                                  I tried downloading from the link but it only gives the 'Welcome' example program, not the one dealing with Template Columns in Code.

                                  I have the same query so can you put a fresh link on this answer. Thanks.


                                • Alex Bli (DevExpress Support) 08.19.2016

                                  Hi Alan,

                                  The link in the Answer section is correct, and the project from this link works well. This project doesn't contain the "Welcome" text at all (you can try to search for it), so I suppose that you are running a different project. Would you please check this? Additionally you can download this archive and run the project from it again.