Formatting column headers

2 posts, 0 answers
  1. hchattaway
    hchattaway avatar
    67 posts
    Member since:
    Feb 2007

    Posted 11 Jul 2007 Link to this post

    Hello

    I am reading in an XML file that was created in VFP. I have the VFP client extract a table to XML and it also generates the schema file. I have my WinForm app read in the schema (   DataSet.ReadXmlSchema()   ) and then have it read in the xml data file. That works great. But the RadGrid is unformatted. I would like to format the column headers and the column spacing.  Can I pre-format the grid to the XML schema, or can it be done dynamically when the dataset that is bound to the grid is defined by the schema??

    Thanks!
    Harold

  2. Mike
    Admin
    Mike avatar
    640 posts

    Posted 12 Jul 2007 Link to this post

    Hello Harold,

    When binding RadGrid it generates by default all columns with the default settings. You can customize each auto-generated column, using the method: radGridView.Columns["ColumnName"] and the set its HeaderText and other properties.
    Here is also another approach, if you do not want grid to create all the columns. You can alter the default behavior by setting the property: radGridView1.MasterGridViewTemplate.AutoGenerateColumns to false. Then you can create and add to the grid all the columns you need, specifying the DataField property to the corresponding xml attribute name and then setting all necessary properties. You can add columns using radGridView.Columns.Add method. I hope this helps.

    Regards,
    Mike
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top