Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi,

                                    I've got a problem showing the correct ButtonType of Treelist command column at runtime, the command column ButtonType was set to ButtonType.Image but it always shows as link instead of Image.

                                         I noticed that using Treelist.Columns.Assign() function to assign the Treelistcolumn collection doesn't render the correct button type, but when I use Treelist.Columns.Add() to add a command column, the image button shows up correctly. Please see my sample code snippet below, Thanks.

                                            protected void Page_Load(object sender, EventArgs e)
                                            {
                                                if (!Page.IsPostBack && !Page.IsCallback)
                                                {
                                                    this.AssignColumns();
                                                }

                                                this.BindData();
                                            }
                                              
                                              private void BindData()
                                              {
                                                   trListMain.DataSource = myDatasource;
                                                   trListMain.KeyFieldName = "GUID";
                                                trListMain.ParentFieldName = "ParentGUID";
                                          trListMain.DataBind();
                                                trListMain.ExpandAll();
                                              }
                                              
                                              private void AssignColumns()
                                              {
                                                   TreeListColumnCollection columnCollection = new TreeListColumnCollection(trListMain);
                                                   TreeListTextColumn code = new TreeListTextColumn();
                                                   TreeListTextColumn description = new TreeListTextColumn();
                                                   TreeListCommandColumn action = new TreeListCommandColumn();
                                                   
                                                   
                                                   code.Caption = "Code";
                                                code.Name = "Code;
                                                code.FieldName = "Code";
                                                code.Width = Unit.Pixel(130);
                                                columnCollection.Add(code);
                                                

                                                description.Caption = "Description";
                                                description.Name = "Description";
                                                description.FieldName = "Description";
                                                columnCollection.Add(description);
                                                   
                                                   action.ButtonType = ButtonType.Image; << This doesn't work.
                                                   action.Width = Unit.Pixel(156);
                                                   action.Caption = "Action";

                                                   action.NewButton.Visible = true;
                                                   action.NewButton.Image.Url = "~/Images/Grid/ButtonNew.png";
                                                   action.NewButton.Image.Width = Unit.Pixel(78);

                                                   action.DeleteButton.Visible = true;
                                                   action.DeleteButton.Image.Url = "~/Images/Grid/ButtonDelete.png";
                                                   action.DeleteButton.Image.Width = Unit.Pixel(78);

                                                   action.UpdateButton.Visible = true;
                                                   action.UpdateButton.Image.Url = "~/Images/Grid/ButtonUpdate.png";
                                                   action.UpdateButton.Image.Width = Unit.Pixel(78);

                                                   action.CancelButton.Visible = true;
                                                   action.CancelButton.Image.Url = "~/Images/Grid/ButtonCancel.png";
                                                   action.CancelButton.Image.Width = Unit.Pixel(78);

                                                   action.EditButton.Visible = true;
                                                   action.EditButton.Image.Url = "~/Images/Grid/ButtonEdit.png";
                                                   action.EditButton.Image.Width = Unit.Pixel(78);
                                                   columnCollection.Add(action);
                                                   
                                                   trListMain.Columns.Assign(columnCollection);
                                              }

                                0

                                Hello Fred,

                                Thank you for reporting this issue. I've converted your question to a bug report. We'll fix it as soon as possible.

                                Best Regards,
                                Nathan

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Your Privacy - Legal Statements

                                Copyright © 1998-2013 Developer Express Inc.
                                ALL RIGHTS RESERVED
                                All trademarks or registered trademarks
                                are property of their respective owners