Home Forums WPF controls Xceed DataGrid for WPF Add Column title in C#

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26662 |

    searched everywhere but can’t find a way to add column title in C# …..what i want is that am getting two columns from Linq query …but as i can’t add dynamic column names in the select query hence i want to add them after the query ends ……so how to add column titles in C#…….

    Imported from legacy forums. Posted by rags (had 1914 views)

    User (Old forums)
    Member
    Post count: 23064

    You should be able to add a column after your query using the following;

    //
    // Create a Column and add it to the Columns collection of your GridControl
    //
    Column c = new Column(); // Overloaded, so could supply name, title, and binding if desired
    c.FieldName = “MyColumn”; // the column identifier
    c.Title = “My Column Title”; // The title displayed in the column header

    … // Additional properties to be setup

    Columns.Add(c); The Columns Property on your GridControl

    Imported from legacy forums. Posted by Rob (had 3406 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.