UltraGrid 정렬, 필터하기
dgList1는 UltraWinGrid로, LemBand은 자체컨트롤임. 거의 Band와 비슷할듯.

기존 정렬을 필터가 적용안되어 숨김인덱스를 찾아 처리하였는데,

이것은 필터도 포함이니 숨김인덱스 찾을 필요없음.

 

//정렬수, 필터수를 가져온다.(필터는 전체를 가져옴)
int iSortedColumnsCount = this.dgList1.LemBand.SortedColumns.Count;
int iColumnFiltersCount = this.dgList1.LemBand.ColumnFilters.Count;

////정렬명, 정렬방식을 넣어줌. 정렬용 임시배열
string[,] strDivSrot = new string[iSortedColumnsCount, 2];

for(int j=0;j<iSortedColumnsCount;j++)
{
 strDivSrot[j, 0] = this.dgList1.LemBand.SortedColumns.GetItem(j).ToString();
 strDivSrot[j, 1] = this.dgList1.LemBand.SortedColumns[j].SortIndicator.ToString();
}

//필터용 필터,필터세부내용,필터연산자등 필터용 임시배열
ColumnFilter[] cfDivFilt = new ColumnFilter[iColumnFiltersCount];
FilterConditionsCollection[] fcDivFilt = new FilterConditionsCollection[iColumnFiltersCount];
Infragistics.Win.UltraWinGrid.FilterLogicalOperator[] loDivFilt = new Infragistics.Win.UltraWinGrid.FilterLogicalOperator[iColumnFiltersCount];

for (int k = 0; k < iColumnFiltersCount; k++)
{
 cfDivFilt[k] = this.dgList1.LemBand.ColumnFilters[k];
 fcDivFilt[k] = this.dgList1.LemBand.ColumnFilters[k].FilterConditions;
 loDivFilt[k] = this.dgList1.LemBand.ColumnFilters[k].LogicalOperator;
}

.........

//정렬배열이 있으면
if (strDivSrot.Length > 0)
{
 //배열이 [X,2]이므로 2로 나누어
 for (int j = 0; j < strDivSrot.Length / 2; j++)
 {
  //Descending이면 true로 필터 추가
  this.dgList1.LemBand.SortedColumns.Add(strDivSrot[j, 0], "Descending".Equals(strDivSrot[j, 1]));
 }
}

//필터배열이 있으면
if (cfDivFilt.Length > 0)
{
 for (int m = 0; m < cfDivFilt.Length; m++)
 {
  //필터세부내역이 있으면
  if (fcDivFilt[m].Count > 0)
  {
   //혹시모를 키가 변경될수 있으므로 for로 키값확인.
   for (int n = 0; n < this.dgList1.LemBand.ColumnFilters.Count; n++)
   {
    if (this.dgList1.LemBand.ColumnFilters[n].Key.Equals(cfDivFilt[m].Key))
    {
     //먼서 필터연산자먼저(All(AND), Any(OR))
     this.dgList1.LemBand.ColumnFilters[n].LogicalOperator = loDivFilt[m];

     foreach (FilterCondition fcNeo in fcDivFilt[m])
     {
      //세부내역을 넣어줌.
      this.dgList1.LemBand.ColumnFilters[n].FilterConditions.Add(fcNeo);
     }
    }
   }
  }
 }
}

Posted by 말없제이
,

//별도 UltraGrid내 LemControl 사용하는 프레임워크라.. Lem~~ 로시작하는건 지우고 알아서 바꾸면 됩니다.

//UltraGrid Filter Sort
//자체적으로 지원하는 필터, 정렬를 적용후 그값 가져오기.
//UltraGrid.Rows[X].VisibleIndex 값이 -1이아니면 필터에서 보여주는 순서 (이것찾는데 하루 보냈음 - -) IsFilterRow에 사기당함 ㅋㅋ

//필터적용.
//this.dgList1.LemBand.Layout.Override.AllowRowFiltering = DefaultableBoolean.True;

//원본데이터 구조 복사
DataTable dtRef = this.dgList1.LemDataSource.Clone();

