ways to create table
-
Hi. I have a web page, which collects information about project (name, project date create, description, project date due, etc). One of the things I need to collect is the "project assigned to" information. For this purpose I need to build a table or any other structure that can support the following: 1. the table should have 5 rows as default 2. the table should have ability to add/remove rows if needed 3. the table will consist of 2 cell. a. Role - dynamic drop-down (data will be populated from db) b. Name - text field 4. adding/removing rows should not affect data entered in other fields. Basically if I filled all 5 rows and want to add sixth row my data will be there with new row added. The same goes for removing rows (I guess this is something had to do with State). I've tried different things (datatable and datagrid) but couldn't complete all 4 point described above. Did anyone had experience with something like this or have any suggestions? Thank you, Alex.
-
Hi. I have a web page, which collects information about project (name, project date create, description, project date due, etc). One of the things I need to collect is the "project assigned to" information. For this purpose I need to build a table or any other structure that can support the following: 1. the table should have 5 rows as default 2. the table should have ability to add/remove rows if needed 3. the table will consist of 2 cell. a. Role - dynamic drop-down (data will be populated from db) b. Name - text field 4. adding/removing rows should not affect data entered in other fields. Basically if I filled all 5 rows and want to add sixth row my data will be there with new row added. The same goes for removing rows (I guess this is something had to do with State). I've tried different things (datatable and datagrid) but couldn't complete all 4 point described above. Did anyone had experience with something like this or have any suggestions? Thank you, Alex.
alexfromto wrote:
3. the table will consist of 2 cell.
you mean, two columns? I think that those facts are pretty okay with DataGrid. I have done something like that with Datagrid in ASP.NET 1.1...
alexfromto wrote:
1. the table should have 5 rows as default
you can bind with the empty dataset to your datagrid.
alexfromto wrote:
2. the table should have ability to add/remove rows if needed
For adding row, I used the footer template in Datagrid. For removing row, I added the "Delete" link with command in grid template.
alexfromto wrote:
a. Role - dynamic drop-down (data will be populated from db) b. Name - text field
ItemTemplate is pretty okay for you. it allows you to add any web control (including dropdown ctl and textbox control) in Datagrid.
alexfromto wrote:
4. adding/removing rows should not affect data entered in other fields. Basically if I filled all 5 rows and want to add sixth row my data will be there with new row added. The same goes for removing rows
Yeah. It is very okay with Datagrid item template. but if you do some action, the postback will be occured.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
alexfromto wrote:
3. the table will consist of 2 cell.
you mean, two columns? I think that those facts are pretty okay with DataGrid. I have done something like that with Datagrid in ASP.NET 1.1...
alexfromto wrote:
1. the table should have 5 rows as default
you can bind with the empty dataset to your datagrid.
alexfromto wrote:
2. the table should have ability to add/remove rows if needed
For adding row, I used the footer template in Datagrid. For removing row, I added the "Delete" link with command in grid template.
alexfromto wrote:
a. Role - dynamic drop-down (data will be populated from db) b. Name - text field
ItemTemplate is pretty okay for you. it allows you to add any web control (including dropdown ctl and textbox control) in Datagrid.
alexfromto wrote:
4. adding/removing rows should not affect data entered in other fields. Basically if I filled all 5 rows and want to add sixth row my data will be there with new row added. The same goes for removing rows
Yeah. It is very okay with Datagrid item template. but if you do some action, the postback will be occured.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
Yes. I mean 2 columns. 1. I have no problem creating DataGrid. How can I assign empty DataSet to DataGrid. I've built a table (5 rows) with empty cell and added to my DataGrid. Is this the way of doing it? 2. Do you have anything code wise so I can see how add/remove works? 3. I did it and had no problem 4. didn't get exactly what you mean here. Will I lose data entered or datagrid will keep it? Thanks a lot
-
Yes. I mean 2 columns. 1. I have no problem creating DataGrid. How can I assign empty DataSet to DataGrid. I've built a table (5 rows) with empty cell and added to my DataGrid. Is this the way of doing it? 2. Do you have anything code wise so I can see how add/remove works? 3. I did it and had no problem 4. didn't get exactly what you mean here. Will I lose data entered or datagrid will keep it? Thanks a lot
OK. Firgure it out. Wow. Yeah.