Hi All,
I am using infragistics webGrid. I have template field which contains checkbox. On click of submit button i need to update the records which has been checked. But i am not able to find the control on button click event.Please help me out
Dharmbir
you can iterate through the grid rows collection to see which ones have been changed then update your dataset then rebind the data to the grid.
once you are on a row, use the key tag for the cell with the checkbox and see if it was checked, then you know that record was changed.
can you please tell me how can i iterate through grid please have a look at my code
<igtbl:UltraGridBand><Columns>
<asp:CheckBox id="chkSelect" onclick="BLOCKED SCRIPTSelectAllCheckboxes(this);" runat="server" __designer:wfdid="w18"></asp:CheckBox>
<CellTemplate>
<asp:CheckBox id="ChkConsultant" onclick="BLOCKED SCRIPTSingleCheck(this);" runat="server" __designer:wfdid="w19"></asp:CheckBox> <asp:HiddenField id="HdnJoinersTrainingId" runat="server" __designer:wfdid="w20" Value='<%# Eval("JtrainingId") %>'></asp:HiddenField> <asp:HiddenField id="HdnJoinersId" runat="server" __designer:wfdid="w21" Value='<%# Eval("JoinersID") %>'></asp:HiddenField>
<Header Caption=" Select All"></Header>
<igtbl:TemplatedColumn Key="2"><CellTemplate>
<asp:LinkButton id="LinkButton1" runat="server" Text='<%# Eval("FirstName") %>' __designer:wfdid="w12"></asp:LinkButton>
<Header Title="Name" Caption="Name">
</Header>
<RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
</igtbl:TemplatedColumn>
<igtbl:TemplatedColumn Key="3"><CellTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("DateOfJoining") %>'></asp:Label>
<Header Caption="Date of Joining">
<RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
<igtbl:TemplatedColumn Key="4"><CellTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("Group") %>'></asp:Label>
<Header Caption="Group">
<RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
<igtbl:TemplatedColumn Key="5"><CellTemplate>
<igtxt:WebTextEdit ID="WebTextEdit1" runat="server">
</igtxt:WebTextEdit>
<Header Caption="Remarks">
<RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
<RowEditTemplate>
</RowEditTemplate>
<BorderDetails WidthLeft="3px" WidthTop="3px" WidthRight="3px" WidthBottom="3px"></BorderDetails>
<AddNewRow Visible="NotSet" View="NotSet"></AddNewRow>
</Bands>
<FrameStyle BackColor="#FAFCF1" BorderWidth="1px" BorderStyle="Solid" Font-Names="Verdana" Font-Size="8pt" Width="100%"></FrameStyle>
<PagerStyle BackColor="LightGray" BorderWidth="1px" BorderStyle="Solid">
</PagerStyle>
<EditCellStyleDefault BorderWidth="0px" BorderStyle="None"></EditCellStyleDefault>
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px"></BorderDetails>
<HeaderStyleDefault HorizontalAlign="Center" BackColor="#CBD6A6" BorderStyle="Solid" ForeColor="Black">
</HeaderStyleDefault>
<Padding Left="3px"></Padding>
</RowStyleDefault>
<AddNewBox>
</AddNewBox>
<FilterOptionsDefault AllowRowFiltering="OnClient">
<Padding Left="2px"></Padding>
<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White"></FilterHighlightRowStyle>
</FilterOptionsDefault>
</igtbl:UltraWebGrid>
one more guess not getting values on server side.
I see that you do not have DataKeyField set on your grid which might cause problem. as I was having same problem few days ago.
My grid was losing index on server side and I set DataKeyField and it worked after that.
Hope this helps.
it appears you have code on the client side to intercept a click event.
What I have done on a button click event outside the grid.. is...
Dim oRow As Infragistics.WebUI.UltraWebGrid.UltraGridRow
For Each oRow In dgFlagList.Rows
if CBool(oRow.Cells(6).Text) then 'here is t
he cell or use getByKey of the checkbox..
'do something
end if
next