Getting rowindex of gridview and updating another gridview with values retrieved

Getting rowindex of gridview and updating another gridview with values retrieved

Hello,

I'm new to JQuery and as such I've been having some problems with an operation I need to do.

I have 2 gridviews (Gridview1 and grvFaturas as shown on code) and I catch the user logging to Windows which I will need as well.

grvFaturas has an objectdatasource and the last element is a checkbox the others being Boundfields.

That checkbox is mandatory and its source code is from here : http://tutorialzine.com/2011/03/better-check-boxes-jquery-css/

What I need is when I click on the checkbox on one of grvFaturas rows, I have to get the row in which the clicked
checkbox is located, get some values from that row and display  it on the row belonging to the user logged in (a specific row)
on the first gridview (Gridview1), so basically I will need to get the row from Gridview1 that belongs to that user (which has a boundfield with the username)
and update it without submitting the data to the DB (kinda like a for preview purposes).


I still haven't been able to understand the JQuery syntax that allows me to catch which rowindex the checkbox I clicked
is located in.

I'm linking the Gridviews code and I hope someone can help me:

  1. <asp:GridView Style="margin-left: 80px" ID="GridView1" runat="server" AutoGenerateColumns="False" AllowPaging="True" DataSourceID="ObjectDataSource1"
                        CssClass="mGrid" ClientIDMode="Static"
                        PagerStyle-CssClass="pgr"
                        AlternatingRowStyle-CssClass="alt" OnDataBound="GridView1_DataBound" OnRowDataBound="GridView1_RowDataBound">


  2.                     <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
  3.                     <Columns>
                            <asp:BoundField DataField="resourceName" HeaderText="Consultor" SortExpression="resourceName" />
                            <asp:BoundField DataField="resourceCDN" HeaderText="CDN" SortExpression="resourceCDN" />
                        </Columns>


  4.                     <PagerStyle CssClass="pgr"></PagerStyle>
                    </asp:GridView>
  5.  <asp:GridView Style="margin-left: 80px" ID="grvFaturas" runat="server" AutoGenerateColumns="False" AllowPaging="True" DataSourceID="ObjectDataSource3"
                        CssClass="mGrid"
                        PagerStyle-CssClass="pgr"
                        AlternatingRowStyle-CssClass="alt" >
                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                        <Columns>
                            <asp:BoundField DataField="accountname" HeaderText="Conta" SortExpression="accountname" />
                            <asp:BoundField DataField="invoiceid" HeaderText="invoiceid" SortExpression="invoiceid" Visible="false"  />
                            <asp:TemplateField HeaderText="TesteFac">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkteste" runat="server" Checked='<%# Eval("faturado") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>











  6.                     </Columns>
  7. <PagerStyle CssClass="pgr"></PagerStyle>
  8.                 </asp:GridView>

Thanks