Hide columns in ASPxGridView when ASPxSummaryItem is 0

0

Here my code:

<dx:ASPxGridView ID="GridViewID" runat="server" DataSourceID="SourceMain" ClientInstanceName="Grid" SettingsPager-mode="ShowAllRecords" OnHtmlDataCellPrepared="ASPxGridView1_HtmlDataCellPrepared">
 <Columns>
     <dx:GridViewDataTextColumn FieldName="TrackOutDate" VisibleIndex="1" Visible="True"><PropertiesTextEdit DisplayFormatString="MM/dd/yyyy"></PropertiesTextEdit></dx:GridViewDataTextColumn>
     <dx:GridViewDataTextColumn FieldName="LotID" VisibleIndex="2" Visible="True"></dx:GridViewDataTextColumn>
     <dx:GridViewDataTextColumn FieldName="Qty_IN" VisibleIndex="11" Visible="True"></dx:GridViewDataTextColumn>
     <dx:GridViewDataTextColumn FieldName="HX" VisibleIndex="12" Visible="True"></dx:GridViewDataTextColumn>
     <dx:GridViewDataTextColumn FieldName="NA" VisibleIndex="13" Visible="True"></dx:GridViewDataTextColumn>
 </Columns>
    <Settings ShowFooter="true" />
    <TotalSummary> 
    <dx:ASPxSummaryItem FieldName="Qty_IN" SummaryType="Sum" DisplayFormat="{0}" Tag="1" ShowInColumn="Qty_IN"  />
    <dx:ASPxSummaryItem FieldName="HX" SummaryType="Sum" DisplayFormat="{0}"/>
    <dx:ASPxSummaryItem FieldName="NA" SummaryType="Sum" DisplayFormat="{0}"/>
    </TotalSummary>
</dx:ASPxGridView>

C # code: with which I fill the GridView

protected void SourceMain_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
    lote = getLot();
    device = getDevice();
    stage = getStage();
    location = getLocation();
    equipment = getEquipment();
    SD = Convert.ToDateTime(getStartDate());
    ED = Convert.ToDateTime(getEndtDate());



    MetricsPortal.DAL.ReportsDataClassesDataContext dataContext = new MetricsPortal.DAL.ReportsDataClassesDataContext();
    e.Result = (from items in dataContext.CalculateDailyYieldequipmentParam(lote,device,stage,location,equipment,SD,ED,Evaluation())
                orderby items.TrackOutDate ascending, items.GRANDTOTAL1 descending
                select items).Distinct();

}//source Main

The last row that is in 0, how could I hide the whole column when I already made the addition and it gives me 0?

Ex. Qty_IN = 37400 then that would stay like this, but NA is at 0, so it should not appear there, is there any property I can take from the SummaryItem that I can take to evaluate the final value and be able to modify the visibility of the GridViewDataTextColumn?

    
asked by TheLalo 02.03.2018 в 01:52
source

0 answers