tags:

views:

35

answers:

0

Hi all,

<asp:GridView ID="gvCentersList" runat="server" AutoGenerateColumns="False" ShowFooter="true" DataKeyNames="CenterID" CssClass="gv-style">
   <FooterStyle CssClass="gv-style_footer"/>
   <PagerStyle CssClass="gv-style_pager" />
   <AlternatingRowStyle CssClass="gv-style_alter" />
   <SelectedRowStyle CssClass="gv-style_row-selected" />
   <Columns>
      <asp:TemplateField HeaderText="">
         <ItemTemplate>
            <asp:CheckBox ID="GridCheckBox" runat="server" onclick='<%# string.Format("javascript:HighlightRow(this, \"{0}\")", Eval("ROWID")) %>'  oncheckedchanged="GridCheckBox_CheckedChanged" AutoPostBack="true" />
         </ItemTemplate>
      </asp:TemplateField>
      <asp:TemplateField HeaderText="">
         <ItemTemplate>
            <asp:TextBox ID="CenterSequence" runat="server" Width="20" Font-Names="Tahoma" Font-Size="12px" Enabled="false"></asp:TextBox>             
         </ItemTemplate>
      </asp:TemplateField>
   <asp:BoundField DataField="CenterID" HeaderText="CenterID"  SortExpression="CenterID" />
   <asp:BoundField DataField="CenterName" HeaderText="CenterName" SortExpression="CenterName" />                                            
   </Columns>                                        
</asp:GridView> 

In short I want make sequence dependce on the first check.

if the user check row 5 --> CenterSequence.Text = 1

then he check row 3 --> CenterSequence.Text = 2

then he check row 4 --> CenterSequence.Text = 3

then he check row 2 --> CenterSequence.Text = 4

then he check row 1 --> CenterSequence.Text = 5

--

when he unckeck row 5 --> CenterSequence.Text = "" and reset the sequnce again that means:

row 3 --> CenterSequence.Text = 1

row 4 --> CenterSequence.Text = 2

row 2 --> CenterSequence.Text = 3

row 1 --> CenterSequence.Text = 4

or

when he unckeck row 4 --> CenterSequence.Text = "" and reset the sequnce again that means:

then he check row 2 --> CenterSequence.Text = 3

then he check row 1 --> CenterSequence.Text = 4