hi friends
i am new to asp.net
i am using bulkeditgridview
problem is : the gridview is in updatepanel and in a cell of gridview i am using a linkbutton alongwith textbox my requirement is when user clicks on linkbutton it pops up a dialog box where i am updating a few values in database so i need to pass three values to popup window which will be used as key and finally i need to refresh the gridview in the parent window i as adding ab attribute to linkbutton in rowbound event
code is as follows:
any help would highly be appreciated
<PNCL:BulkEditGridView id="GV" runat="server" Height="88px" Width="912px" BackColor="White" BorderColor="#006699" DataSourceID="ObjectDataSource1" DataKeyNames="EMP_ID" CellPadding="3" AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="4px" saveButtonID="SaveButton" AllowSorting="True" OnSelectedIndexChanged = "GV_SelectedIndexChanged">
<
RowStyle ForeColor="#000066"></RowStyle><Columns>
<
asp:BoundField DataField="EMP_ID" HeaderText="EmpID" ReadOnly="True"></asp:BoundField><asp:BoundField DataField="EMP_NAME" HeaderText="Employee Name" ReadOnly="True"></asp:BoundField>
<
asp:BoundField DataField="BASIC_SAL" HeaderText="Basic" ReadOnly="True"></asp:BoundField><asp:TemplateField HeaderText="Allowances">
<
EditItemTemplate><asp:TextBox runat="server" Text='<%# Bind("ALLOWANCES_DESCRIPTION") %>' id="TextBox1"></asp:TextBox>
<
asp:LinkButton runat ="server" Text="^" id="lbtnMore" width = "15px" forecolor="Blue" CommandName="Select" /></EditItemTemplate>
<
ItemTemplate><asp:Label runat="server" Text='<%# Bind("ALLOWANCES_DESCRIPTION") %>' id="Label11"></asp:Label>
</
ItemTemplate><ItemStyle Width="110px"></ItemStyle>
</
asp:TemplateField><asp:BoundField DataField="ALLOWANCES_AMOUNT" HeaderText="Amount"></asp:BoundField>
<
asp:BoundField DataField="INCOME_TAX" HeaderText="Income Tax"></asp:BoundField><asp:BoundField DataField="EPF" HeaderText="EPF"></asp:BoundField>
<
asp:BoundField DataField="OTHER_DEDUCTIONS_DESCRIPTION" HeaderText="Other Deductions"></asp:BoundField><asp:BoundField DataField="OTHER_DEDUCTIONS_AMOUNT" HeaderText="Amount"></asp:BoundField>
<
asp:BoundField DataField="NET_SAL" HeaderText="Net Salary"></asp:BoundField><asp:BoundField DataField="APPROVAL_STATUS" HeaderText="Approval Status" ReadOnly="True"></asp:BoundField>
<
asp:BoundField DataField="PAYSLIP_MONTH" HeaderText="Month" ReadOnly="True"></asp:BoundField><asp:BoundField DataField="PAYSLIP_YEAR" HeaderText="Year" ReadOnly="True"></asp:BoundField>
</
Columns><FooterStyle BackColor="White" ForeColor="#000066"></FooterStyle>
<
PagerStyle HorizontalAlign="Left" BackColor="White" ForeColor="#000066"></PagerStyle><EmptyDataTemplate>
</
EmptyDataTemplate><SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White"></SelectedRowStyle>
<
HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White"></HeaderStyle></PNCL:BulkEditGridView> <asp:ObjectDataSource id="ObjectDataSource1" runat="server" UpdateMethod="UpdateTable" TypeName="ObjectDB" SelectMethod="getTable">
<
UpdateParameters><asp:Parameter Name="e" Type="Int32"></asp:Parameter>
<
asp:Parameter Name="ALLOWANCES_DESCRIPTION" Type="String"></asp:Parameter><asp:Parameter Name="ALLOWANCES_AMOUNT" Type="Int32"></asp:Parameter>
<
asp:Parameter Name="INCOME_TAX" Type="Int32"></asp:Parameter>
<
asp:Parameter Name="EPF" Type="Int32"></asp:Parameter>
<asp:Parameter Name="OTHER_DEDUCTIONS_DESCRIPTION" Type="String" />
<asp:Parameter Name="OTHER_DEDUCTIONS_AMOUNT" Type="Int32" /><asp:Parameter Name="NET_SAL" Type="Int32" />
<
asp:Parameter Name="EMP_ID" Type="String"></asp:Parameter></UpdateParameters>
</
asp:ObjectDataSource> </TD></TR><TR><TD style="TEXT-ALIGN: right" colSpan=11><asp:Button id="SaveButton" onclick="SaveButton_Click" runat="server" Text="Save Data"></asp:Button></TD></TR><TR><TD colSpan=11><asp:UpdateProgress id="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="250">
<ProgressTemplate>
<div style="text-align: center; font-size: 10pt;" >
<img src="rotation.gif" alt="Processing " />
Please wait ...
</div>
</ProgressTemplate>
</asp:UpdateProgress> </TD></TR><TR><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"> </TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="TEXT-ALIGN: right" colSpan=3><asp:Button id="btnApprove" onclick="btnApprove_Click" runat="server" Font-Bold="True" Text="Approve Payslip Requests" Enabled="False"></asp:Button></TD></TR><TR><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="WIDTH: 100px"></TD><TD style="TEXT-ALIGN: right" colSpan=3><asp:Button id="btnGenPaySlip" onclick="btnGenPaySlip_Click" runat="server" Text="Generate Pay Slip" __designer:wfdid="w1"></asp:Button> </TD></TR></TBODY></TABLE><asp:Button style="DISPLAY: none" id="btnRefreshGrid" runat="server" Text="RefreshGrid" __designer:wfdid="w10" OnClick="btnRefreshGrid_Click"></asp:Button>
</
contenttemplate></asp:UpdatePanel>
code behind
Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If Session("SingleRow") Is Nothing ThenDim lbtn As LinkButton = CType(e.Row.FindControl("lbtnMore"), LinkButton)
lbtn.Attributes.Add("onclick", "window.showModalDialog('PopUpAllowance.aspx?planID=' + '" + keyDetails + "','','dialogWidth:320px;dialogHeight:200px;statusbar:no;toolbar:no;menubar=no;location:no;dialogleft:325;dialog:top:300;fullscreen:yes;addressbar:no;statusbar:false;dialogHide:true;resizable: No; status: No');return false;")
End If
If CType(e.Row.Cells(10), TableCell).Text.ToString = "0" Then
CType(e.Row.Cells(10), TableCell).Text = "Pending..."CType(e.Row.Cells(10), TableCell).BackColor = Drawing.Color.Tomato
ElseIf CType(e.Row.Cells(10), TableCell).Text.ToString = "1" Then
CType(e.Row.Cells(10), TableCell).Text = "Approved"CType(e.Row.Cells(10), TableCell).BackColor = Drawing.Color.GreenYellow
Else
CType(e.Row.Cells(10), TableCell).Text = ""
End If
End IfEnd Sub
Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If Session("SingleRow") Is Nothing Then
Dim lbtn As LinkButton = CType(e.Row.FindControl("lbtnMore"), LinkButton)
lbtn.Attributes.Add("onclick", "window.showModalDialog('PopUpAllowance.aspx?planID=' + '" + keyDetails + "','','dialogWidth:320px;dialogHeight:200px;statusbar:no;toolbar:no;menubar=no;location:no;dialogleft:325;dialog:top:300;fullscreen:yes;addressbar:no;statusbar:false;dialogHide:true;resizable: No; status: No');return false;")
End If