This is a migrated thread and some comments may be shown as answers.

Formatting column headers

1 Answer 216 Views
GridView
This is a migrated thread and some comments may be shown as answers.
hchattaway
Top achievements
Rank 1
hchattaway asked on 11 Jul 2007, 07:50 PM
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

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 12 Jul 2007, 12:56 PM
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
Tags
GridView
Asked by
hchattaway
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or