//그리드에서 자체적으로 만든 "번호"컬럼은 제외하고 넘기기.
//오류발생으로 참거짓 처리값 밖으로 변경후 삭제
bool isRemovingCol = false;
foreach (DataColumn dc in dtRef.Columns)
{
 if ("번호".Equals(dc.ColumnName))
 {
  isRemovingCol = true;
  break;
 }
}

//번호컬럼 삭제
if (isRemovingCol) dtRef.Columns.Remove("번호");

//필터링이 안되어있는지 확인값 (총갯수 == 필터링갯수)
bool isNoneFiltering = (this.dgList1.LemGrid.Rows.Count == this.dgList1.LemGrid.Rows.FilteredInRowCount);

for (int i = 0; i < this.dgList1.LemGrid.Rows.Count; i++)
{
 if (isNoneFiltering)
 {
  //데이터 소스로 들어가면 정렬안된값이 들어가므로 다시 넣어줌.
  dtRef.Rows.Add(this.dgList1.LemGetColumnColection(i));
 }
 else
 {
  //필터링되어 보여질 인덱스 0이상, 없으면 -1
  if (this.dgList1.LemGrid.Rows[i].VisibleIndex >= 0)
  {
   dtRef.Rows.Add(this.dgList1.LemGetColumnColection(i));
  }
 }
}

Posted by 말없제이
,

구글에서 찾은 내용임.

DateTime.ToString() Patterns
All the patterns:
0 MM/dd/yyyy 08/22/2006 
1 dddd, dd MMMM yyyy Tuesday, 22 August 2006 
2 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30 
3 dddd, dd MMMM yyyy hh:mm tt Tuesday, 22 August 2006 06:30 AM 
4 dddd, dd MMMM yyyy H:mm Tuesday, 22 August 2006 6:30 
5 dddd, dd MMMM yyyy h:mm tt Tuesday, 22 August 2006 6:30 AM 
6 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07 
7 MM/dd/yyyy HH:mm 08/22/2006 06:30 
8 MM/dd/yyyy hh:mm tt 08/22/2006 06:30 AM 
9 MM/dd/yyyy H:mm 08/22/2006 6:30 
10 MM/dd/yyyy h:mm tt 08/22/2006 6:30 AM 
10 MM/dd/yyyy h:mm tt 08/22/2006 6:30 AM 
10 MM/dd/yyyy h:mm tt 08/22/2006 6:30 AM 
11 MM/dd/yyyy HH:mm:ss 08/22/2006 06:30:07
12 MMMM dd August 22 
13 MMMM dd August 22 
14 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2006-08-22T06:30:07.7199222-04:00 
15 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2006-08-22T06:30:07.7199222-04:00 
16 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Tue, 22 Aug 2006 06:30:07 GMT 
17 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Tue, 22 Aug 2006 06:30:07 GMT 
18 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2006-08-22T06:30:07 
19 HH:mm 06:30 
20 hh:mm tt 06:30 AM 
21 H:mm 6:30 
22 h:mm tt 6:30 AM 
23 HH:mm:ss 06:30:07 
24 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2006-08-22 06:30:07Z 
25 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07 
26 yyyy MMMM 2006 August 
27 yyyy MMMM 2006 August 

The patterns for DateTime.ToString ( 'd' ) :
0 MM/dd/yyyy 08/22/2006 

The patterns for DateTime.ToString ( 'D' ) :
0 dddd, dd MMMM yyyy Tuesday, 22 August 2006 

The patterns for DateTime.ToString ( 'f' ) :
0 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30 
1 dddd, dd MMMM yyyy hh:mm tt Tuesday, 22 August 2006 06:30 AM 
2 dddd, dd MMMM yyyy H:mm Tuesday, 22 August 2006 6:30 
3 dddd, dd MMMM yyyy h:mm tt Tuesday, 22 August 2006 6:30 AM 

The patterns for DateTime.ToString ( 'F' ) :
0 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07 

The patterns for DateTime.ToString ( 'g' ) :
0 MM/dd/yyyy HH:mm 08/22/2006 06:30 
1 MM/dd/yyyy hh:mm tt 08/22/2006 06:30 AM 
2 MM/dd/yyyy H:mm 08/22/2006 6:30 
3 MM/dd/yyyy h:mm tt 08/22/2006 6:30 AM 

The patterns for DateTime.ToString ( 'G' ) :
0 MM/dd/yyyy HH:mm:ss 08/22/2006 06:30:07 

