Home All Groups Group Topic Archive Search About
Author
23 Mar 2005 11:47 AM
jijis
"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

Author
23 Mar 2005 12:27 PM
Eliyahu Goldin
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
>
>
>
Author
23 Mar 2005 2:22 PM
jijis
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
> >
> >
> >
>
>
Author
24 Mar 2005 8:05 AM
jijis
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
>>
>>
>>
>
>
Author
24 Mar 2005 8:26 AM
Eliyahu Goldin
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
> >>
> >>
> >>
> >
> >
>
>