|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using DataList - table and headersHello,
Im often use DataList for viewing and editing datas. For better layout controling, I create a table in the template and there I put other controls or binding data into table cells. Sometimes, I would use the HeaderTemplate as header of my table (in ItemTemplate). How to do it? How to make the table columns in HeaderTemplate linked to table columns in ItemTemplate? Thanks. Mirek. Mirek,
Wrap the table around the datalist like this: <table> <asp:DataList ...> <HeaderTemplate> <tr>...</tr> </HeaderTemplate> <ItemTemplate> <tr>...</tr> </ItemTemplate> </asp:DataList> </table> Eliyahu Show quoteHide quote "Mirek Endys" <MirekE@community.nospam> wrote in message news:uy4W$co7FHA.472@TK2MSFTNGP15.phx.gbl... > Hello, > > Im often use DataList for viewing and editing datas. For better layout > controling, I create a table in the template and there I put other > controls or binding data into table cells. > > Sometimes, I would use the HeaderTemplate as header of my table (in > ItemTemplate). > How to do it? How to make the table columns in HeaderTemplate linked to > table columns in ItemTemplate? > > Thanks. > > Mirek. > > The datalist exposes a property named RepeatLayout which can have a value of
either Table or Flow. To experiment with both outcome try this sample from the MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatalistclassrepeatlayouttopic.asp The RepeatLayout=Flow would produce a span for each datalist item being rendered on the browser. This would prevent you from enclosing the entire datalist in a <Table> (where the header is only a Tablerow and each item in the body is another TableRow as the repeater would do). Therefore you should use CSS to align the columns within different tables by specifying the TD width values as I did in this sample: http://www.societopia.net/samples/DataList_Hierarchy.aspx Show quoteHide quote "Mirek Endys" wrote: > Hello, > > Im often use DataList for viewing and editing datas. For better layout > controling, I create a table in the template and there I put other controls > or binding data into table cells. > > Sometimes, I would use the HeaderTemplate as header of my table (in > ItemTemplate). > How to do it? How to make the table columns in HeaderTemplate linked to > table columns in ItemTemplate? > > Thanks. > > Mirek. > > >
Simple question ???
How to build dynamicaly a menu in ASP.Net 2.0 (VS 2005) ? DataItem in DataListItem is null. Playing a WAV file from a Web Page Output the HTML contents of a dynamically created control Picture on a button DHTML MENU problem in IE Anybody using Table control? How Do I Use a CheckBox to Update a Bit Type Data Field in a DataGrid Size of an Iframe displaying image |
|||||||||||||||||||||||