Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
760
Webhierarchial datagird - Parent row /column name is not refreshing based on criteria
posted

I have a webhierarchial data grid. I'm loading the grid on page load. But the criteria based(cost/hous) loading of parent row is getting loaded on the first time. When i set default as Cost/ hours in aspx. When I change the criteria and click refresh the parent row is not pulling based on the criteria/ it is not refreshing. But when I tried to view the child row, it is getting the matched criteria. The parent row is still cost based but the child row is hours based. I'm also trying to manipuating the column names also, but that is also not working based on the criteria. I have tried ClearTemplates, refreshbehaviors but nothing seems to help.

 

<

asp:UpdatePanel ID="UpdatePanel1" runat

="server">

<ContentTemplate>

<ig:WebHierarchicalDataGrid ID="hdgResourceAllocation" runat="server" Height="400px"

Width="100%" AutoGenerateColumns="false" AutoGenerateBands="false" DataKeyFields="RowId"

InitialDataBindDepth="0" EnableDataViewState="false" EnableAjaxViewState="false" >

<ClientEvents Initialize="showToolTip" />

<Columns>

<ig:BoundDataField DataFieldName="RowId" Key="RowId" Hidden="true" />

<ig:BoundDataField DataFieldName="ResourceName" Key="ResourceName" Header-Text="Resource Name"

Width="150" />

<ig:BoundDataField DataFieldName="ProjectName" Key="ProjectName" Header-Text="Project Name"

Width="150" />

<ig:BoundDataField DataFieldName="ForecastMonth" Key="ForecastMonth" Header-Text="Forecast Month"

Width="70" />

<ig:BoundDataField DataFieldName="RowTotalHours1" Key="RowTotalHours1"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours2" Key="RowTotalHours2"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours3" Key="RowTotalHours3"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours4" Key="RowTotalHours4"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours5" Key="RowTotalHours5"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours6" Key="RowTotalHours6"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours7" Key="RowTotalHours7"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours8" Key="RowTotalHours8"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours9" Key="RowTotalHours9"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours10" Key="RowTotalHours10"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours11" Key="RowTotalHours11"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours12" Key="RowTotalHours12"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours13" Key="RowTotalHours13"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge1" Key="RowTotalCharge1"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge2" Key="RowTotalCharge2"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge3" Key="RowTotalCharge3"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge4" Key="RowTotalCharge4"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge5" Key="RowTotalCharge5"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge6" Key="RowTotalCharge6"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge7" Key="RowTotalCharge7"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge8" Key="RowTotalCharge8"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge9" Key="RowTotalCharge9"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge10" Key="RowTotalCharge10"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge11" Key="RowTotalCharge11"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge12" Key="RowTotalCharge12"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge13" Key="RowTotalCharge13"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="ForecastStatus" Key="ForecastStatus" Header-Text="Forecast Status"

Width="100" />

<ig:BoundDataField DataFieldName="ProjectForecaster" Key="ProjectForecaster" Header-Text="Forecaster"

Width="90" />

<ig:BoundDataField DataFieldName="ProjectTechnologyPM" Key="ProjectTechnologyPM"

Header-Text="Technology PM" Width="90" />

</Columns>

<EmptyRowsTemplate>

<b>No records were found.</b>

</EmptyRowsTemplate>

<Bands>

<ig:Band AutoGenerateColumns="false" DataMember="SubRows" Key="SubRowId" DataKeyFields="SubRowId" ShowHeader="false">

<Columns>

<ig:BoundDataField DataFieldName="SubRowId" Key="SubRowId" Hidden="true" />

<ig:BoundDataField DataFieldName="ProjectNumber" Key="ProjectNumber" Header-Text="Project Number"

Width="125" />

<ig:BoundDataField DataFieldName="ProjectName" Key="ProjectName" Header-Text="Project Name"

Width="150" />

<ig:BoundDataField DataFieldName="ForecastMonth" Key="ForecastMonth" Header-Text="Forecast Month"

Width="70" />

<ig:BoundDataField DataFieldName="RowTotalHours1" Key="RowTotalHours1"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours2" Key="RowTotalHours2"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours3" Key="RowTotalHours3"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours4" Key="RowTotalHours4"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours5" Key="RowTotalHours5"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours6" Key="RowTotalHours6"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours7" Key="RowTotalHours7"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours8" Key="RowTotalHours8"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours9" Key="RowTotalHours9"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours10" Key="RowTotalHours10"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours11" Key="RowTotalHours11"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours12" Key="RowTotalHours12"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalHours13" Key="RowTotalHours13"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge1" Key="RowTotalCharge1"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge2" Key="RowTotalCharge2"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge3" Key="RowTotalCharge3"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge4" Key="RowTotalCharge4"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge5" Key="RowTotalCharge5"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge6" Key="RowTotalCharge6"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge7" Key="RowTotalCharge7"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge8" Key="RowTotalCharge8"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge9" Key="RowTotalCharge9"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge10" Key="RowTotalCharge10"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge11" Key="RowTotalCharge11"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge12" Key="RowTotalCharge12"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="RowTotalCharge13" Key="RowTotalCharge13"

