I am loading the user control in .aspx to display the gridView and dynamically creating the CheckBox template field in columns in code behind.Whenever i check or uncheck, autopostback is triggered.
Since i bind() the grid in page_load, it Skip the rebind the gridView after postback (if Not IsPostback() condition is added)
How to retain the data in the GridView with Checkbox changes was made after PostBack? User Control is placed on in aspx along with other labels and text box controls.
Please suggest me how to regain the GridView data from code behind after postback.
<pre> Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Values(5) As String
Dim totalCount As Integer
Dim dtcustAcctSignRelation = New DataTable()
Dim lstCustInfo As ArrayList = TryCast(Session("CustInfo"), ArrayList)
Dim i As Integer = 0
If Not Page.IsPostBack Then
For Each value As String In lstCustInfo
Values(i) = value
i = i + 1
Next
Calendar1.Visible = False
lstRegInfo = CType(Session("secureURL"), Global.System.Collections.Generic.List(Of String))
HideLeftPanelFromMasterPage()
InitializeCustInfoPanel(Values)
dtcustAcctSignRelation = RetrieveBSUCustomer(Values, 1, totalCount, dtcustAcctSignRelation)
LoadGridViewSignatoryGroup(Values(0).ToString(), dtcustAcctSignRelation)
End If
End Sub
What I have tried:
Tried to using ViewState logic, not sure it will retain the Checkbox changes made.