I know that you can change the style of the DetailsView CommandRowStyle, but what if I want to change the style of the actual Edit and Delete links? Can you access those?
I'd rather not use images, and I'd like to have my Edit and Delete links match the linkbutton CSS I've already created.
Thanks a lot. I'll look into that. Always good to know the better way. However I still don't understand why this isn't working. It's pretty simple, nothing too detailed and I followed examples I found exactly.
I have a DetailsView that shows a record from my database based on a queryString value "curEmp", for example "EmployeeProfile.aspx?curEmp=2"
This is showing the records ok, but when I click Edit, after changing a value I hit "Update" and everything except the primary key is set to null.
What...
Thanks a lot for you help, that did it!
Can you tell me why I shouldn't use a DataSource control? I'm pretty new to this, so I'd like to know why.
I have on follow up question if you're able to help. After updating, the <Item Template> field is showing the SupevisorID, but I'd like for it to...
0 down vote favorite
share [g+] share [fb] share [tw]
I have a database table called Employees that has an ID number, First Name, Last Name, and SupervisorID for each employee. The SupervisorID stored for an employee equals the ID number of that employee's supervisor.
I want to have a...
...Dim sql As String = "SELECT * FROM Employees"
Dim sqlCmd = New SqlClient.SqlCommand()
sqlCmd.CommandText = String.Format(sql, Me.SortExpression)
sqlCmd.Connection = sqlCon
Using objAdapter As New SqlClient.SqlDataAdapter(sqlCmd)...
Yeah the case is correct. I'm really stumped since the "HeaderStyle" is being applied correctly. It's just the "SortedAscendingHeaderStyle" and "SortedDescendingHeaderStyle" that aren't coming through.
Thanks for the response!
Yes, I want to style the header of a sorted column. My GridView is set up like this in my aspx:
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
EmptyDataText="There are no data records to display."...
...Dim sql As String = "SELECT * FROM EmployeeList ORDER BY {0}"
Dim sqlCmd = New SqlClient.SqlCommand()
sqlCmd.CommandText = String.Format(sql, Me.SortExpression)
sqlCmd.Connection = sqlCon
Using objAdapter As New SqlClient.SqlDataAdapter(sqlCmd)...
As the page gets further developed the columns that will load will be based on user selection so I wouldnt know them ahead of time and would need them to be dynamic. I was able to get it working
... Dim myConnection As New SqlConnection(connectionstr)
Dim ad As New SqlDataAdapter("SELECT * FROM EmployeeList where lastname like 'wil%'", myConnection)
Dim ds As New DataSet()
ad.Fill(ds)
Return ds
End Function
Public Property GridViewSortDirection() As...
I got it working. For others needing help with this:
You can use insert instead of add:
GridView3.Columns.Insert(0, curLastName)
Then the code-behind elements will be added first before the columns on the .aspx page.
I came up with this solution and I'm getting the links now, but I still need some help displaying them properly.
The columns I showed above are being generated in code-behind. I then added a link field to the GridView on the .aspx page:
<asp:GridView id="GridView3" runat="server"...
...connetionString = ConfigurationManager.ConnectionStrings("dbConnectionString").ConnectionString.ToString()
sql = "SELECT * FROM [EmployeeList] Where [lastname] like '" & lastName & "%' order by lastname"
connection = New SqlConnection(connetionString)
Try...
I have a login page that has a "if you forgot your password, click here" link button that opens a ModalPopup for the user to retrieve their password.
What I would like to do is when a user enters an invalid login, the ValidationSummary tells them it's invalid, and also contains another "if you...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.