Saturday, March 24, 2012
sum of column in footer
the footer of that column? anyone try this before? thanks!Hi,
you can do it by handling RowRataBound event of the GridView. Calculate sums
in it (as it's repeated for every row) and when GridViewRow's RowType is
Footer, place the sum value into it (for example by using a TemplateField
having Label in footer to which you set the sum, as it's Text value)
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Smokey Grindle" <nospamhere@.dontspam.net> wrote in message
news:efKT5aInGHA.4352@.TK2MSFTNGP02.phx.gbl...
> Is there a way to sum all the columns values in a gridview and show it in
> the footer of that column? anyone try this before? thanks!
>
hello smokey
here's a working code example. hope it helps
http://authors.aspalliance.com/aspx...wdatabound.aspx
hello smokey
here's a working code example. hope it helps
http://authors.aspalliance.com/aspx...wdatabound.aspx
thanks everyone!
"ReyN" <rvnunez@.yahoo.com> wrote in message
news:1151736818.909778.118790@.m79g2000cwm.googlegroups.com...
> hello smokey
> here's a working code example. hope it helps
> http://authors.aspalliance.com/aspx...wdatabound.aspx
>
sum of column in footer
the footer of that column? anyone try this before? thanks!Hi,
you can do it by handling RowRataBound event of the GridView. Calculate sums
in it (as it's repeated for every row) and when GridViewRow's RowType is
Footer, place the sum value into it (for example by using a TemplateField
having Label in footer to which you set the sum, as it's Text value)
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Smokey Grindle" <nospamhere@.dontspam.net> wrote in message
news:efKT5aInGHA.4352@.TK2MSFTNGP02.phx.gbl...
> Is there a way to sum all the columns values in a gridview and show it in
> the footer of that column? anyone try this before? thanks!
>
hello smokey
here's a working code example. hope it helps
http://authors.aspalliance.com/aspx...wdatabound.aspx
hello smokey
here's a working code example. hope it helps
http://authors.aspalliance.com/aspx...wdatabound.aspx
thanks everyone!
"ReyN" <rvnunez@.yahoo.com> wrote in message
news:1151736818.909778.118790@.m79g2000cwm.googlegr oups.com...
>
> hello smokey
>
> here's a working code example. hope it helps
>
> http://authors.aspalliance.com/aspx...wdatabound.aspx
>
Tuesday, March 13, 2012
Switch between TextBox and Label inside DataGrid
TextBox, when user do some specific action. How can I acomplish this??
P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
because my OE news reader doesn't show all my posts.I'm trying this:
<asp:TemplateColumn HeaderText="Sum">
<ItemTemplate>
<asp:Label id="lblSum" runat="server" Text='<%#
Container.DataItem("Sum") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtSum" runat="server" Text='<%#
Container.DataItem("Sum") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn
but when I do this:
DataGrid1.EditItemIndex = index
all DataGrid fields in selected row becomes editable and I wan't only one
specific field to be editable (TextBox). What should I do? :(
You need to make an ItemTemplate including both the label and the textbox
and control their visibility depending
on user actions. For an experienced javascript programmer I would recommend
doing it on client side. Otherwise you can do it on server side, possibly
with AJAX or other similar technologies.
Eliyahu
"John Smith" <john.smith@.microsoft.com> wrote in message
news:gcchg.3497$oj5.1152372@.news.siol.net...
> I have DataGrid with Label in one of its columns. Label should change into
> TextBox, when user do some specific action. How can I acomplish this??
>
> P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
> because my OE news reader doesn't show all my posts.
Hi,
I think you want to edit values by switching between label and textbox. The
following link would be very helpful.
http://www.syncfusion.com/FAQ/aspnet/WEB_c4c.aspx#q391q
Thanks
Sharmila
"John Smith" <john.smith@.microsoft.com> wrote in message
news:gcchg.3497$oj5.1152372@.news.siol.net...
> I have DataGrid with Label in one of its columns. Label should change into
> TextBox, when user do some specific action. How can I acomplish this??
>
> P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
> because my OE news reader doesn't show all my posts.
Thanks.
Switch between TextBox and Label inside DataGrid
TextBox, when user do some specific action. How can I acomplish this'
P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
because my OE news reader doesn't show all my posts.I'm trying this:
<asp:TemplateColumn HeaderText="Sum">
<ItemTemplate>
<asp:Label id="lblSum" runat="server" Text='<%#
Container.DataItem("Sum") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtSum" runat="server" Text='<%#
Container.DataItem("Sum") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
but when I do this:
DataGrid1.EditItemIndex = index
all DataGrid fields in selected row becomes editable and I wan't only one
specific field to be editable (TextBox). What should I do? :(
You need to make an ItemTemplate including both the label and the textbox
and control their visibility depending
on user actions. For an experienced javascript programmer I would recommend
doing it on client side. Otherwise you can do it on server side, possibly
with AJAX or other similar technologies.
Eliyahu
"John Smith" <john.smith@.microsoft.com> wrote in message
news:gcchg.3497$oj5.1152372@.news.siol.net...
> I have DataGrid with Label in one of its columns. Label should change into
> TextBox, when user do some specific action. How can I acomplish this'
>
> P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
> because my OE news reader doesn't show all my posts.
>
Hi,
I think you want to edit values by switching between label and textbox. The
following link would be very helpful.
http://www.syncfusion.com/FAQ/aspnet/WEB_c4c.aspx#q391q
Thanks
Sharmila
"John Smith" <john.smith@.microsoft.com> wrote in message
news:gcchg.3497$oj5.1152372@.news.siol.net...
> I have DataGrid with Label in one of its columns. Label should change into
> TextBox, when user do some specific action. How can I acomplish this'
>
> P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
> because my OE news reader doesn't show all my posts.
>
Thanks.