CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > microsoft_downloads.css_friendly_control_adapters Tags:
Item Type: Date Entered: 11/13/2007 10:30:05 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 49 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
"shapper" <>
NewsGroup User
GridView. Is this possible?11/13/2007 10:30:05 PM

0

Hello,

I have a GridView and I am using CSS Friendly Adapters. The GridView has 4 columns.

I need to make the GridView a fixed width.

3 columns must have the width necessary just to show their contents and the other one should fill the rest of the space.

How can I do this with the CSS Files?

Do I need to use Inline styling? And can I do that when I use CSS Friendly Adapters?

Thanks,

Miguel
 

  

"himanshu_hajar
NewsGroup User
Re: GridView. Is this possible?11/14/2007 11:20:32 AM

0

hi,

U can do it as follow

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .column1
        {
            word-break: break-all;
            width: 40px;
        }
        .column2
        {
            word-break: break-all;
            width: 80px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound"
                Style="position: static">
            </asp:GridView>
        </div>
    </form>
</body>
</html>


*********** code behind
        DataTable myTable;
        protected void Page_Load(object sender, EventArgs e)
        {
            myTable = new DataTable();
            myTable.Columns.Add("ID", typeof(Int32));
            myTable.Columns.Add("Name", typeof(String));
            myTable.Columns.Add("Job", typeof(String));
            myTable.Rows.Add(1, "aaa","test");
            myTable.Rows.Add(2, "bbbbbbbbbbbbbbbbbbbb","testtest");
            myTable.Rows.Add(3, "ccc","testtesttesteetststetstest");
            GridView1.DataSource = myTable;
            GridView1.DataBind();
        }

        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            e.Row.Cells[1].CssClass = "column1";
            e.Row.Cells[2].CssClass = "column2";
        }

 


From:
Himanshu Hajariwala
IF IT HELPS YOU THEN KINDLY PRESS THE "ANSWER" BUTTON.

The shortest distance between a problem and a solution is the distance between your knees and the floor.
The one who kneels to the Lord, can stand up to anything.


2 Items, 1 Pages 1 |< << Go >> >|


Free Download:













cssselectorclass not showing

css friendly adapter, disable for ie6

fix: ie7 ghost menu problem

can't set menu font color correctly following hover action

disabling adapters

bug in the datalist adapter

loginadapter

adding checkbox to the treeview

ajax + detailsview + css adapters = fail

ie 7 beta 3

help

asp menu shows over text in ie 7

set the css-friendly menu properties programmatically

set adapter by code

documentation for adding to existing website.

button click problem

troubleshooting ie6, submenus not appearing

adding custom attributes to the site map nodes so they can be used in the menucontrol adapter

2 feature requests

login displaying horizontally

problem using menuadapter.vb (4th level menu shows all)

setting css class for tbody of gridview

non-indenting treeview

problem in using horizontal style

css-friendly web templates not appearing in visual studio 2005

sharepoint 2007 and menu adapter: selected page missing

when would you like to relase a new version?

how to remove extra styles from the menu rendering with the css adapter ?

need help using control adapters at the machine level

skip navigation links and access keys

.css files

emptygridview and the gridviewadapter

invalid xhtml

login control - beta 2

passwordrecoveryadapter doesn't display username and question for templated views

bug in css friendly treeview adapter when used with updatepanel and tabcontainer?

css friendly menu problems on ie 6.0

(yet another) vertical align only in ie6

menu selecteditem problem

warning cssselectorclass

treeview with three state chechbox

gridview pagerstyle

another treeview, but i need youre help

problems with horizontal orientation

asp.net menu control - on hover makes page content disappear (ie 6)

treeview checkbox postback issue

form postback error

treeview selectednodechanged and showcheckboxes

serving suggestion

partial install success

   
  Privacy | Contact Us
All Times Are GMT