Home All Groups Group Topic Archive Search About

Questions concerning detailsview or datagrid ASP.NET 2.0

Author
13 Mar 2005 6:37 PM
Stefan Gsundbrunn
Hello,

first of all - let me introduce myself. I am a german ColdFusion developer
since 1997. I watched the development of Asp.net for a few years and now,
with the beta of 2.0 I would like to learn this language.

I´ve tested certain record viewer components pretty successfully - but
a few things I cannot solve - even google didn´t show me the
information I was looking fo (maybe I just cannot find them as I don´t
kjnow exactly what I am looking for)

Please let me know if this is not the correct group.

My code is:

<form runat="server">

<asp:detailsview runat="server" id="detailView"

datasourceid="testDB" allowpaging="true" headertext="Fischarten"

datakeynames="ftbFischArtId" autogenerateeditbutton="true"

autogeneratedeletebutton="true"    autogenerateinsertbutton="true"

GridLines="both" width="250px"

BorderWidth="1"    BorderColor="Black" cellpadding="2">


<headerstyle      Font-Name="arial"

        Font-Size="9pt"

        Font-Bold="false"

        ForeColor="black"

        BackColor="#f55405" />

<rowstyle      Font-Name="arial"

        Font-Size="9pt"

        Font-Bold="false"

        ForeColor="black"

        BackColor="white"/>   

<editrowstyle      Font-Name="arial"

        Font-Size="9pt"

        Font-Bold="false"

        ForeColor="black"

        BackColor="#D4D0C8"/>

<pagerstyle     BackColor="#D4D0C8"   

        horizontalalign="left" />                   

<pagersettings     firstpageimageurl="images/left_all.jpg"

        lastpageimageurl="images/right_all.jpg"

        nextpageimageurl="images/right.jpg"

        previouspageimageurl="images/left.jpg"

        mode="NextPreviousFirstLast" />   

</asp:detailsview>       

</form>           

Works pretty fine - except the layout. And this are my questions:

How can I set borders to header and pager (including the color)?
How can I change the color of the gridlines? They always gray -
independend on what I do.
How can I change the width of a cell? Maybe the left cell of all rows. And
how to change the color of them?

Any hint is appreciated. Thanks in advance!

Stefan

--
Stefan Gsundbrunn
Project Design - Software Design - Brain Design
http://www.gsundbrunn.de
New: http://www.fangtagebuch.de

Author
14 Mar 2005 3:57 PM
Paul D. Fox
Fredrik Norman has a nice blog on using various ASP.NET 2.0 controls

http://fredrik.nsquared2.com/listposts.aspx?categoryId=5

Hope this gets you started.

Paul

Show quoteHide quote
"Stefan Gsundbrunn" <i***@gsundbrunn.de> wrote in message
news:pan.2005.03.13.18.36.58.948822@gsundbrunn.de...
> Hello,
>
> first of all - let me introduce myself. I am a german ColdFusion developer
> since 1997. I watched the development of Asp.net for a few years and now,
> with the beta of 2.0 I would like to learn this language.
>
> I´ve tested certain record viewer components pretty successfully - but
> a few things I cannot solve - even google didn´t show me the
> information I was looking fo (maybe I just cannot find them as I don´t
> kjnow exactly what I am looking for)
>
> Please let me know if this is not the correct group.
>
> My code is:
>
> <form runat="server">
> <asp:detailsview runat="server" id="detailView"
> datasourceid="testDB" allowpaging="true" headertext="Fischarten"
> datakeynames="ftbFischArtId" autogenerateeditbutton="true"
> autogeneratedeletebutton="true" autogenerateinsertbutton="true"
> GridLines="both" width="250px"
> BorderWidth="1" BorderColor="Black" cellpadding="2">
>
> <headerstyle  Font-Name="arial"
> Font-Size="9pt"
> Font-Bold="false"
> ForeColor="black"
> BackColor="#f55405" />
> <rowstyle  Font-Name="arial"
> Font-Size="9pt"
> Font-Bold="false"
> ForeColor="black"
> BackColor="white"/>
> <editrowstyle  Font-Name="arial"
> Font-Size="9pt"
> Font-Bold="false"
> ForeColor="black"
> BackColor="#D4D0C8"/>
> <pagerstyle BackColor="#D4D0C8"
> horizontalalign="left" />
> <pagersettings firstpageimageurl="images/left_all.jpg"
> lastpageimageurl="images/right_all.jpg"
> nextpageimageurl="images/right.jpg"
> previouspageimageurl="images/left.jpg"
> mode="NextPreviousFirstLast" />
> </asp:detailsview>
> </form>
>
> Works pretty fine - except the layout. And this are my questions:
>
> How can I set borders to header and pager (including the color)?
> How can I change the color of the gridlines? They always gray -
> independend on what I do.
> How can I change the width of a cell? Maybe the left cell of all rows. And
> how to change the color of them?
>
> Any hint is appreciated. Thanks in advance!
>
> Stefan
>
> --
> Stefan Gsundbrunn
> Project Design - Software Design - Brain Design
> http://www.gsundbrunn.de
> New: http://www.fangtagebuch.de
>
Author
14 Mar 2005 4:26 PM
Stefan Gsundbrunn
Looks really good for me - thanks a lot! I will check and find out.

