.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

How to merge columns in DetailsView control?

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

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.

View Complete Post

More Related Resource Links

How to merge separate control flows?

Howdy, This seems a simple question but I can't find a clear answer anywhere... I have an SSIS package that processes flat data files, one-by-one, in a loop, until there are no more files. Before proceeding, I have to make sure the specified file exists. So I create a Script Task that checks for the file. File Exists = Task "Success" else Task "Fail". I then branch from that task to either proceed with the Data Flow task, OR else to log a failure message. IN EITHER CASE, I need to eventually return to the same cleanup Task in order to prepare for the next file. However, if the failure pathway flows into the Cleanup task, then the Success pathway always terminates just before, and does not execute the Cleanup Task. How can I ensure that two mutually exclusive pathways can return to the same Task? Thanks much!

Merge the repeat columns

The Form has repeating grid. I publish the form as an administrator approved form and the columns of the repeating grid with the 'merge' function.Yet the columns are promoted as single line of text insead of mulitple lines of text in the sharepoint form library.How to solve this ?

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)

Dynamic Columns Using Report Viewer Control

Hi,, I'm using Report viewer Control to generate reports.Currently i have static columns..I need to have columns created  based on the DB Query  results i.e., DB query will return more columns under certain conditions and less columns in another...In Short,Headers and column data will be known only at runtime.how can i bind the data dynamically...what can i do to accomplish this..

Comparing columns with NULL values--Merge says unmatched when data is matched.

I found the article below describing this same issue with the Oracle merge statement.  It also described a work-around:    http://searchoracle.techtarget.com/tip/Merging-datasets-with-NULL-values I have been unable to find a solution to this issue for SQL Server 2008.  I am trying to do basic ETL from Staging table to a Type II dimension table in a Data Warehouse.  I am using the Merge statement with the Unique key minus the modification date as my merge key list.  I have a handful of columns (in both Staging and the DW) containing nulls in my merge key list.  I have tried the ISNULL function and the ANSI_NULL db option (OFF) with no success.  When I put zeros in the null columns, it works as expected.  I am about to try separate INSERT and UPDATE statements, but I fear that the NULL comparison issue will bite me there with the JOIN statement.  Has anyone else experienced this?  NULL values are valid in our Data Warehouse.  How can I make T-SQL handle them? Thank you for your help, Jesse

How to use CSS to style just one of the columns in a GridView control

<asp:Boundfield Datafield="City" Headertext="City" sortexpression="City" CONTROLSTYLE-CSSCLASS="allcaps"/> I'm trying to use the CSS property "text transform" to make just one specific GridView column "all caps" (see above), but it has no effect. It only works when I place the reference to the class ".allcaps"  in the main tag at the top of the GridView control---but that makes all columns "all caps". How can I style just one column using CSS?   Thanks.  

Unable to Merge columns outside Group ? Unnecessary Row height ?

HI , In a matrix tablix , I'm unable to merge columns outside the group . Heres a quick screen shot . http://img843.imageshack.us/img843/366/samplema.png The top 3 columns is what i meant [ Unable to Merge columns outside Group ]  and Row height of the first row ? Thanks in Advance !!Rajkumar Yelugu

Merge Columns Like Excel In Gridview


Hello everybody.

I have a excel file which is in structure a class routine:

                  | 9-10 | 10-11 | 11-12 | 12-01 | 01-02 | 02-03 | 03-04 | 04-05 |

tue             |           subject1                      |     subject2     |    subject3      |

wed            |   subject2     |                subject3                   |    subject1      |

thu             |            subject3        |     subject2     |             subject1          

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?


Removing columns after Merge Join ?



I have the scenario (using a third party component) where certain columns must not be present as input.

I am doing a Full Outer - Merge Join.

This results in:



but now in some cases the LeftPK may be  null in other cases the RightPK may be null,

so i'm creating a derived column to check:

ISNULL(LeftPK) ? RightPK : LeftPK

and call this the TruePK

this all works however now i'm left with 3 columns

LeftPK; RightPK; TruePK

Is there some kind of transform (other than script task) that i can use to get rid of Left and Right PK columns before sending input to next third party component?

I.W Coetzer

Webform Grid Control With Varying Columns


I will do my best to explain what I am trying to accomplish.  I am trying to create a recipe system that will pull material amounts from an already built inventory database upon request for testing purposes of the different recipe runs.  What is throwing me for a loop is that each time a user will request a recipe comparison they will have a different number of recipe trial runs for comparison purposes.  In order to do this I'm guessing you will need to generate a gridview-like control with a dynamic number of columns which would be specified on a web form page prior to arriving at the recipe formulation page which will contain the control for the recipe formulation.  As a result the user will have different columns and rows on this formulation page, with the rows being a static number of 30 (30 being maximum amount of ingredients to include in each recipe).  The columns will contain the recipes to be compared, i.e. ProductRun1, ProductRun2, ProductRun3, where the number of ProductRunX will be determined by user input.  So the user when they come to this aspx page will be presented with a blank editable grid of X columns by 30 rows deep.  The left-most column will contain the ingredient names in a drop down box for users to select to input into their recipe and the rest of the columns will be editable fields where the user can type in t

DetailsView control boarder


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.

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.

Merge ColumnHeader Cells of DataGridView Control.




I Want To Merge ColumnHeader Cells of DataGridView Control.

I would Like Draw a Rectange in such a way tha From Sixth Column Header to 9th Column

kindly Reply Regarding this Topic


Lakshman C B


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='<%
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