Modify Gridview as it's being rendered through javascript
Posted
by JonF
on Stack Overflow
See other posts from Stack Overflow
or by JonF
Published on 2010-02-18T05:05:56Z
Indexed on
2010/03/08
4:21 UTC
Read the original article
Hit count: 224
ASP.NET
|JavaScript
I'm trying to modify a field in each row of my gridview as it is rendered. I need to modify it with client side Javascript. I'm somewhat new to asp.net, but I think I should be doing something with clientscriptmanager.
I came up with a simple scenario which is basically what I want to do to avoid getting bogged down in the details. If I could accomplish the following I could accomplish my goal.
Say I have a grid view of names and salaries. I want to double each persons salary before displaying it. Obviously I can do it in the code behind, but due to the nature of the more complex actual thing I'm doing, I need to do it in javascript
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
onrowdatabound="GridView1_RowDataBound" >
<Columns>
<asp:BoundField HeaderText="Full Name" DataField="Name" ></asp:BoundField>
<asp:BoundField HeaderText="Salary" DataField="Salary" />
</Columns>
© Stack Overflow or respective owner