Best regards

Stefan
Author
18 Mar 2005 1:32 PM
Brock Allen
The DetailsView has it's own predefined layout. If you want more control
look into the <asp:FormView>. It's the same idea, except you provide your
own template for the entire layout. When databinding, don't use the <%# Eval
%> syntax, instead be sure to use the <%# Bind %> syntax so your posted changes
will be sent back to your DataSource control.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> Hello,
>
> first of all - let me introduce myself. I am a german ColdFusion
> developer since 1997. I watched the development of Asp.net for a few
> years and now, with the beta of 2.0 I would like to learn this
> language.
>
> I´ve tested certain record viewer components pretty successfully - but
> a few things I cannot solve - even google didn´t show me the
> information I was looking fo (maybe I just cannot find them as I don´t
> kjnow exactly what I am looking for)
>
> Please let me know if this is not the correct group.
>
> My code is:
>
> <form runat="server">
> <asp:detailsview runat="server" id="detailView"
> datasourceid="testDB" allowpaging="true" headertext="Fischarten"
> datakeynames="ftbFischArtId" autogenerateeditbutton="true"
> autogeneratedeletebutton="true"    autogenerateinsertbutton="true"
> GridLines="both" width="250px"
> BorderWidth="1"    BorderColor="Black" cellpadding="2">
> <headerstyle      Font-Name="arial"
> Font-Size="9pt"
> Font-Bold="false"
> ForeColor="black"
> BackColor="#f55405" />
> <rowstyle      Font-Name="arial"
> Font-Size="9pt"
> Font-Bold="false"
> ForeColor="black"
> BackColor="white"/>
> <editrowstyle      Font-Name="arial"
> Font-Size="9pt"
> Font-Bold="false"
> ForeColor="black"
> BackColor="#D4D0C8"/>
> <pagerstyle     BackColor="#D4D0C8"
> horizontalalign="left" />
> <pagersettings     firstpageimageurl="images/left_all.jpg"
> lastpageimageurl="images/right_all.jpg"
> nextpageimageurl="images/right.jpg"
> previouspageimageurl="images/left.jpg"
> mode="NextPreviousFirstLast" />
> </asp:detailsview>
> </form>
>
> Works pretty fine - except the layout. And this are my questions:
>
> How can I set borders to header and pager (including the color)?
> How can I change the color of the gridlines? They always gray -
> independend on what I do.
> How can I change the width of a cell? Maybe the left cell of all rows.
> And
> how to change the color of them?
> Any hint is appreciated. Thanks in advance!
>
> Stefan
>
> --
> Stefan Gsundbrunn
> Project Design - Software Design - Brain Design
> http://www.gsundbrunn.de
> New: http://www.fangtagebuch.de
Author
18 Mar 2005 5:52 PM
Stefan Gsundbrunn
Hi Brock,


> The DetailsView has it's own predefined layout. If you want more control
> look into the <asp:FormView>. It's the same idea, except you provide your

I quickly checked - looks really good for me. I will test this weekend.

Thanks!

--
Stefan Gsundbrunn
Project Design - Software Design - Brain Design
http://www.gsundbrunn.de
Cell: +49.173.3426906
New: http://www.fangtagebuch.de