473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Fixed Column in Grid View

hi
Please help me i want to fix a column in grid view i used style for locking the
column since i am setting the position as relative its not working properly
i have given my code below could any body fix this issue

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2. /* Div container to wrap the datagrid */
  3. div#div-datagrid 
  4. {
  5. width: 700px;
  6. overflow-x: auto;
  7. overflow-y: hidden;
  8. overflow: -moz-scrollbars-vertical;
  9. scrollbar-base-color:#ffeaff;
  10. }
  11.  
  12. /* Locks the left column */
  13. td.locked, th.locked {
  14. position:relative;
  15. cursor: default;
  16. /*IE5+ only*/
  17.  
  18. left: expression(document.getElementById("div-datagrid").scrollLeft-2);
  19. }
  20.  
  21. /* DataGrid Item and AlternatingItem Style*/
  22. .GridRow {font-size: 10pt; color: black; font-family: Arial; 
  23.              background-color:#ffffff; height:35px;}
  24. .GridAltRow {font-size: 10pt; color: black; font-family: Arial; 
  25.              background-color:#eeeeee; height:35px;}</PRE>         
  26.  
  27. </style>
  28.  
  29. <html>
  30. <div id="div-datagrid" >
  31.              <asp:GridView ID="GridView1" PagerSettings-Visible="false"   runat="server" CellPadding="4" ForeColor="#333333" 
  32.                      AllowSorting="True" AutoGenerateColumns="False"   PageSize="7" AllowPaging="true"
  33.                         DataKeyNames="ClientId"  OnRowDataBound="GridView1_RowDataBound" >
  34.                  <AlternatingRowStyle CssClass= "GridAltRow"/>
  35.                 <RowStyle CssClass= "GridRow"/>
  36.                     <Columns>
  37.                          <asp:BoundField DataField="ClientId" HeaderText="ClientId" InsertVisible="False"
  38.                     ReadOnly="True" SortExpression="ClientId" />
  39.                 <asp:BoundField DataField="EnterpriseUserName"  />
  40. <column>
  41. </DataGrid>
  42. </Html>
and in code behind i called the rowbound event

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[0].CssClass = "locked";
}



Is there is any other solution Please
Nov 23 '07 #1
4 1809
CyberSoftHari
487 Expert 256MB
You have to explain below queries
What is your front end?
What version is that?
What is the error you are getting?
Peoples are not here to simply fix your problem, you have to try.
Nov 23 '07 #2
Try using "Frozen" property Or "Read only" property can be set to true for that column.
Nov 23 '07 #3
CyberSoftHari
487 Expert 256MB
I think she never mean read-only column!
Read-only column! = Fixed column.
Nov 27 '07 #4
Shashi Sadasivan
1,435 Expert 1GB
Hi,
Welcome to TSDN

Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.
Nov 27 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Fernando Lopes | last post by:
Hi. Anybody know how can i add a column with radio buttons in a grid view? I will use this column to select the grid row to show others informations about this selected row. Any help will be...
2
by: Joe Griffith | last post by:
I'm using a Win Forms Data Grid View control in unbound mode. When I add columns using the wizard the first item is the column name. Everything works fine. However, if you return to the...
4
by: Otie | last post by:
Hello, I am using the MSFlexGrd Control in VB5. I have 1 fixed row and one fixed column. I am trying to do a sort when the user clicks a column in the FIXED ROW. But when I capture the row...
1
by: Gunawan | last post by:
Hi, I could add a boundcolumn to gridview using this BoundColumn bc = new BoundColumn(); bc.DataField = "ProductsName"; bc.HeaderText = "Product"; gridview1.columns.add(bc); What I would...
2
by: Valli | last post by:
Hi, I am using a gridview to display data from table. In the gridview, there are 5 columns in which one column contains link name(eg. http://www.msn.com). I want to show this link as an...
2
by: jakeesgirl | last post by:
I'm creating a C# program in Visual Studio. When I query the sql database, the results are put into a data grid view. However, the column widths are always too small when displayed. I have text that...
2
by: rameshgohil | last post by:
I am using grid view and a button column in it using <itemTemplate> but I am not able to rerive cell value of a selected row from grid view. I have tried the following to methods in Row_command...
1
by: rogerford | last post by:
I have a grid which i bind with values from Database. I have events to edit and update the grid. I am not using SqlDatasource to connect to DB. Rather i am doing the updating of the grid...
2
by: vinod allapu | last post by:
Hi all, i want to append an empty column to the grid view. Only the appended column should be editable and while displaying the grid the entire column should be in editable mode(not a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.