Grid with CheckBox Columns
-
Hi All, i have a textbox with numeric insert so if i worte 5 there, then i need to create a grid with 5 columns with checkboxes. So the column should add at runtime i can't define the template field at designtime, when i user checkboxfield to create checkbox column dynamically then the column created but the checkboxes is not appeared in the column. So what would the solution. plz do reply. Thanks Yogesh Agarwal
-
Hi All, i have a textbox with numeric insert so if i worte 5 there, then i need to create a grid with 5 columns with checkboxes. So the column should add at runtime i can't define the template field at designtime, when i user checkboxfield to create checkbox column dynamically then the column created but the checkboxes is not appeared in the column. So what would the solution. plz do reply. Thanks Yogesh Agarwal
No need to create it dynamically.Create a Templated Gridview and when user enters value in textbox, create a datasource with that specified number of rows and bind it to grid.
Arun Jacob http://codepronet.blogspot.com/
-
No need to create it dynamically.Create a Templated Gridview and when user enters value in textbox, create a datasource with that specified number of rows and bind it to grid.
Arun Jacob http://codepronet.blogspot.com/
But i dont know how much column has to created because no. of columns is dynamic according to the numbers user enters. So how many template field i have to created.
-
Hi All, i have a textbox with numeric insert so if i worte 5 there, then i need to create a grid with 5 columns with checkboxes. So the column should add at runtime i can't define the template field at designtime, when i user checkboxfield to create checkbox column dynamically then the column created but the checkboxes is not appeared in the column. So what would the solution. plz do reply. Thanks Yogesh Agarwal
HI,this is my idea: 1、you can add a table with runing at service in UI 2、create table tb=new row() 3、crate cell c = new cell() 4、ch = new chkbox() 5、c.add.control(ch) 6、tb.add(c) 7、tablName.add(tb) you can add dynamic table cell so...i don't know than can help you .
-
But i dont know how much column has to created because no. of columns is dynamic according to the numbers user enters. So how many template field i have to created.
Where this column name coming from?I mean where this column is mapped to?Where you get the no of records from? if the column is only dynamic and you know the no of records, then you can try any of the following solution.I guess it'll work, Either 1.Add Template column for check box and make AutoGenerateColumns true. Add dynamic columns to the datasource and bind it to grid. or 2.Create a datasource with no of records, Bind the grid with the DataSource and add the dynamic columns in the Row_Created event.
Arun Jacob http://codepronet.blogspot.com/
-
Where this column name coming from?I mean where this column is mapped to?Where you get the no of records from? if the column is only dynamic and you know the no of records, then you can try any of the following solution.I guess it'll work, Either 1.Add Template column for check box and make AutoGenerateColumns true. Add dynamic columns to the datasource and bind it to grid. or 2.Create a datasource with no of records, Bind the grid with the DataSource and add the dynamic columns in the Row_Created event.
Arun Jacob http://codepronet.blogspot.com/
For now i create the columns with the name 1,2,3,... for loops counter value. and i dont want to bind it with any database table. i used the following code to create the column for now
**loop** CheckBoxField cf=new CheckBoxField(); cf.HeaderText=i.toString(); gridview.columns.add(cf) **End Loop**
it creates the column for me but no checkbox appears there -
For now i create the columns with the name 1,2,3,... for loops counter value. and i dont want to bind it with any database table. i used the following code to create the column for now
**loop** CheckBoxField cf=new CheckBoxField(); cf.HeaderText=i.toString(); gridview.columns.add(cf) **End Loop**
it creates the column for me but no checkbox appears thereHow you are binding your gridview?Whats the DataSource?
Arun Jacob http://codepronet.blogspot.com/