Add A 2nd Header To A DataGrid?
Aug 17, 2010
Is there a way to add a 2nd header row to a DataGrid? In the row I want a DropdDownList and a Label. Right now I have a BoundColumn and a TemplateColumn in my Columns section of the grid. But adding something here will only add column, but not a header.
It should look like this:
This is my label text: dropdownlist --> first row of header
Amount Link --> 2nd row of header
100 link1
200 link2
How could I do this?
View 1 Replies
Similar Messages:
Aug 25, 2010
i want to have a header text in a datagrid but i dont want the text to belong only to one column of the grid but to the hole grid i mean i want the text to be writen in the hole place over the columns and not only over a specific column i dont know if i am clear..how can be that done??
View 11 Replies
Jan 6, 2010
I would like to know how I can freeze the Header Row using DataGrid with AJAX in IE8. I've already tried using CSS but this does not work with IE8 unless I switch it to compatiblity mode. I have more than 100+ users so this is not feasible.
View 1 Replies
Feb 3, 2010
Is possible set fixed header and scrollbar in a datagrid?
View 1 Replies
Jan 10, 2010
I am trying to add a ModalPopup to a GridView, by adding a button in the data grid header:
<asp:GridView ID="GridViewTradeDetail" />
<Columns>
<asp:TemplateField HeaderText="B/S">
<HeaderTemplate>
<asp:Button ID="ButtonShowBuySellPopup" runat="server" Text="Set B/S" />
</HeaderTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("buy_sell") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("buy_sell") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="trade_date" HeaderText="TD" />
</Columns>
</asp:GridView>
...
<asp:Panel ID="PanelBuySell" runat="server">
... panel content ...
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderBuySell" runat="server"
TargetControlID="ButtonShowBuySellPopup" PopupControlID="PanelBuySell" />
<asp:Button ID="ButtonShowBuySellPopup" runat="server" Text="Set B/S" />
But I get an error that the ModalPopupExtender cannot find the button ButtonShowBuySellPopup (If I move the button out of the grid header it's OK).
How can I link the popup to a button (or better still, text link) in the header of a Gridiew?
View 1 Replies
Mar 26, 2014
I have a DataGrid defined with columns such as:
Code:
<asp:BoundColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%" DataField="MONTH_PREVIOUS_YEAR" HeaderText="Month Hours (Previous Year)" ItemStyle-HorizontalAlign="Right"></asp:BoundColumn>
At a certain point in my program, I successfully re-set some of the Header titles programmatically:
Code:
Private Sub dgAccountability_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgAccountability.ItemDataBound
If e.Item.ItemType = ListItemType.Header Then
Dim previousYear As Integer = (Integer.Parse(year) - 1)
e.Item.Cells(1).Text = "YTD Hours " & previousYear.ToString
[Code]....
View 3 Replies
Feb 21, 2011
How can one specify background-image in Datagrid Header??? I had tried to define it like this(But it is not showing the image) :
<asp:DataGrid ID="DgCart" runat="server" Width="100%" CellPadding="0"
BorderWidth="0px" AutoGenerateColumns="False" CellSpacing="1"
HorizontalAlign="Center" DataKeyField="ProductID" [code]...
But it's not showing the background-image which I had specified.
View 5 Replies
Jan 20, 2011
Is there any way to get the datagrid header column's text before the grid loads.
View 7 Replies
Oct 6, 2010
I Have can I have the scrollable table but Fixed Header
[Code]....
View 7 Replies
Jul 29, 2010
I recieved a page to make some changes, and one of them is to change the hearders of a DataGrid. I'll have to merge some collumns.
I have searched a lot of solutions for cases similar to mine, but I couldn't make any of them work.
The code is above:
[Code]....
View 5 Replies
Jan 29, 2011
I want to PIN the header part of my DataGrid or GridView? How is it possible? Ex: Suppose we have 100 rows in data grid, and 1 row with header. If you scroll data grid, header row shouldn't scroll. It should be fixed or PINNED. Only rows with data should scroll. Is there any in built function in data grid to achieve this functionality or any other methods to do this?
View 1 Replies
Feb 14, 2010
I have searched numerous articles for how to accomplish freezing the Header Row of a DataGrid or GridView component being to simply hide the header and then build table cells just above the component to define the columns. But the one that I'd like to get to work is by the use of CSS code. Problem is that this code seems to work for everyone else but it isn't working for me. Here's my Stylesheet code:
[Code]....
When I run my page I get all the styles applied but the header scrolls with all the other rows in the grid.
why this code is probably not working? I am using .NET Framework 3.5 and developing in VSS 2008 which may be why this doesn't work?
I have successfully downloaded sample code from Code Project which works using other techniques as well, but the code was written in .NET 1.1 Framework and VB.NET.
View 2 Replies
Jul 22, 2013
I was using the VisualTreeHelper trying to locate a textBlock inside the datagrid columnHeaders. I have just learnt that : "The Header object of the DataGridColumn is actually the visible header of that column, whatever you set it to be. DataGridColumn is not part of the Visual Tree so there is not direct way to access the DataGridColumnHeader for it (we can't even be sure it exists yet)... " This has set me back by a couple of days. I tried to convert the suggested code to vb.net in order to use it but I don't seem to get it right. The code in c# is :
Code:
ataGridColumnHeader headerObj = GetColumnHeaderFromColumn(column);
private DataGridColumnHeader GetColumnHeaderFromColumn(DataGridColumn column)
{
// dataGrid is the name of your DataGrid. In this case Name="dataGrid"
List<DataGridColumnHeader> columnHeaders = GetVisualChildCollection<DataGridColumnHeader>(dataGrid);
[Code] ...
How to apply it in my scenario shown below. I want to access in order to rename the textblock 'columnHeaderName'. How can I do this?
Code:
<Datagrid>
<Datagrid.Columns>
<DatagridTemplateColumn Header="header1" Width="100">
<DatagridTemplateColumn.HeaderTemplate>
[Code] ....
View 1 Replies
Oct 18, 2010
I have an asp.net gridview which represents some kind of reservation calendar. Each row represents a workplace and each column a day. The header value (date) is set by a method since the start of the time period shown by the gridview can be selected by the user. Since the date column can start at every day of the week I wanted to mark the weekend day columns with a special background. How to set this? (See .aspx code snippet below which is currently used for each column ().
Remark: ItemStyle-BackColor= '<%# %>' (dynamic) annotation isn't allowed in the <TemplateField> Tag and the actual date must be evaluated somehow from the header or another control.
[Code]....
[Code]....
View 1 Replies
Jan 12, 2011
I have a datagrid and vertical-horizontal scrollbars in it. now when datagrid will have more records , scoll bars will be provided. now when i scroll vertically , my header line of the datagrid is also scrolling so i wanna freeze it. i have used javascript to freeze it , its working in IE properly but there is problem with other browser.
i used this :[URL] but its not working in other browser.
View 11 Replies
Jun 29, 2010
I want to dynamically bind dataset values into datagrid's header datafield.
Is it possible? To be more clear, when you click on datagrid's (Collection) from properties window, you get selected columns created from Bound column. So in those columns I want to dynamically display dataset's table values in those columns.
i.e like ds.Tables[0].Rows[0][0].
Is it possible to do it in Datagrid ItemDataBound function like,
e.Item.Cells[1].Text = ds.Tables[0].Rows[0][0]
or something like this? I know the above code is wrong and wont work since I tried it out and while building it throwed error saying, Cannot implicitly convert type 'object' to 'string'.
View 5 Replies
Jan 4, 2010
how to display a header of gridvew as a 3D view color Header?
View 14 Replies
Jan 21, 2010
Scenario:
I have a Gridview where I want to handle the Sorting in a custom control that I've added to the header.
I've added this control to my GridView's Header via OnRowCreate event handling. I want the Sort Expressions to persist session to session (via Webparts Personalization)
Here is what I have for adding the custom header control to the GridView Header
[Code]....
This works out well for adding the control, but I can't get anything to persist because these controls are creating initially via postback (per the event) and re-created on all subsequent postbacks. I can't add an If(!IsPostback) because the controls are initially created on the gridview's postback (well at least thats how it's acting when I put it in there) If I were to add this control via the ASP page, not via the Codebehind, I would be able to persist the control. If I try to treat it as though everything is setup correctly, and assign my custom control's controls to [Personalizable], I get a runtime error telling me that I can only have webpartzones in or before Page_init (I'm guessing this is due to when/where the
gridview hits the OnRowCreate event). If there is some fundimental logic I'm missing, or best practices that I'm moving away from,
View 1 Replies
Oct 30, 2010
I call a webservices from my javascript and im getting response as error.
Server did not recognize the value of HTTP Header SOAPAction:
View 1 Replies
Nov 28, 2010
is there anyway i can add in the gridview in header column name a button instead of label ?
column name 1 column name 2 column name 3 button
i am using checkbox column in item template for the button ,i wish after selecting checkbox for some row to click on the button on the header !!
View 2 Replies
Jul 19, 2010
In my ASP.Net (2.0) Web Service implementation (The implementation class derives from
System.Web.Services.WebService with WebServiceBinding confirming to WsiProfiles.BasicProfile1_1 .
The SOAP response sent out by the Service has two elements missing :
1> The XML header itself : (<?xml version="1.0">)
2> The opening and closing Envelope tags with NameSpace ("<S:Envelope xmlns:S=http://schemas.xmlsoap.org/soap/envelope/>" and "</S:Envelope>" ).
This results in "breaking" of my client unless the above mentioned headers are inserted at the client end, and my intent is to avoid bypasses at the client end as far as popssible.Is this the default behavior ?
View 2 Replies
Mar 11, 2010
i have a problem with ListView control,when i bind data to it, it shows the heder of it also.
i don't want to show me the hedear, what should i do?
[Code]....
View 11 Replies
Feb 16, 2011
I am using the following code to change the header based on the session variable
[code]....
View 2 Replies
May 7, 2015
How to pass gridview particular column values to another page's table header...
View 1 Replies
Oct 13, 2010
I have a Tab Container that I would like to be able to add a star (*) at the end of the tab header text when there are NEW Users to be approved by the Site Administrator. By default meaning that is what I typed in designer mode is "Users Waiting Approval", but when I load the page I run a routine to see if there are and new users requesting access and at that point durning the page load I would like to change the tab from "Users Waiting Approval" to "Users Waiting Approval *" with the star at the end (*). How can I update this tab header text durning the page load event? Is there some javascript function I can call like set_HeaderText?
View 1 Replies