CheckBox in DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Let say i select rows of records with 4 columns from Database and want to display the data in DataGrid (ASP.NEt Server Control) with one column which must be displayed in CheckBox layout. For the column (which contains checkbox), when i click the CheckBox in the Header of DataGrid, all the rows (for column which contains Checkboxes) must be checked. When i uncheck the checkbox in Header of DataGrid, all the rows of that column must be unchecked, or when i try to manually check all the rows of records, the checkbox in Datagrid must be checked too.
My question is if i try to use Checkbox (Server Controls), i have to sacrifice for performance for flexibility (since we can check the logic in code behind) since every check of checkbox, i have to postback to server. however, according to my friend, if we try to use javascript for client-side checkbox to check for logic, the id of the client side checkbox control which we preset will be changed. Please suggest for a solution, thank u very much .
 
Machi
Take a look at this article
http://msdn.microsoft.com/library/d...pQuestionsAboutASPNETDataGridServerControl.as

----- Machi wrote: ----

Let say i select rows of records with 4 columns from Database and want to display the data in DataGrid (ASP.NEt Server Control) with one column which must be displayed in CheckBox layout. For the column (which contains checkbox), when i click the CheckBox in the Header of DataGrid, all the rows (for column which contains Checkboxes) must be checked. When i uncheck the checkbox in Header of DataGrid, all the rows of that column must be unchecked, or when i try to manually check all the rows of records, the checkbox in Datagrid must be checked too.
My question is if i try to use Checkbox (Server Controls), i have to sacrifice for performance for flexibility (since we can check the logic in code behind) since every check of checkbox, i have to postback to server. however, according to my friend, if we try to use javascript for client-side checkbox to check for logic, the id of the client side checkbox control which we preset will be changed. Please suggest for a solution, thank u very much .
 
Back
Top