Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Jim Mitchell #1
HELP - Problem with DG Postback when not using AutoFillColumns
I have the following code for the Datagrid. If I set
AUTOGENERATECOLUMNS=FALSE. The PageIndexChanged routine does not fire and
the Datagrid disappears on the postback. Everything works great if
Autogeneratecolumns is set to true.
HELP! PLEASE!
Private Sub dgAccounts_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
dgAccounts.PageIndexChanged
TextBox1.Text = "IT DID GET CALLED"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim mycn As SqlClient.SqlConnection
Dim sql_string As String
Dim daAccounts As SqlClient.SqlDataAdapter
Dim dsAccounts As New DataSet
Dim dcolumn As New System.Web.UI.WebControls.ButtonColumn
mycn = New
SqlClient.SqlConnection(System.Configuration.Confi gurationSettings.AppSettin
gs("ConnectString"))
sql_string = "Select ID, Company, Phone from tblCompanys where
(N_UserCompany<" & "16 AND Len(rtrim(Company)) > 0) order by Company asc"
daAccounts = New SqlClient.SqlDataAdapter(sql_string, mycn)
daAccounts.Fill(dsAccounts)
dgAccounts.DataSource = dsAccounts
dcolumn.ButtonType = ButtonColumnType.LinkButton
dcolumn.DataTextField = "Company"
dcolumn.HeaderText = "Header here"
dgAccounts.Columns.Add(dcolumn)
dgAccounts.DataBind()
mycn.Close()
End Sub
Jim Mitchell Guest
-
ASP.NET Postback Refresh Problem
If you want to stop this happening, what you could do is a response.redirect back to the same page, after your server side event has finished... -
Postback data problem
I am trying to constuct a custom control in ASP.NET 2.0. I want it to collect the information in the control through postbacks, but I can't seem to... -
Datagrid postback problem?!?
I have a datagrid that works perfectly well. I have default paging turned on and this is where I have a small problem. My datagrid is created via... -
Upload file problem with postback
You can use the CustomValidatior to do client-side validation before postback. As for the File upload control... even when run server-side, it does... -
Dialog postback problem
Hi I have a webform that can show a dialog using javascript . Content of this dialog is an aspx page with a submit button .My problem is when i...



Reply With Quote

