Jaya,
Thanks. the CellValueType did the trick, though when switching multiple columns, there needs more logic than a simple hash table.
Not trying to be picky, however, how do you get the column width switched as well?
Thanks,
Q
>
Hi Q,
You can achieve the reordering of the columns by storing the column information in a Hashtable and by handling Grid_PrepareViewStyleInfo event.
Here is the code snippet.
this.multiColumnComboBox1.ListBox.Grid.PrepareViewStyleInfo+=new Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo);
Hashtable hash = new Hashtable();
void Grid_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
GridControl grid = sender as GridControl;
if (hash.Contains(e.ColIndex))
{
if (hash[e.ColIndex] != null)
{
e.Style.CellValueType = grid[e.RowIndex, int.Parse(hash[e.ColIndex].ToString())].CellValueType;
e.Style.Text = grid[e.RowIndex, int.Parse(hash[e.ColIndex].ToString())].Text;
}
}
}
Please refer the modified sample in the below location and let me know if you have any other questions.
http://websamples.syncfusion.com/samples/Tools.Windows/F61776_1/main.htmThanks for your patience.
Regards,
Jaya