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


Top 5 Contributors of the Month
david stephan
Asad Ali
Post New Web Links

ASP.NET Grid - Merge cells or hide borders

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

Hi

I am working on ASP.NET 4.0 application.I want to bind the data in a datatable to a grid control and i want to do some formatting.

I want to merge the cells or hide the cell border in the first three columns (Merge every 5 cells in a column). And Vertical align the text to center.

Also i need row border at the end of every 5 rows.

For example, If i am binding 10 rows to the Grid i need row border only at the end of 5th and 10th row. And merge every five cells only in the first three columns. All the other columns should not be changed.

I also want to change the background color of the cells in all rows based on the value in that cell.

How to achieve this in ASP.NET 4.0 and which control can be used to display in this format?

 

Thanks
Ashok




View Complete Post


More Related Resource Links

Hide grid view column if empty

  
 Hello All, I want to hide a grid view column if that column is empty. How do I do this? I dont have much exp. with grids. Please help me. Thanks in advance.

Can I hide the "View Product" link in the grid view when there aren't any products for the category

  
Hello,Suppose you create a DD web site using a database that has products and categories. The products table has a foreign key reference to the categories table, and when you look at the categoriesin the DD site, each category has a link "View Product" that you can click to see produtcs in that category.However, this link shows even if there aren't any products in the category. Can I change this?Thanks

WPF Data Grid - How to hide the next column/row that is visible?

  

I'm using a WPF data grid to bind to an object (i.e. not a database). I have the horizontal alignment on Stretch. I currently have it within a Border, which is within a Grid.

However when I run the application the DataGrid has a blank column and grid showing. That is say I have 5 columns & 5 rows, then there is a blank 6th column and row showing. See image:

alt text

Question - How can I get rid of these blank rows? Note that the contents of the DataGrid are populated programmatically (i.e. are not static).

thanks


WPF Data Grid - How to hide the next column/row that is visible?

  

I'm using a WPF data grid to bind to an object (i.e. not a database). I have the horizontal alignment on Stretch. I currently have it within a Border, which is within a Grid.

However when I run the application the DataGrid has a blank column and grid showing. That is say I have 5 columns & 5 rows, then there is a blank 6th column and row showing. See image:

alt text

Question - How can I get rid of these blank rows? Note that the contents of the DataGrid are populated programmatically (i.e. are not static).

thanks


Split Grid Cells dynamically into multiple rows : WPF

  

How can i achive this table structure GUI using available WPF controls dynamically?

 

Col 1

Col 2

Col 3

Col 4

Row 1

 

Need to hide a Star sized Grid row

  

Hi,

I kind of need a combination of an auto sized and star sized Grid row. I have a grid with 3 rows. I want the middle row to use Star sizing to allow its content to grow and shrink with the form. Where I'm stuck is, the middle row's content is conditionally visible. When the content is not visible, I want the middle row to collapse. What's the best way to do this?


How to select column value from grid and hide a column?

  

Hello,

I'm trying to retreive a column value from gridview5 to use it in a query to display resuls in gridview, can you please help me with the code below. Also how do you hide a column in the grid?

Where (p.Link_ID Like GridView5.?????)

Dim DB As New AOP29DBDataContext

Dim Query = From p In DB.Link_Tables _

