Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help Datagrid always displayed as disabled

Reply
Thread Tools

Help Datagrid always displayed as disabled

 
 
brian richards
Guest
Posts: n/a
 
      09-03-2003
The datagrid in my page always looks greyed out. But DataGrid.Enabled is set
to true. It's never set to false. Is there any other way enabled may be set
to false? Or maybe another reason other than the Enabled property that would
cause this?

I've included the asp.net code and the C# databind code.

Thanks


///C# Bind code
public void BindGrid()
{
string date = Request["Date"];
if(date!=null && date!="")
{
try
{
this.sqlSelectCommand3.CommandText = "SELECT Date, UsageCharges,
MonthlyCharges, ProratedCharges, "+
"OneTimeCharges, TaxesFSL, OtherTaxesSurcharges, (UsageCharges +
MonthlyCharges + ProratedCharges +"+
"OneTimeCharges + TaxesFSL + OtherTaxesSurcharges) AS Total FROM
tbMonthlyChargeBreakdown WHERE "+
"Date = \'"+DateTime.Parse(date).ToString("yyyyMMdd")+"\'" ;
sqlDataAdapter3.Fill(dsMonthTable1);
dg_ChrgBreakdown.DataBind();
}
catch(Exception e)
{
Response.Write(e.Message+e.Source+e.StackTrace+"\n "+date);
}
}

/////Asp.net code
<aspataGrid id=dg_ChrgBreakdown runat="server" Width="100%"
DataSource="<%# dvMonthTable %>" AutoGenerateColumns="False"
CellPadding="1">
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<HeaderStyle HorizontalAlign="Center" ForeColor="White"
BackColor="#292C8B"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="Date" HeaderText="Date"
DataFormatString="{0:y}">
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="UsageCharges"
HeaderText="UsageCharges"
DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
<asp:BoundColumn DataField="MonthlyCharges"
HeaderText="Monthly"
DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
<asp:BoundColumn DataField="ProratedCharges"
HeaderText="Prorated"
DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
<asp:BoundColumn DataField="OneTimeCharges"
HeaderText="One Time"
DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
<asp:BoundColumn DataField="TaxesFSL"
HeaderText="Taxes" DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
<asp:BoundColumn DataField="OtherTaxesSurcharges"
HeaderText="Surcharges"
DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
<asp:BoundColumn DataField="Total"
HeaderText="Total" DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
</Columns>
</aspataGrid>




 
Reply With Quote
 
 
 
 
Marcos MOS
Guest
Posts: n/a
 
      09-03-2003
Brian,

Have you created the DataGrid's source by Wizard or by "hand code"? I mean
where was the dvMonthTable created?

Because, I bind the data source a little bit different... like

....
sqlDataAdapter3.Fill(dsMonthTable1);
dg_ChrgBreakdown.DataSource = dsMonthTable1.Tables[0].DefaultView;
dg_ChrgBreakdown.DataBind();
....

I hope help you
Marcos


"brian richards" <(E-Mail Removed)> escreveu na mensagem
news:(E-Mail Removed)...
> The datagrid in my page always looks greyed out. But DataGrid.Enabled is

set
> to true. It's never set to false. Is there any other way enabled may be

set
> to false? Or maybe another reason other than the Enabled property that

would
> cause this?
>
> I've included the asp.net code and the C# databind code.
>
> Thanks
>
>
> ///C# Bind code
> public void BindGrid()
> {
> string date = Request["Date"];
> if(date!=null && date!="")
> {
> try
> {
> this.sqlSelectCommand3.CommandText = "SELECT Date,

UsageCharges,
> MonthlyCharges, ProratedCharges, "+
> "OneTimeCharges, TaxesFSL, OtherTaxesSurcharges, (UsageCharges

+
> MonthlyCharges + ProratedCharges +"+
> "OneTimeCharges + TaxesFSL + OtherTaxesSurcharges) AS Total

FROM
> tbMonthlyChargeBreakdown WHERE "+
> "Date = \'"+DateTime.Parse(date).ToString("yyyyMMdd")+"\'" ;
> sqlDataAdapter3.Fill(dsMonthTable1);
> dg_ChrgBreakdown.DataBind();
> }
> catch(Exception e)
> {
> Response.Write(e.Message+e.Source+e.StackTrace+"\n "+date);
> }
> }
>
> /////Asp.net code
> <aspataGrid id=dg_ChrgBreakdown runat="server" Width="100%"
> DataSource="<%# dvMonthTable %>" AutoGenerateColumns="False"
> CellPadding="1">
> <ItemStyle HorizontalAlign="Right"></ItemStyle>
> <HeaderStyle HorizontalAlign="Center"

ForeColor="White"
> BackColor="#292C8B"></HeaderStyle>
> <Columns>
> <asp:BoundColumn DataField="Date"

HeaderText="Date"
> DataFormatString="{0:y}">
> <ItemStyle HorizontalAlign="Left"></ItemStyle>
> </asp:BoundColumn>
> <asp:BoundColumn DataField="UsageCharges"
> HeaderText="UsageCharges"
> DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
> <asp:BoundColumn DataField="MonthlyCharges"
> HeaderText="Monthly"
> DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
> <asp:BoundColumn DataField="ProratedCharges"
> HeaderText="Prorated"
> DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
> <asp:BoundColumn DataField="OneTimeCharges"
> HeaderText="One Time"
> DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
> <asp:BoundColumn DataField="TaxesFSL"
> HeaderText="Taxes"

DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
> <asp:BoundColumn DataField="OtherTaxesSurcharges"
> HeaderText="Surcharges"
> DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
> <asp:BoundColumn DataField="Total"
> HeaderText="Total"

DataFormatString="{0:$###,###,###.00}"></asp:BoundColumn>
> </Columns>
> </aspataGrid>
>
>
>
>



 
Reply With Quote
 
 
 
 
brian richards
Guest
Posts: n/a
 
      09-03-2003
The datasource was set in the ASP page.
<aspataGrid id=dg_ChrgBreakdown runat="server" Width="100%"
DataSource="<%# dvMonthTable %>" AutoGenerateColumns="False"
CellPadding="1">
I tried
sqlDataAdapter3.Fill(dsMonthTable1);
dg_ChrgBreakdown.DataSource = dsMonthTable1.Tables[0].DefaultView;
dg_ChrgBreakdown.DataBind();
and
sqlDataAdapter3.Fill(dsMonthTable1);
dg_ChrgBreakdown.DataSource = dvMonthTable;
dg_ChrgBreakdown.DataBind();
and
sqlDataAdapter3.Fill(dsMonthTable1);
dvMonthTable.Table = dsMonthTable1.Tables[0];
dg_ChrgBreakdown.DataSource = dvMonthTable;
dg_ChrgBreakdown.DataBind();

But I get the same gray results.

-Brian


"Marcos MOS" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Brian,
>
> Have you created the DataGrid's source by Wizard or by "hand code"? I mean
> where was the dvMonthTable created?
>
> Because, I bind the data source a little bit different... like
>
> ...
> sqlDataAdapter3.Fill(dsMonthTable1);
> dg_ChrgBreakdown.DataSource = dsMonthTable1.Tables[0].DefaultView;
> dg_ChrgBreakdown.DataBind();
> ...
>
> I hope help you
> Marcos
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Japanese Text not displayed on Image Generated by Servlet on winXP, Linux but displayed on Win2000 boney Java 1 12-15-2006 02:24 PM
Zero Wireless Config Service always disabled after logoff scott.phillips@drake.edu Wireless Networking 4 11-02-2005 04:41 PM
Ensure selected treeview node is always displayed? Dot net work ASP .Net 0 06-27-2004 03:30 PM
Ensure selected treeview node is always displayed? Dot net work ASP .Net Web Controls 0 06-15-2004 04:37 PM
Custom paging problems - first page always displayed Oleg Ogurok ASP .Net Datagrid Control 0 07-08-2003 09:10 PM



Advertisments