GridDropDownColumn programatically

2 posts, 0 answers
  1. Gilberto
    Gilberto avatar
    65 posts
    Member since:
    Sep 2006

    Posted 05 Jul 2009 Link to this post

     How can i create gridDropDownColumn and its related sqldatasource at runtime?

    Thanks

    Gilberto
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Jul 2009 Link to this post

    Hello Gilberto,

     You can try out the following code to programatically create your dropdowncolumn:
    GridDropDownColumn dropDownColumn = new GridDropDownColumn(); 
    RadGrid1.Columns.Add(dropDownColumn); 
    dropDownColumn.UniqueName = "DropDownColumn"
    dropDownColumn.HeaderText = "DropDownColumn"
    dropDownColumn.DataSourceID = "SqlDataSource1"
    dropDownColumn.DataField = "ProductName"
    dropDownColumn.ListTextField = "ProductName"
    dropDownColumn.ListValueField = "ProductID"

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top