Hi Amish,
You can achieve your requirement as like below code snippet. Also, we have prepared a simple sample for adding columns in the runtime based on your requirement and attached it in the below sample link.
Code Snippet:
|
int count = 0;
viewmodel.DataTable.Columns.Add("Flag", typeof(int));
foreach (System.Data.DataRow a in viewmodel.DataTable.Rows)
{
a[4] = count;
count++;
viewmodel.DataTable.AcceptChanges();
}
sfGrid.Columns.Insert(2,new GridTextColumn() { MappingName="Flag"}); |
Please revert us to with more details about your requirement with illustration or image and explain in detail about unmounted column which you mentioned in your previous update, if we misunderstand your requirement.
Regards,
Suja