This is a migrated thread and some comments may be shown as answers.

Dyanamic Checkbox template column

1 Answer 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vijay
Top achievements
Rank 1
vijay asked on 27 Jan 2011, 12:25 PM

Hello
    I have created the dynamic checkbox template column.  But the check boxes which is present in the grid has not enabled.  I can't check or decheck those checkbox controls.  Please help me on this Issue......



using

 

System;

 

using

 

System.Collections.Generic;

 

using

 

System.Linq;

 

using

 

System.Web;

 

using

 

System.Web.UI;

 

using

 

System.Web.UI.WebControls;

 

using

 

Telerik.Web.UI;

 

using

 

System.Data;

 

using

 

DataAccessLayer;

 

namespace

 

GemsStandard.Transactions.Fees

 

{

 

public partial class tempDymClm : System.Web.UI.Page

 

{

 

FetchSQL fetchSQL = new FetchSQL();

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

BindColumn();

}

 

public void BindColumn()

 

{

 

//http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-runtime-columns.aspx

 

 

DataTable dt = new DataTable();

 

dt = fetchSQL.GetDataTable(

"select ac.AcademicYearName from tblAcademicYear ac", CommandType.Text);

 

 

 

GridBoundColumn boundColumn = new GridBoundColumn();

 

 

// boundColumn = new GridBoundColumn();

 

boundColumn.UniqueName =

"AcademicYearName";

 

boundColumn.DataField =

"AcademicYearName";

 

boundColumn.HeaderText =

"AcademicYearName";

 

RadGrid1.MasterTableView.Columns.Add(boundColumn);

 

 

 

GridCheckBoxColumn checkboxColumn = new GridCheckBoxColumn();

 

checkboxColumn.HeaderText =

"BusFee";

 

checkboxColumn.UniqueName =

"BusFee";

 

 

RadGrid1.MasterTableView.Columns.Add(checkboxColumn);

 

GridCheckBoxColumn checkboxColumn1 = new GridCheckBoxColumn();

 

checkboxColumn1.HeaderText =

"TFee";

 

checkboxColumn1.UniqueName =

"TFee";

 

 

RadGrid1.MasterTableView.Columns.Add(checkboxColumn1);

RadGrid1.MasterTableView.Columns.Add(Gvr);

RadGrid1.DataSource = dt;

RadGrid1.DataBind();

}

}

}

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 27 Jan 2011, 01:41 PM
Hello Vijay,

GridCheckBoxColumn displays a check box to represent a boolean value. When the grid is in browser mode, or if the column is read-only, the check box is disabled. When the column is editable, the check box is enabled. If you need checkbox column to be enabled in browser mode you should use GridTemplateColumn with check box.

For more information about how to create template column dynamically is available here:
http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html

Greetings,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
vijay
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or