DataFormatString="{0:N2}" Width="100" Header-CssClass="HeaderRight" CssClass="AlignRight" />

<ig:BoundDataField DataFieldName="ForecastStatus" Key="ForecastStatus" Header-Text="Forecast Status"

Width="100" />

<ig:BoundDataField DataFieldName="ProjectForecaster" Key="ProjectForecaster" Header-Text="Forecaster"

Width="90" />

<ig:BoundDataField DataFieldName="ProjectTechnologyPM" Key="ProjectTechnologyPM"

Header-Text="Technology PM" Width="90" />

</Columns>

</ig:Band>

</Bands>

<Behaviors>

<ig:Sorting Enabled="false" SortingMode="Single" />

<ig:Selection CellClickAction="Row" RowSelectType="Single" CellSelectType="None" />

</Behaviors>

</ig:WebHierarchicalDataGrid>

</ContentTemplate>

</asp:UpdatePanel>

 

protected

override void Page_Load(object sender, EventArgse)

{

if(!IsPostBack)

{

base.Page_Load(sender, e);

txtLraVariance.Text =

"5";

ViewState[

"ActiveForecast"]=UserSession.ActiveForecastId;

}

PopulateResourceAllocation();

}

private void PopulateResourceAllocation()

{

List<ForecastResourceAllocation> obj = new List<ForecastResourceAllocation>();

obj=

ForecastBusinessTier.GetForecastResourceAllocation(Convert.ToInt64(UserSession.ActiveForecastId));

if(obj.Count>0)

{

hdgResourceAllocation.RefreshBehaviors();

SetResourceAllocationColumnHeaders();

HideResourceAllocationColumns();

hdgResourceAllocation.DataSource = obj;

hdgResourceAllocation.DataBind();

}

}

protected void SetResourceAllocationColumnHeaders()

{

//hide hours/cost columns based on the selection

// Change column header month values based on the selected forecast month

// Forecast forecast = (Forecast)ViewState["ActiveForecast"];

int colStart = 4;

DateTime datCounter = Convert.ToDateTime("12/01/2012");

if (colStart > 0)

{

int j = 1;

for (int i = colStart; i < this.hdgResourceAllocation.Columns.Count - 3; i++)

{

if (radForecastCost.Checked)

{

if (i <= 16)

{

hdgResourceAllocation.Columns[i].Hidden =

true;

hdgResourceAllocation.Bands[0].Columns[i].Hidden =

true;

}

else

{

hdgResourceAllocation.Columns[i].Hidden =

false;

hdgResourceAllocation.Bands[0].Columns[i].Hidden =

false;

}

if (j <= 13 && !hdgResourceAllocation.Columns[i].Hidden)//fiscalyear in months

{

string temp = datCounter.ToString("MMM yyyy");

hdgResourceAllocation.Columns[i].Header.Text = temp;

hdgResourceAllocation.Bands[0].Columns[i].Header.Text = temp;

datCounter = datCounter.AddMonths(1);

j++;

}

}

else

{

if (i > 16 && i < 30)

{

hdgResourceAllocation.Columns[i].Hidden =

true;

hdgResourceAllocation.Bands[0].Columns[i].Hidden =

true;

}

else

{

hdgResourceAllocation.Columns[i].Hidden =

false;

hdgResourceAllocation.Bands[0].Columns[i].Hidden =

false;

}

if (j <= 13 && !hdgResourceAllocation.Columns[i].Hidden)//fiscalyear in months

{

string temp = datCounter.ToString("dd MMM yyyy");

hdgResourceAllocation.Columns[i].Header.Text = temp;

hdgResourceAllocation.Bands[0].Columns[i].Header.Text = temp;

datCounter = datCounter.AddMonths(1);

j++;

}

}

}

}

//forecast = null;

}

protected

voidHideResourceAllocationColumns()

{

// hide columns for months that occur before the forecast month being displayed

for (int i = 4; i < this.hdgResourceAllocation.Columns.Count - 2; i++)

{

DateTime datTemp;

if (DateTime.TryParse(hdgResourceAllocation.Columns[i].Header.Text, out datTemp))

{

if (datTemp < UserSession.ActiveForecastDate)

{

hdgResourceAllocation.Columns[i].Hidden =

true;

hdgResourceAllocation.Bands[0].Columns[i].Hidden =

true;

}

}

}

}

protected void btnLraRefresh_Click(object sender, EventArgs e)

{

hdgResourceAllocation.RefreshBehaviors();

PopulateResourceAllocation();

}

 

Parents Reply Children
No Data