Login

  • Sign in with Intersoft Social ID
  • Sign in with Intersoft ID (Developer Network)
  • Sign in with Google ID
  • Sign in with Open ID. Click for more options.
Intersoft Social ID
Password
Intersoft Latest Learn More

Latest Development Blogs

Blog RSS
Loading
Retrieving News

Forum                   Topics  Post

How to create WebGridColumn at runtime

1 reply. Last post: June 11, 2010 12:36 PM by Handy Surya
Rate this topic:
Average rating: Not rated yet.
Tags :

Hi,

I was just trying to create WebGridColumns (Button column) at runtime. I wrote the following code on WebGrid1_PrepareDataBinding event :


WebGridColumn column = new WebGridColumn("NewCol", "NewCol", Unit.Pixel(80));
column.Bound = true;
column.Name = txtFieldName.Text;
column.ColumnType = ColumnType.Button;
column.ButtonText = "Hello Button";

BudgetGrid.RootTable.Columns.Add(column);

But the second time when i click the button, a new column does gets created sucessfully, but the previous Button column does not shows the caption of all the buttons. It only shows all buttons but with empty text in it.


Any comments would be really apprecaited.
Thanks in advance.

Anup Vasudeva
All times are GMT -5. The time now is 2:50 PM.