Forms Data Controls :: Aligning Columns Of Two Separate Grid Views?
Jun 10, 2010
I am using two Grid Views to display data. One (headersGV) is used to show custom headers which change depending on the device type in the second table (dataGV).
The second displays device data and is bound to db tables. This table has a sort mechanism enabled, the functionality of which is in the header cell of the table, hence the need for the headerGV for column headers.
I need to align these two seperate tables so that the headers align with the data columns in the other table. The dataGV columns dynamically resize depending on the data displayed.
I have tried inline styles, css bound to both tables at different levels of priority, onbind methods, and overriding DataBind() method.
View 6 Replies
Similar Messages:
Sep 20, 2010
I created a gridview that is made up of 4 gridviews and using a stored procedure to populate it. I create columns at runtime because the number of columns changes all the time.To make the grids editable I am adding template fields at runtime as I create the columns, this is to ensure that a user is able to edit the cells and some foot values update. Reason why I have four grids is to freeze rows and columns like in excel using javascript. The problem is that performance is very bad especially in IE, the grids take a long time to load. I am not sure if this is caused by the data load or the creation of text boxes. see some of the code below for my _aspx page:
[Code]....
View 1 Replies
Jul 16, 2010
I have two grid views in my page..first one normally displays many number of rows..But the second one displays 3 or 4 rows....when the project running, the second one seems to appear at the centre of the first..that is if the first grid has 12 and second grid has 4 rows ..the first row of the second is in line with the 5th row of the second..why this happen? I want a normal display..The first row of the second grid should be in line with the first row of the first grid.
View 3 Replies
Nov 29, 2010
I have a couple of things that are not working with my Gridview:
1) I've managed to display 3 columns in one column (see code above) but the data is separated by commas, how can I display each data item in separate rows.
2) How can I make the data unique, as I have added the distinct command which I configured in my SQL data source
3) I need the rows to not display nulls, but at the moment it isn't displaying the row if one of the columns is null?
[Code]....
View 3 Replies
Mar 29, 2010
i have a need to display the each row in a separate page,
example: if a Grid view contains the 10 rows,each row should be displayed in one page(only that row only),when ever second row comes, first row should be removed from grid and second row should be displayed as a whole in that, like wise..when ever 3rd row comes 2nd should be erased and 3rd will come into Grid view.
i am using following code but not getting result as i want,
foreach (GridViewRow gr in GridView1.Rows)
View 5 Replies
Jun 16, 2010
Export to Excel with two sheets from two grid views. I am in need of export two grids into a single excel with two sheets.
View 2 Replies
Nov 10, 2010
I have 50000 record in two tables which need to show in grid? and the records in the table use to insert , update and delete frequently. I need to load fast all the records. which method i should bind to get as quick as early as possible. Which z best method to bind whether using SQL datasource, creating views, using datatable, creating stored procedure etc?
View 8 Replies
Dec 27, 2012
I have one table in sql server called student_info
In this table keys kills column contain value like below
'c,c++c#'
'c++,c,c#'
'c,c++,c#,asp.net'
etc...
I want to search the student information based on keyskills like naukri
1.Any keyskills from textbox1
2.All keyskills from textbox2
3.Except keyskills from textbox3
When I enter c,c++ or c++,c in textbox1 then it will dispaly all the student whose have c,c++ keyskill
How to achieve this.
View 1 Replies
Jan 23, 2011
in the gridview, i want the small lines to separate the columns.
I used row style property but it doesn't work.
View 1 Replies
Jun 21, 2010
tried to use gridview.columns.count to see if there are any columns bt it shows zero, second how shall i et the names of columns in the gried view at runtime i need them to be stored in an string array
View 2 Replies
Nov 13, 2010
I have created Grid where in Columnsname come from Database and it will be generated from a setup page where Icreate column in SQL dynamically.
Now I wanted to have an idea about these grid. How to fetch data in this grid and how toinsert data into database.
View 1 Replies
Feb 9, 2010
I am developing an application using ASP.NET with C#.NET.in my application i have a gridview control and radobutton list having the values as Manufacturer and Distributor. based on the radiobutton selected value,the gridview will bindedup.
i am using SQL SERVER 2005 as backend server. in my database i have one table with columns as
1.mfropendate
2.mfrclosedate
3.mfrawarddate
4.distopendate
5.distclosedate
6.distawarddate
My gridview has 3 columns as Opendate,closedate,awarddate.
if user select the radiobutton as manufacturer,only mfropendate,mfrclosedate,mfrawarddate have to bind. and if user select the distributor the remaining 3 fields will have to bind. for that i had write a storedproc as create procedure sp_GetDraftBids as begin select mfropendate as opendate,mfrclosedate as closedate,mfrawarddate as awarddate, distopendate as opendate,distclosedate closedate,distawarddate awarddate from draftbids end GO
i.e i had taken the alias names for that fields so that i will bind the only 3 columns to grid view as opendate,closedate,awarddate.
My gridview code is
[Code]....
here i had taken the same alias names as i have to bind only 3 columns to gridview.when i run my application i am getting the records in data table with column names as opendate,closedate,awarddate,opendate1,closedate1,awarddate1.i.e it does not allow the same alias name.
for two radio button conditions i.e for manufacturer and distributor the gridview binded with opendate,closedate and awarddate columns as i had binded the gridview boundfields withat names.
but when user select the distributor radiobutton i have to bind the opendate1,closedate1 and awarddate1 to the gridview. for that should i can i change the storedproc are any other solution is there?
View 5 Replies
Apr 14, 2010
How to resize the width of columns of grid view? I want a column 250px wide.How I can do this?
View 4 Replies
Jun 25, 2010
I have search for a long long time and could not find a solution to access to grid view's column properties. I have binded a grid view through this method, the bindGridView function will return a table with columns and rows.
The problem here is I cound not access to columns properties such as Grid_View.Columns.Count or Grid_View.Columns[0]."something". It seems like the grid_view does not have any column. But I can access to the Rows properties.
I have put this code within a (!IsPostBack) and set the AutoGenerateColumns to true?
I need to access to columns badly as I need t add additional column to the binded grid view.
[Code]....
View 6 Replies
Jul 13, 2010
I have developed my application using ASP.NET with Visual Basic. I have a table that contains 3 fields. The name of the table is "Customer" and the names of the fields are "Name", "Address", and "Amount". I have a gridview that displays these three columns. I want to summarize the value in the "Amount" column for each record and display the summarize value in the footer of the "Amount" column.
I added some code to the "ItemTemplate" and "FooterTemplate" of the template for the "Amount" field and wrote two functions One function adds the value of the "Amount" field to a variable called "TotalAmount" and the second function 'gets' the value stored in the "TotalAmount" variable.
I am not getting any error messages and all of the items are displayed in the gridview but I am not displaying anything at the bottom of the "Amount" column. What more do I need to do?
This is my code for the "Amount" template:
<asp:TemplateField
HeaderText="Amount"
SortExpression="Amount">
<EditItemTemplate>
<asp:TextBox
ID="TextBox1"
runat="server"
Text='<%# Bind("Amount") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label
ID="Label1"
runat="server"
Text='<%# Bind("Amount", "{0:c}") %>'>
<%#SumAmount(Eval("Amount")) %></asp:Label>
</ItemTemplate>
<FooterTemplate>
<%#GetTotalAmount() %></FooterTemplate>
<FooterStyle
BorderColor="Black"
BorderStyle="Solid"
/>
</asp:TemplateField>
This is the code in my .vp file
Dim TotalAmount as decimal 0.0
Function SumAmount(ByVal Amount
As
Decimal)
As
Decimal
TotalAmount = TotalAmount + TotalAmount
End
Function
Function GetTotalAmount()
As
Decimal
Return TotalAmount
End
Function
View 3 Replies
Jan 28, 2011
I am working on the dynamic grid view(create dynamic columns).I need some thing like that given bellow in the fig:
columns1,2,3 are dynamic and the modules under the columns are also dynamic. to create grid like that.
Column1
Column2
Column3
Module1
Module2
Module3
Module4
Module5
Module6
Module7
Module8
View 2 Replies
Oct 7, 2010
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 the amount of each material to be used. The setup will look roughly like this:
| ProductRun1 | ProductRun2 | ProductRun3 |
ProductRun4 | ... |
-------------------------------------------------------------------------------------------------------
Material1 | Material1_Amt | Material1_Amt | Material1_Amt | Material1_Amt | ...|
-------------------------------------------------------------------------------------------------------
Material2 | Material2_Amt | Material2_Amt | Material2_Amt | Material2_Amt | ...|
-------------------------------------------------------------------------------------------------------
Material3 | Material3_Amt | Material3_Amt | Material3_Amt | Material3_Amt | ...|
-------------------------------------------------------------------------------------------------------
(...)
-------------------------------------------------------------------------------------------------------
Material30 | Material30_Amt | Material30_Amt | Material30_Amt | Material30_Amt | ...|
-------------------------------------------------------------------------------------------------------
So my question is how would I go about tackling something like this and what controls would I use. All of the forum posts around the internet show the GridView control being tied to data in a database already and not having the ability to have a fully blank and editable table upon the page loading so that it can accept user input. Another wrench into the situation is that the column numbers can vary. What control would be used in this situation or would it be better to use just a repeater of textboxes to build this type of control? Another thing is once the control is built how can you pull the data from such a control with the intentions of entering it inside a sql server database?
View 44 Replies
Jan 23, 2010
I have a grid with one itemtemplate field with autogenerated columns=true.I want to show the itemtemplate filed after autogenerated columns .
View 6 Replies
Feb 4, 2010
[Code]....
I want to merge these columns DescriptionHedding, Description and header text is Deacription
View 1 Replies
Jun 2, 2010
Need row editing on page_load for all the cells and need to validate each cell entry. Means cell1 one entery isvalid it fills thrid cell and insert or update to a table in the database. How do i handle on tab clicking to update in databse.
View 1 Replies
Aug 6, 2010
I have a condition to check weekdays with a particular time corresponding
to that day that were added to a grid view using a drop down list and two text boxes.
The drop down list has weekdays and textboxes has from and to time.
I have to verify a condition to avoid duplication of same day with same time should not occur in the table twice.
(i have used time picker jquery to get time.)
how should i write the condition in sql and use that in C#
View 5 Replies
Jan 13, 2010
I m trying to add template columns at run time. but it get lost on post back ,
I have to add columns on postback ,what approch should i use that the columns should not diappear at postback
View 1 Replies
Oct 27, 2010
i have a grid view with all columns as TemplateFields( No BoundField). Based on certain condition i have to set Visibility of few columns false. Suppose when there is no column 'CaseList2' in the DataTable, then the second column of the grid (whose column index is 1 )should be invisible. But when the Gridview binds it gives error DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'CaseList2'
i googled it and found that
GridView1.Columns[1].Visible = false;
should work. But its not working actualy.
Code:
[Code]....
Codebehind:
[Code]....
View 3 Replies
Jan 17, 2011
A gridview is having 96 fields/columns retrieving data from an xml file.I need to gridlevel horizontal scrolling from 3 rd column keeping first two columns freeze .While scrolling horizontally (e.g. left to right), The column header have to move horizontally. Kindly guide me for the same. I got the scrollbars but now my issue is how to freeze first two columns of a gridview(for comparing values in one column with other column values)
<div style="overflow:scroll"></div>
[Code]....
Keeping Heading and Title column freeze and doing gridlevel horizontal scrolling for the rest.
View 2 Replies
Jun 28, 2010
Im developing an ASP Web application and have a Gridview which I have set as follows:-
[Code]....
At this point alls good.
I have a field in the selected table that returns an integer which relates to a Table on a Seperate Database.
Is it possible, when the grid is being filled to check a fields value and set anothers columns value depending on the vale?
ie First Row Column 1 value is 1 so set Column 2 to "Sunny"
Second Row Column 1 value is 2 so set Column 2 to "Cloudy"
View 4 Replies