B
brian richards
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>
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>