Where (p.Link_ID Like GridView5.Columns("link_ID")

Select p.Receiver.Receiver, _

p.Donor.Donor, _

p.BM.BM()

GridView4.DataSource = Query

GridView4.DataBind()


How to access Telerik Grid's rows and cells?

  

Hi,

I have the following telerik grid:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                        <telerik:RadGrid ID="GrdDynamic" runat="server" AutoGenerateColumns="false"
                                        
                                    ShowFooter="True">
                                    <MasterTableView>
                                      <Columns>
                                      <telerik:GridBoundColumn AllowFiltering="false" HeaderText="MovieID" UniqueName="MovieID" HeaderStyle-Wrap="false"
                                        DataField="MoviePriority">
                                      </telerik:GridBoundColumn>
                                      
                                    <telerik:GridTemplateColumn AllowFiltering="false" D HeaderText="Channel Number" UniqueName="Channel Number" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtChannelNo" runat="server" Text='<%# 

Merge ColumnHeader Cells of DataGridView Control.

  

Hello,

 

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

Regards

Lakshman C B

 


Sharepoint Designer 2007 Cells Merge Bug

  
I would like to report a Sharepoint Designer 2007 bug. As MS is forgoten to create any public error report site, here it is :-)
1. Try with the following little CSS, save it:
table        { border:1px solid #000000; text-align: justify; width: 720px; padding: 10px}
2. Attach the CSS to a HTML file
3. Insert a 3*2 table into HTML
4. Try to Merge the 2nd and the 3rd cells in the first column. It is impossible to select theese cells. 
I've tried it in SharePoint Designer 2007 English and Hungarian edition as well...

Edit GridView Individual Cells in ASP.NET

  
The ASP.NET GridView allows for a row of data to be edited by setting the EditIndex property of the GridView, placing the entire row in edit mode.

You may not want the entire row in edit mode if you are using DropDownList controls for several columns in the EditItemTemplate. If each DropDownList has many options then loading them all at once may result in a sluggish page. Also, if your data structure is more like a 2 dimensional array rather than a set of rows, you may want to edit each cell individually.

Here I will demonstrate how to achieve this and also how to deal with event validation without disabling it.

Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel

  
I've posted an update to this post to apply on demand loading of Details data using ASP.NET AJAX PageMethods. I'm demonstrating the usage if CollapsiblePanelExtender client events on the new post. Check it out.

I admit, Matt Berseth is really inspiring me! Few days ago I pass through 2 of his great posts:

.Surrounding your Data Table and Dialog Controls with ComponentArt Styled Panels
.Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls
The first one is pure design tips one which I used for making good presentation of my demo here. The 2nd post is actually the idea.

Hide a repeater in ASP.NET C# if the DataSource contains no items?

  
I have an ASP.NET page that uses a repeater nested within another repeater to generate a listing of data. It's to the effect of the following:
In the (C#) code-behind I'm basically using LINQ to pull a listing of information from an XML document and bind that information to the first repeater.

Searching for the answer to this, it seems the method is to determine whether the data for the nested repeater is empty. If it is, then you set the visibility of the repeater to false.

Edit Individual GridView Cells in ASP.NET

  
The ASP.NET GridView allows for a row of data to be edited by setting the EditIndex property of the GridView, placing the entire row in edit mode.

You may not want the entire row in edit mode if you are using DropDownList controls for several columns in the EditItemTemplate. If each DropDownList has many options, then loading them all at once may result in a sluggish page. Also, if your data structure is more like a 2 dimensional array rather than a set of rows, you may want to edit each cell individually.

jQuery grid view plugin

  
jqGridView is new, client-rich, XML-based, ajax grid plugin for jQuery library. jqGridView provides professional solution for representing and editing tabular data on the web. Carefully designed, with powerful script API, this editable DHTML grid is easy configurable with XML, and shows convincing results working with large amounts of data. jqGridView allows easy implementation of nice looking(managed through css). jqGridView is not platform-depending plug-in, it can be used with different web -programming platforms like: ASP .NET/ASP, PHP, JAVA, CGI scripts etc. jqGridView has hight bowser compatibility.

jQuery grid view plugin

  
jqGridView is new, client-rich, XML-based, ajax grid plugin for jQuery library. jqGridView provides professional solution for representing and editing tabular data on the web. Carefully designed, with powerful script API, this editable DHTML grid is easy configurable with XML, and shows convincing results working with large amounts of data. jqGridView allows easy implementation of nice looking(managed through css

How to take value of bound field of grid in a variable or in a textbox.

  

How to take value of bound field of grid in a variable or in a textbox.

 I m using this code in .aspx page for grid.

<asp:GridView ID="Grd_Mprocess" runat="server" AutoGenerateColumns="False"

                      Width="100%" AllowPaging="True"

                      onpageindexchanging="Grd_Mprocess_PageIndexChanging"

                      AllowSorting="True" PageSize="5"  >

                 <RowStyle CssClass="odd" />

                    <Columns> 

<asp:BoundField HeaderText="DOC_TYPE_PK" DataField="DOC_TYPE_PK"  Visible="true" >

</asp:BoundField>

  <asp:TemplateField HeaderText="DOC TYPE ID" Visible="true">  &nbs

Categories: 
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