The patterns for DateTime.ToString ( 'm' ) :
0 MMMM dd August 22 

The patterns for DateTime.ToString ( 'r' ) :
0 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Tue, 22 Aug 2006 06:30:07 GMT 

The patterns for DateTime.ToString ( 's' ) :
0 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2006-08-22T06:30:07 

The patterns for DateTime.ToString ( 'u' ) :
0 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2006-08-22 06:30:07Z 

The patterns for DateTime.ToString ( 'U' ) :
0 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07 

The patterns for DateTime.ToString ( 'y' ) :
0 yyyy MMMM 2006 August 

Building a custom DateTime.ToString Patterns
The following details the meaning of each pattern character. Note the K and z character.

d Represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero
dd Represents the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero
ddd Represents the abbreviated name of the day of the week (Mon, Tues, Wed etc)
dddd Represents the full name of the day of the week (Monday, Tuesday etc)
h 12-hour clock hour (e.g. 7)
hh 12-hour clock, with a leading 0 (e.g. 07)
H 24-hour clock hour (e.g. 19)
HH 24-hour clock hour, with a leading 0 (e.g. 19)
m Minutes
mm Minutes with a leading zero
M Month number
MM Month number with leading zero
MMM Abbreviated Month Name (e.g. Dec)
MMMM Full month name (e.g. December)
s Seconds
ss Seconds with leading zero
t Abbreviated AM / PM (e.g. A or P)
tt AM / PM (e.g. AM or PM
y Year, no leading zero (e.g. 2001 would be 1)
yy Year, leadin zero (e.g. 2001 would be 01)
yyy Year, (e.g. 2001 would be 2001)
yyyy Year, (e.g. 2001 would be 2001)
K Represents the time zone information of a date and time value (e.g. +05:00)
z With DateTime values, represents the signed offset of the local operating system's time zone from Coordinated Universal Time (UTC), measured in hours. (e.g. +6)
zz As z but with leadin zero (e.g. +06)
zzz With DateTime values, represents the signed offset of the local operating system's time zone from UTC, measured in hours and minutes. (e.g. +06:00)
f Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value. 
ff Represents the two most significant digits of the seconds fraction; that is, it represents the hundredths of a second in a date and time value.
fff Represents the three most significant digits of the seconds fraction; that is, it represents the milliseconds in a date and time value.
ffff Represents the four most significant digits of the seconds fraction; that is, it represents the ten thousandths of a second in a date and time value. While it is possible to display the ten thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds. 
fffff Represents the five most significant digits of the seconds fraction; that is, it represents the hundred thousandths of a second in a date and time value. While it is possible to display the hundred thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds. 
ffffff Represents the six most significant digits of the seconds fraction; that is, it represents the millionths of a second in a date and time value. While it is possible to display the millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds. 
fffffff Represents the seven most significant digits of the seconds fraction; that is, it represents the ten millionths of a second in a date and time value. While it is possible to display the ten millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds. 
F Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value. Nothing is displayed if the digit is zero. 
: Represents the time separator defined in the current DateTimeFormatInfo..::.TimeSeparator property. This separator is used to differentiate hours, minutes, and seconds. 
/  Represents the date separator defined in the current DateTimeFormatInfo..::.DateSeparator property. This separator is used to differentiate years, months, and days. 
"  Represents a quoted string (quotation mark). Displays the literal value of any string between two quotation marks ("). Your application should precede each quotation mark with an escape character (\). 
' Represents a quoted string (apostrophe). Displays the literal value of any string between two apostrophe (') characters. 
%c  Represents the result associated with a c custom format specifier, when the custom date and time format string consists solely of that custom format specifier. That is, to use the d, f, F, h, m, s, t, y, z, H, or M custom format specifier by itself, the application should specify %d, %f, %F, %h, %m, %s, %t, %y, %z, %H, or %M. For more information about using a single format specifier, see Using Single Custom Format Specifiers

Posted by 말없제이
,

// 테이블 전체 복사후 행지움.
DataTable dtFrch = dtClone.Copy();
dtFrch.Clear();

