V
Vinki
Hello Everyone,
In my gridview, I changed some of the bound columns to template columns, I
noticed that the template column is not recognized inside the RowDataBound
event method. The reason I changed the bound columns to template columns so
that I can add the total column in the footer. I guess I cannot do that with
bound columns.
If I do e.Row.Cells[5].Text then 5th column is not recognixed inside the
Rowdatabound event, but If i do e.Row.Cells[4].Text then it is recognized.
Please let me know what am I doing wrong.
<asp:GridView ID="dgAgentActivity" runat="server"
AutoGenerateColumns="false" CellPadding="0" CellSpacing="1"
BackColor="AliceBlue" OnRowDataBound="dgAgentActivity_RowDataBound"
OnRowCreated="dgAgentActivity_RowCreated" ShowFooter="true">
<Columns>
<asp:BoundField HeaderText ="Time" DataField="SwitchTime" />
<asp:BoundField HeaderText ="State1" DataField="TerminalState" />
<asp:BoundField HeaderText ="State2" DataField="AgentState" />
<asp:BoundField HeaderText ="Que" DataField="Queue" />
<asp:BoundField HeaderText ="calculated Time"
DataField="calculated Time"/>
<asp:templatefield headertext="LogOut" >
<itemtemplate>
<%#Eval("LogOut", "{0:c}")%>
</itemtemplate>
<footertemplate>
<asp:label id="TotalTime" runat="server"/>
</footertemplate>
</asp:templatefield>
<asp:BoundField HeaderText ="test1 DataField="Not Ready" />
</Columns>
</asp:GridView>
protected void dgAgentActivity_RowDataBound(object sender,
GridViewRowEventArgs e)
{
}
Thanks.
In my gridview, I changed some of the bound columns to template columns, I
noticed that the template column is not recognized inside the RowDataBound
event method. The reason I changed the bound columns to template columns so
that I can add the total column in the footer. I guess I cannot do that with
bound columns.
If I do e.Row.Cells[5].Text then 5th column is not recognixed inside the
Rowdatabound event, but If i do e.Row.Cells[4].Text then it is recognized.
Please let me know what am I doing wrong.
<asp:GridView ID="dgAgentActivity" runat="server"
AutoGenerateColumns="false" CellPadding="0" CellSpacing="1"
BackColor="AliceBlue" OnRowDataBound="dgAgentActivity_RowDataBound"
OnRowCreated="dgAgentActivity_RowCreated" ShowFooter="true">
<Columns>
<asp:BoundField HeaderText ="Time" DataField="SwitchTime" />
<asp:BoundField HeaderText ="State1" DataField="TerminalState" />
<asp:BoundField HeaderText ="State2" DataField="AgentState" />
<asp:BoundField HeaderText ="Que" DataField="Queue" />
<asp:BoundField HeaderText ="calculated Time"
DataField="calculated Time"/>
<asp:templatefield headertext="LogOut" >
<itemtemplate>
<%#Eval("LogOut", "{0:c}")%>
</itemtemplate>
<footertemplate>
<asp:label id="TotalTime" runat="server"/>
</footertemplate>
</asp:templatefield>
<asp:BoundField HeaderText ="test1 DataField="Not Ready" />
</Columns>
</asp:GridView>
protected void dgAgentActivity_RowDataBound(object sender,
GridViewRowEventArgs e)
{
}
Thanks.