[ GridView ] three little style cases

T

teo

hallo,
I have three problemS about the style of a Gridview (Aspnet 2.0)
to try to solve (in the official way or by a workaround)


1)
how to remove the upper border of a cell (1,0) ;
it has no text;
here an image:
http://img184.imageshack.us/my.php?image=imageko3.gif
(5kb)



2)
hot to add a left padding (4 px) to an entire column ?

the only way I found is to cycle all the rows
For i as integer = 0 to ....
GridView1.Rows(i).Cells(0).Style("Padding") = 4
Next

I would have expected a sort of
Gridview1.Columns(0).ItemStyle.Padding = 4
but it doesn't exist



3)
how to set/force the height of a row ?

I have a row with text that wraps so I have two lines of text in it;
I need TO GAIN vertical space
so I tried all the three way below:

GridView1.rows(5).height=40
GridView1.Rows.Item(5).Style.Item("Height") = 40
GridView1.Rows(5).Cells(3).Height = 40

but with no effect

------------------

Here the aspx code of the GridView

<asp:GridView ID="GridView1" runat="server" Style="position:
relative" BorderStyle="Outset" AutoGenerateColumns="False">

<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("Data") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("Data") %>'></asp:Label>
</ItemTemplate>
 
T

ThatsIT.net.au

teo said:
I forgot:

I tried
GridView1.Rows(3).Cells(3).Style("cellborder-top-style") = "none"
GridView1.Rows(3).Cells(3).Style("cellborder-top-style") = 0
with no effects

maybe try changing color to white or whatever your background is so it can
not be seen?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top