RA
Rajasekar
Syncfusion Team
April 23, 2012 07:16 AM UTC
HI Fred,
Thanks for your update. You can achieve this requirement by using the below code snippet,
///Way #1
List _columnHeaders = new List();
foreach (GridDataVisibleColumn vc in this.dataGrid.VisibleColumns)
{
if (vc.HeaderText == null || vc.HeaderText == "")
{
_columnHeaders.Add(vc.MappingName);
}
else
{
_columnHeaders.Add(vc.HeaderText);
}
}
///Way #2
List _columnHeaders1 = new List();
int tempIndex = 0;
if (this.dataGrid.ShowRowHeader)
{
tempIndex = tempIndex + 1;
}
if (this.dataGrid.GroupedColumns.Count > 0)
{
tempIndex = tempIndex + this.dataGrid.GroupedColumns.Count;
}
for (int col = tempIndex; col < this.dataGrid.Model.ColumnCount; col++)
{
_columnHeaders1.Add(this.dataGrid.Model[0, col].CellValue.ToString());
}
For your reference, please find the sample in the below location,
Sample: SyncfusionGDC.zip
Note: We have found that, the similar queries is posted in the Incident #93556. We have also updated the details in that Incident too. If you have any queries we request you to update in that Incident Itself for better follow up.
Please let us know if you have any queries.
Thanks,
Rajasekar