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:

                                    [C#]
                                    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

                                    Stephan

                                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.

                                Thanks,
                                Elliot

                                • Stephan Methner 06.18.2015

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

                                • 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.

                                  Thanks,
                                  Elliot

                                • Alan Damper 08.19.2016

                                  Hi,

                                  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.

                                  Alan

                                • 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.

                                  Thanks
                                  Alex