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
80
Header.Visibleposition doesn't work well
posted

Hi, I'm a beginner in ultragrid. (sorry, I'm poor at English)

I've referred below two links.

http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1977

http://forums.infragistics.com/forums/p/2834/16564.aspx

 

Some parts of columns are painted well, but the others are not.

I think assignment of position value was processed exactly and I confirmed that values with run time debugger.

I want to know the limitation of Header.Visibleposition to work properly.

I used a column's hidden property,  does this property make a problem?

Here's my code.

int i, colCount, rowCount, j;

bool[] bHidden;

stIndexValue nHeaderVisiblePositions;

long total = 0;

const string comments = "입금통장인자내용";

string[] sTgtColKeys = {"jeogyong_cd2", "yegeumju", "gyejwa_no", "dr_amt", comments};

string[] sTgtHeaders = {"은행코드", "예금주성명", "입금계좌번호", "이체금액", comments};

string[] sSrcHeaders = {"적용코드2", "예금주", "계좌번호", "입금액", comments};

DataTable dt;

DataRow dw;

ArrayList ar;

 

rowCount = ugdList.Rows.Count;

if (rowCount < 1)

return;

 

// allocate array variables for back up

colCount = ugdList.DisplayLayout.Bands[0].Columns.Count;

bHidden = new Boolean[colCount];

ar = new ArrayList(colCount);

 

// back up hidden, ordinal property and force all column hidden

for (i = 0; i < colCount; i++)

{

bHidden[i] = ugdList.DisplayLayout.Bands[0].Columns[i].Hidden;

nHeaderVisiblePositions.idx = i;

nHeaderVisiblePositions.val = ugdList.DisplayLayout.Bands[0].Columns[i].Header.VisiblePosition;

ar.Add(nHeaderVisiblePositions);

ugdList.DisplayLayout.Bands[0].Columns[i].Hidden = true;

}

 

// set up valid column

for (i = 0; i < sTgtColKeys.Length; i++)

{

ugdList.DisplayLayout.Bands[0].Columns[sTgtColKeys[i]].Hidden = false;

ugdList.DisplayLayout.Bands[0].Columns[sTgtColKeys[i]].Header.Caption = sTgtHeaders[i];

ugdList.DisplayLayout.Bands[0].Columns[sTgtColKeys[i]].Header.VisiblePosition = i;

}

 

j = sTgtColKeys.Length;

for (i = 0; i < colCount; i++)

{

if (ugdList.DisplayLayout.Bands[0].Columns[i].Hidden)

ugdList.DisplayLayout.Bands[0].Columns[i].Header.VisiblePosition = j++;

}

 

// export to excel

this.UltraGridToExcel(this.ugdList);

 

// restore the header captions

for (i = 0; i < sTgtColKeys.Length; i++)

{

ugdList.DisplayLayout.Bands[0].Columns[sTgtColKeys[i]].Header.Caption = sSrcHeaders[i];

}

 

// restore hidden, ordinal property

ar.Sort(new IndexValueComparer());

for (i = 0; i < colCount; i++)

{

ugdList.DisplayLayout.Bands[0].Columns[i].Hidden = bHidden[i];

ugdList.DisplayLayout.Bands[0].Columns[((stIndexValue)ar[i]).idx].Header.VisiblePosition = ((stIndexValue)ar[i]).val;

}

...

=========================================================================

Thanks in advance

Parents Reply Children
No Data