.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

DetailsView control boarder

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :ASP.Net

Here's my DetailsView control:

<asp:DetailsView ID="dtvEvents" runat="server" AutoGenerateRows="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="id_eve" DataSourceID="sqlEventsDetails" Height="50px" Width="100%">
<FooterStyle BackColor="White" ForeColor="#000066" />
<EditRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<RowStyle ForeColor="#000066" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />

The problem I have is the border lines in IE browser. In the picture below, the FF browser is the top and IE browser is on the bottom.

How do I get the DetailsView control broarder so that IE browser also have the same border showing up as in FireFox?

Any help is much appreciated.

View Complete Post

More Related Resource Links

Get value of a label control inside the DetailsView

Hi everyone, I have a databound label control (i.e. Label 3) inside an Item Template that's in a DetailsView control. I just need to get the value of those label and compare it to some string. I tried several ways (i.e. Find control, DetailsView.Row) but nothing seems to work. I don't know if I'm using the FindControl methos correctly or if I need to access the Row first and do the findcontrol method.  Protected Sub DetailsView4_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView4.DataBound 'If (DetailsView4.Rows(2).Cells(1).ToString = "Regular") Then 'Label3.ForeColor = Drawing.Color.Azure 'End If 'Dim StatusQualifierContainer As Label 'Dim S As String 'StatusQualifierContainer = DetailsView4.FindControl(Label3.Text) 'S = StatusQualifierContainer.Text 'If S = "Regular" Then 'Label5.ForeColor = Drawing.Color.Aqua 'End If 'Dim C As Label = DetailsView4.FindControl("Label3") 'If C.Text = "Regular" Then 'Label3.ForeColor = Drawing.Color.DarkBlue 'End If 'Dim headerRow As DetailsViewRow = DetailsView4.HeaderRow 'Dim lblText As Label = CType(headerRow.FindControl("Label3"), Label)

Can I use a DetailsView control to insert and update with RIA services?



I'm struggling with trying to use RIA services from an ASP.NET web site.

I created a new web site, added an entity framework model, then added a RIA service that uses that model. I used the DomainDataSource control to bind the ASP.NET controls to the RIA service.

I have a GridView that shows items from the database (via RIA and the entity framework model underneath it), and can see the items fine. I added a DetailsView as a pop-up, as shown in http://mattberseth.com/blog/2007/07/modalpopupextender_example_for.html and http://mattberseth.com/blog/2008/04/masterdetail_with_the_gridview.html. When I click the "edit" link in a row in the GridView, the DetailsView shows with the right data, but clicking the "save" link doesn't actually update the database.

Furthermore, I can't work out how to add new items this way, as when I try and use the DetailsView to add a new item, nothing is sent to the database.

Anyone any ideas how this can be done?


How to merge columns in DetailsView control?


I have a DetailsView control with two columns and 7 rows. I need the two columns to merge in row two and get rid of the header. I only the data from the DB to display no the header name in row two. How do I merge it in DetailsView control?

Help is much appreciated.

Detailsview control needs to add records to mulitple tables


I've got a gridview and a detailsview control on my page. The detailsview is where new records are added. When a record is added to it.

My code looks like:


<asp:DetailsView AutoGenerateRows="False" DataKeyNames="EmployeeId" DataSourceID="SqlDataSourceEmpl1"

DefaultMode="Insert" HeaderText="Add Employee" ID="DetailsInsertEmployee" runat="server"

AutoGenerateInsertButton="true" OnItemInserting="DetailsInsertEmployee_ItemInserting"

OnItemInserted="DetailsInsertEmployee_ItemInserted" CellSpacing="2" >


<asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />

<asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />


<HeaderStyle BackColor="#513631" Font-Bold="True" ForeColor="#FFFFFF" />

<RowStyle BackColor="#E0C6C1" F

Find Control in DetailsView


hi all

i want to find a control (TextBox) in Detailsview using javascript

any idea...


How To Do Country-State DropDownList Dependency in DetailsView Control


I have a DetailsView control in my C#/ASP.NET web application. It contains many fields, but the two I'm interested in are the Country and State fields. They are dropdownlists that display the information from the Country & State tables in the database. However, I want the State list to be filtered based on the selected Country.

I've seen many, many examples of this where the dropdownlists are outside of the detailsview controls. What I need to know is how to get it to work when these are inside of the detailsview control. I have moved the EntityDataSources for each dropdownlist outside of the detailsview control since I know that due to scope they wouldn't be able to see each other otherwise.

So, how do I make it so that when you select a country from the country dropdownlist, it auto-filters the state dropdownlist to only show the states in that country? This end of this video on ASP.NET explains how to do this outside of a DetailsView control, but not inside.


P.S. - I am using the Entity Framework / Entity Data Source for my data sources for everything.

Pass Id To ObjectDataSource From DetailsView Control


Hello all

I have an objectDataSource to retrieve data and fill a listBox on edit

I created a BLL method to get the data and set the controlId to the detailsVeiw control but the id is not passed throuh to the bll class

this is my code:

    <asp:ObjectDataSource ID="odsItems" runat="server" 
        SelectMethod="GetRecords" TypeName="BLL.GetData.Get">
            <asp:ControlParameter ControlID="detailsVeiw" Name="id" 
                PropertyName="SelectedValue" Type="Int32" />

    <asp:DetailsView ID="detailsVeiw" runat="server" AutoGenerateRows="False" DataSourceID="odsByKey" DataKeyNames="id">
            <asp:TemplateField HeaderText="Code" SortExpression="id">
                    <asp:Label ID="lblIdEdit" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                    <asp:Label ID="lblIdItem" runat="server" Text='<%

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

In-Depth look at the GridView Control

In the last article we looked at few of the new controls available in Asp.net 2.0. We also talked about Grid View Control which has replaced the Asp.net 1.1 DataGrid control for good. In this article we will examine more features of the Grid View control. In this article we will see some of the common operations that can be performed using the GridView control. Apart from these operations there are many more functions that can be performed on the control and which we will see in the later articles

Master-Detail with the GridView, DetailsView and jQuery's ThickBox

One more article about grids from Matt Berseth. This time he shows how to create master-detail with the gridview, detailsview and jQuery's ThickBox. He writes:
So I thought I would check some of this out and along the way rebuild my Master-Detail with the GridView, DetailView and ModalPopup Controls and replace the ModalPopup with jQuery's ThickBox. I found it pretty interesting - read on to see how it went

ASP.NET repeater control - databind with style

even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Using TemplateFields in the GridView Control

The GridView is composed of a set of fields that indicate what properties from the DataSource are to be included in the rendered output along with how the data will be displayed. The simplest field type is the BoundField, which displays a data value as text. Other field types display the data using alternate HTML elements. The CheckBoxField, for example, renders as a checkbox whose checked state depends on the value of a specified data field; the ImageField renders an image whose image source is based upon a specified data field. Hyperlinks and buttons whose state depends on an underlying data field value can be rendered using the HyperLinkField and ButtonField field types.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend