|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
"Build item template as a table with as many rows as you
wish" Would you mind tell me how to build the item template table? I can only create a "Template Column" in Datagrid Property Builder Or any one can help me please I meant creating an item template column, that's what you've done, and than
populating the template with a column. Like this: <ItemTemplate> <table> <tr><td><%# ((DataRowView)Container.DataItem)["Column1"] %></td></tr> <tr><td><%# ((DataRowView)Container.DataItem)["Column2"] %></td></tr> <tr><td><%# ((DataRowView)Container.DataItem)["Column3"] %></td></tr> </table> </ItemTemplate> Or, if you want columns 2 and 3 to share the same row: <ItemTemplate> <table> <tr><td colspan=2><%# ((DataRowView)Container.DataItem)["Column1"] %></td></tr> <tr><td><%# ((DataRowView)Container.DataItem)["Column2"] %></td> <td><%# ((DataRowView)Container.DataItem)["Column3"] %></td></tr> </table> </ItemTemplate> Eliyahu Show quoteHide quote "jijis" <ji***@jijis.com> wrote in message news:uZ9sX45LFHA.3228@TK2MSFTNGP12.phx.gbl... > "Build item template as a table with as many rows as you > wish" > > Would you mind tell me how to build the item template table? > > I can only create a "Template Column" in Datagrid Property Builder > > Or any one can help me please > > > thx so much
I got the idea Show quoteHide quote "Eliyahu Goldin" <removemeegol***@monarchmed.com> wrote in message news:eRRCrM6LFHA.3708@TK2MSFTNGP14.phx.gbl... > I meant creating an item template column, that's what you've done, and than > populating the template with a column. Like this: > > <ItemTemplate> > <table> > <tr><td><%# ((DataRowView)Container.DataItem)["Column1"] %></td></tr> > <tr><td><%# ((DataRowView)Container.DataItem)["Column2"] %></td></tr> > <tr><td><%# ((DataRowView)Container.DataItem)["Column3"] %></td></tr> > </table> > </ItemTemplate> > > Or, if you want columns 2 and 3 to share the same row: > > <ItemTemplate> > <table> > <tr><td colspan=2><%# ((DataRowView)Container.DataItem)["Column1"] > %></td></tr> > <tr><td><%# ((DataRowView)Container.DataItem)["Column2"] %></td> > <td><%# ((DataRowView)Container.DataItem)["Column3"] %></td></tr> > </table> > </ItemTemplate> > > Eliyahu > > > "jijis" <ji***@jijis.com> wrote in message > news:uZ9sX45LFHA.3228@TK2MSFTNGP12.phx.gbl... > > "Build item template as a table with as many rows as you > > wish" > > > > Would you mind tell me how to build the item template table? > > > > I can only create a "Template Column" in Datagrid Property Builder > > > > Or any one can help me please > > > > > > > > i know there is needed to databind the source column
but do I need to initialize a datagird (drag & drop or not need to use datagrid anymore?) and should I bind the dataset into the container? Show quoteHide quote "Eliyahu Goldin" <removemeegol***@monarchmed.com> wrote in message news:eRRCrM6LFHA.3708@TK2MSFTNGP14.phx.gbl... >I meant creating an item template column, that's what you've done, and than > populating the template with a column. Like this: > > <ItemTemplate> > <table> > <tr><td><%# ((DataRowView)Container.DataItem)["Column1"] %></td></tr> > <tr><td><%# ((DataRowView)Container.DataItem)["Column2"] %></td></tr> > <tr><td><%# ((DataRowView)Container.DataItem)["Column3"] %></td></tr> > </table> > </ItemTemplate> > > Or, if you want columns 2 and 3 to share the same row: > > <ItemTemplate> > <table> > <tr><td colspan=2><%# ((DataRowView)Container.DataItem)["Column1"] > %></td></tr> > <tr><td><%# ((DataRowView)Container.DataItem)["Column2"] %></td> > <td><%# ((DataRowView)Container.DataItem)["Column3"] %></td></tr> > </table> > </ItemTemplate> > > Eliyahu > > > "jijis" <ji***@jijis.com> wrote in message > news:uZ9sX45LFHA.3228@TK2MSFTNGP12.phx.gbl... >> "Build item template as a table with as many rows as you >> wish" >> >> Would you mind tell me how to build the item template table? >> >> I can only create a "Template Column" in Datagrid Property Builder >> >> Or any one can help me please >> >> >> > > ItemTemplate is a part of a datagrid. You have to use it. You don't have to
do in design view (that's where you drag & drop), you can just write a few lines in HTML view if you wish. You bind datagrid to a datasource, such as a table inside a dataset. Datagrid has DataSource and DataMember parameters for that. I think you are at the point where you should invest some more time in looking in datagrid and databinding topics in MSDN library. Eliyahu Show quoteHide quote "jijis" <rac***@racing.com> wrote in message news:uPaPAhEMFHA.3500@TK2MSFTNGP14.phx.gbl... > i know there is needed to databind the source column > but do I need to initialize a datagird (drag & drop or not need to use > datagrid anymore?) > > and should I bind the dataset into the container? > > > "Eliyahu Goldin" <removemeegol***@monarchmed.com> wrote in message > news:eRRCrM6LFHA.3708@TK2MSFTNGP14.phx.gbl... > >I meant creating an item template column, that's what you've done, and than > > populating the template with a column. Like this: > > > > <ItemTemplate> > > <table> > > <tr><td><%# ((DataRowView)Container.DataItem)["Column1"] %></td></tr> > > <tr><td><%# ((DataRowView)Container.DataItem)["Column2"] %></td></tr> > > <tr><td><%# ((DataRowView)Container.DataItem)["Column3"] %></td></tr> > > </table> > > </ItemTemplate> > > > > Or, if you want columns 2 and 3 to share the same row: > > > > <ItemTemplate> > > <table> > > <tr><td colspan=2><%# ((DataRowView)Container.DataItem)["Column1"] > > %></td></tr> > > <tr><td><%# ((DataRowView)Container.DataItem)["Column2"] %></td> > > <td><%# ((DataRowView)Container.DataItem)["Column3"] %></td></tr> > > </table> > > </ItemTemplate> > > > > Eliyahu > > > > > > "jijis" <ji***@jijis.com> wrote in message > > news:uZ9sX45LFHA.3228@TK2MSFTNGP12.phx.gbl... > >> "Build item template as a table with as many rows as you > >> wish" > >> > >> Would you mind tell me how to build the item template table? > >> > >> I can only create a "Template Column" in Datagrid Property Builder > >> > >> Or any one can help me please > >> > >> > >> > > > > > >
UserControl inside of datagrid - loses its viewstate when datagrid is re-bound on postback
Compact code iterate through only one column of a datagrid Add text from listbox into datagrid column Access individual item in a datagrid Add row to datagrid? Dynamically Add Validation to Datagrid Datagrid sorting does not work Can't get text value of hidden (visible = false) column.. Help |
|||||||||||||||||||||||