foreach (DataRow drFrch in dtClone.Select("", strSortWord))
{
 //DataRow drRow = dtFrch.NewRow();
 //drRow.ItemArray = (object[])drFrch.ItemArray.Clone();
 //dtFrch.Rows.Add(drRow);

 dtFrch.ImportRow(drFrch);
}
===================================
// 중복체크 : 해당컬럼 중복제거후, 해당열의 갯수 확인
//row 갯수를 구할 기준이되는 컬럼명을 대상으로 중복제거
DataTable distinctTable = this.dgSortCol.LemDataSource.DefaultView.ToTable(true, "SortColName"); 

foreach (DataRow dRow in distinctTable.Rows)
{
 string strWhere = dRow["SortColName"].ToString();
 DataRow[] arRow = this.dgSortCol.LemDataSource.Select(" SortColName= '" + strWhere + "'");

 if (arRow.Length > 1)
 {
  IB.Framework.Win.Forms.MsgBox.Show(string.Format("{0}은 중복 정렬되어있으니, 중복을 제거해 주십시오.", strWhere));
  return false;
 }
}

Posted by 말없제이
,

갑자기 생각대로 정규식이 안될때가 있었음.

// (시작하고 중간에 -가 있고 )로 끝나는 정규식 확인.
string strPattern = "^\\(.*[\\-].*\\)$";
if (System.Text.RegularExpressions.Regex.IsMatch(dtResult.Columns[i].ColumnName, strPattern)) continue;

Posted by 말없제이
,

VS2010 초기화 : devenv /resetuserdata

Posted by 말없제이
,

솔루션 탐색기에 웹 참조(Web Reference)가 안보일 때

visual studio 2010 기준

솔루션 탐색기에서 프로젝트 명 오른쪽 클릭 > 서비스 참조 추가 > 하단 고급 버튼 클릭

서비스 참조 설정 대화상자 하단 웹 참조 추가 버튼 클릭

로컬 컴퓨터의 웹 서비스 링크 클릭

Service 링크 클릭 > 이 URL에서 찾은 웹 서비스 창에 추가되었는지 확인

오른쪽에 참조 추가 클릭


참조 : http://findfun.tistory.com/entry/%EC%86%94%EB%A3%A8%EC%85%98-%ED%83%90%EC%83%89%EA%B8%B0%EC%97%90-%EC%9B%B9-%EC%B0%B8%EC%A1%B0Web-Reference%EA%B0%80-%EC%95%88%EB%B3%B4%EC%9D%BC-%EB%95%8C

Posted by 말없제이
,

 

Posted by 말없제이
,

pop 으로 띄운 child 가 parent 값을 읽지 못할 때
분류없음 2007/09/05 20:20
opener.document.formName.inputName.value 를 읽어오려는데
에러가 난다.
IE 창을 보니 '액세수가 거부되었습니다' 라는 에러 메시지가 나온다.
(firebug 에서는 uncaught exception: HTMLDocument.formName 1)

30 분 정도면 고칠 수 있을 줄 알았는데 결국 4 시간만에 찾았다.
parent 쪽에서 domain 을 다시 할당하고 있었다.
(

if(document.domain.toString().indexOf("x1test.co.kr") != -1) document.domain="x1test.co.kr"; else document.domain="x1.co.kr";
)
이럴 때는 child 쪽에서도 위 스크립트를 다시 반복해주면 된다.

--> domain 시 현재가 하위단에 있을경우 상위단 도메인을 정의할수 있다.
안되는 경우 1. Localhost로 작업하는데. Daum을 호출할경우 에러.

Posted by 말없제이
,


 <!--
웹사이트 Web.config 파일내에 ..
아래 설정이 되어있어야, DataGrid시 에러발생안함
발생유형 : 500건이상 조회후 재조회시 아래 오류발생
[InvalidOperationException: 개체의 현재 상태 때문에 작업이 유효하지 않습니다.]
   System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2421022

   처리 : MaxHttpCollectionKeys 크기를 10만건으로 수정 (업체 최대시 18,000여건 발생)
-->
<appSettings>
 <!-- 그리드 크기 조절 보통 500건 넘어가면 에러발생으로 크기 조정. 2013.01.02 -->
 <add key="aspnet:MaxHttpCollectionKeys" value="100000" />
</appSettings>

 

Posted by 말없제이
,