S
settyv
Hi,
I need to merge the rows in the datagrid based on the condition.Please
let me know how can i do that.Here is the scenario:
Present View:
Short name Filed by
A P
A Q
A R
B S
B T
B U
C V
C W
But i need to display like this:
Short Name Filed By
A P,Q,R
B S,T,U
C V,W
For that i used itemtemplate in the grid control as below:
<asp:datagrid id="grdRegister" Runat="server"
OnPageIndexChanged="NewPage" Headerstyle-BackColor="#9B9BB4"
Width="100%" HeaderStyle-Font-Bold="True"
HeaderStyle-ForeColor="#000000" HeaderStyle-CssClass="tableheader"
AutoGenerateColumns="False"
Font-Name="verdana">
<AlternatingItemStyle BackColor="#e2e2e2" Font-Name="verdana"
/>
<Columns>
<asp:BoundColumn DataField="Short/Long Entry"
HeaderText="Short/Long Entry" />
<asp:TemplateColumn HeaderText="Filed by">
<ItemTemplate >
<asp:Label runat="server" Text='<%# string.Format( "{0},
{1}",
DataBinder.Eval(Container, "DataItem.Filed By"),
DataBinder.Eval(Container, "DataItem.Short/Long Entry") ) %>'
ID="Label4">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Please let me know how can i achieve that.
Thanks,
Vishnu
I need to merge the rows in the datagrid based on the condition.Please
let me know how can i do that.Here is the scenario:
Present View:
Short name Filed by
A P
A Q
A R
B S
B T
B U
C V
C W
But i need to display like this:
Short Name Filed By
A P,Q,R
B S,T,U
C V,W
For that i used itemtemplate in the grid control as below:
<asp:datagrid id="grdRegister" Runat="server"
OnPageIndexChanged="NewPage" Headerstyle-BackColor="#9B9BB4"
Width="100%" HeaderStyle-Font-Bold="True"
HeaderStyle-ForeColor="#000000" HeaderStyle-CssClass="tableheader"
AutoGenerateColumns="False"
Font-Name="verdana">
<AlternatingItemStyle BackColor="#e2e2e2" Font-Name="verdana"
/>
<Columns>
<asp:BoundColumn DataField="Short/Long Entry"
HeaderText="Short/Long Entry" />
<asp:TemplateColumn HeaderText="Filed by">
<ItemTemplate >
<asp:Label runat="server" Text='<%# string.Format( "{0},
{1}",
DataBinder.Eval(Container, "DataItem.Filed By"),
DataBinder.Eval(Container, "DataItem.Short/Long Entry") ) %>'
ID="Label4">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Please let me know how can i achieve that.
Thanks,
Vishnu