2
Answers

How to edit the rows when the chkbox is selected?

Ask a question
Ki Ki

Ki Ki

11y
1.1k
1
I am having a Gridview where there is a checkbox and few other columns. The checkbox and the ID column is frozen while the other columns like vendor type,style id are not frozen.

My requirement is that when i check the chkbox,all other columns,except the frozen ones  in the selected row should change to edit mode.

Since the 1st few column is frozen,if i add an edit button there will be some overlapping and the entire gridview structure gets misplaced.

Please reply asap.

PFB the code.


<
asp:GridView ID="gvMachinegrid" runat="server" AutoGenerateColumns="False"
OnRowDataBound="gvMachinegrid_RowDataBound" DataKeyNames="StyleColorChangeTypeId"
DataSourceID="SqlDataSource1" class="FixedTables">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="SelectAllCheckBox" runat="server" onclick="SelectAll(this)" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" OnCheckedChanged="chkSelect_checkedchanged" AutoPostBack="true"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="StyleColorChangeTypeId" HeaderText="ID" >
</asp:BoundField>
<asp:BoundField DataField="StyleId" HeaderText="StyleId">
</asp:BoundField>
<asp:BoundField DataField="ChangeTypeId" HeaderText="ChangeTypeId">
</asp:BoundField>
<asp:BoundField DataField="Vendor" HeaderText="Vendor">
</asp:BoundField>
</Columns>
<PagerSettings FirstPageText="First" LastPageText="Last" Mode="NumericFirstLast"
NextPageText="First" PreviousPageText="Last" />
<PagerStyle />
</asp:GridView>

Answers (2)