PDA

View Full Version : DataGrid Problem still after 2 days. Help me


27lamps
01-26-2004, 04:22 AM
Hello,

i am trying to create a DataGrid with:
1. No Heading and No Footer
2. With Custom next and previous text
3. With all items text using the "smallGreyText" .css style
4. With no lines, borders or anything like that

Anyway, until now i am not able to apply the .css and i also get some lines around and beetween the items. Please help me because i don't know what else to change or try.

Thank You,
Miguel

The code i have now is this:

</table>
<table width="265" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form runat="server">
<asp:DataGrid id="dataGridFaq"
runat="server"
CssClass="smallGreyText"
AllowSorting="false"
AutoGenerateColumns="false"
CellPadding="0"
CellSpacing="0"
ShowFooter="false"
ShowHeader="false"
DataSource="<%# dataSetFaq.DefaultView %>"
PagerStyle-Mode="NextPrev"
AllowPaging="true"
AllowCustomPaging="true"
PageSize="<%# dataSetFaq.PageSize %>"
VirtualItemCount="<%# dataSetFaq.RecordCount %>"
OnPageIndexChanged="dataSetFaq.OnDataGridPageIndexChanged"
>
<HeaderStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<ItemStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<AlternatingItemStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<FooterStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<PagerStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<Columns>
<asp:HyperLinkColumn
HeaderText="Question"
Visible="True"
DataTextField="Question"
DataNavigateUrlField="FaqID"
DataNavigateUrlFormatString="faq-detail.aspx?Link={0}"/>
</Columns>
</asp:DataGrid>
</form></td>
</tr>
</table>

Cheers,
Miguel

.web: http://www.27lamps.com
.email: internet@27lamps.com

bruce
01-26-2004, 11:58 AM
I am not too good w/ datagrid.

I would check out this site, http://datagridgirl.com/

[b]quote:Originally posted by 27lamps

Hello,

i am trying to create a DataGrid with:
1. No Heading and No Footer
2. With Custom next and previous text
3. With all items text using the "smallGreyText" .css style
4. With no lines, borders or anything like that

Anyway, until now i am not able to apply the .css and i also get some lines around and beetween the items. Please help me because i don't know what else to change or try.

Thank You,
Miguel

The code i have now is this:

</table>
<table width="265" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form runat="server">
<asp:DataGrid id="dataGridFaq"
runat="server"
CssClass="smallGreyText"
AllowSorting="false"
AutoGenerateColumns="false"
CellPadding="0"
CellSpacing="0"
ShowFooter="false"
ShowHeader="false"
DataSource="<%# dataSetFaq.DefaultView %>"
PagerStyle-Mode="NextPrev"
AllowPaging="true"
AllowCustomPaging="true"
PageSize="<%# dataSetFaq.PageSize %>"
VirtualItemCount="<%# dataSetFaq.RecordCount %>"
OnPageIndexChanged="dataSetFaq.OnDataGridPageIndexChanged"
>
<HeaderStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<ItemStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<AlternatingItemStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<FooterStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<PagerStyle BackColor="white" BorderWidth="0" CssClass="smallGreyText" />
<Columns>
<asp:HyperLinkColumn
HeaderText="Question"
Visible="True"
DataTextField="Question"
DataNavigateUrlField="FaqID"
DataNavigateUrlFormatString="faq-detail.aspx?Link={0}"/>
</Columns>
</asp:DataGrid>
</form></td>
</tr>
</table>

Cheers,
Miguel

.web: http://www.27lamps.com
.email: internet@27lamps.com
</blockquote id="quote"></font id="quote">

msword
02-03-2004, 07:31 AM
here is a copy of a piece of my datagrid
I had this problem too. You cant apply the style in the actual <Asp:datagrid tag. You have to apply your style to each element. like this:
<Columns>
<asp:BoundColumn DataField="username" ItemStyle-cssClass="tiny"/>
<asp:BoundColumn DataField="topic" HeaderText="topic" HeaderStyle-CssClass="tiny" ItemStyle-CssClass="tiny"/>
</Columns>

Hope that helps. If it doesnt work for you then just use a datarepeater.