Last post Jun 03, 2011 11:03 PM by Decker Dong - MSFT
Jun 01, 2011 08:59 PM|dajohnson2s|LINK
I am in the planning stages for a new .net control and am looking for feedback/tips.
What I am hoping to accomplish is a 'checkbox gridview matrix'. I don't know if this is fesiable ( hoping to figure that part out with this posting ) but, what I would like have is a header and first column that would have text. then every other column
would be a checkbox.
Permissions | Admin | Users
Update Tables | [checkbox] | [checkbox]
Select Data | [checkbox] | [checkbox]
My current solution is to add the checkbox and set the value on rowdatabind.
Any thoughts on this idea are welcome. I don't have the experience creating controls to really say for sure if this would be a good idea so I hope I could get some advice.
Jun 03, 2011 09:51 AM|Darknight_360|LINK
you can use a datatable then bind it to the gridview:
protected void Page_Load(object sender, EventArgs e)
//create a datatable
DataTable dt = new DataTable();
DataRow row1 = dt.NewRow();
row1["Permissions"] = "Update Tables";
DataRow row2 = dt.NewRow();
row2["Permissions"] = "Select Data";
//bind the datatable to the gridview
GridView1.DataSource = dt;
Jun 03, 2011 11:03 PM|Decker Dong - MSFT|LINK
I agree what the 2nd man's idea——
My additions——In my mind, GridView will use different kinds of BoundControl to show different kinds of things in itself.——e.g：string is usually shown in Label, while bool is shown with CheckBox.
So if you want to make a CustomControl, Just put a GridView into the ascx and use it anywhere you like.