'Study/.net'에 해당되는 글 9건
- 2011/07/12 :: ASP.NET 웹 페이지 간에 값 전달
- 2010/12/28 :: DataGrid에 Cell클릭시 이벤트 발생
- 2010/11/11 :: 버튼 클릭했을때 확인창 띄우기(코드부에서)
- 2010/04/29 :: C# datetime format
- 2010/02/18 :: ExcelWriter Formatting Codes
- 2010/02/16 :: .NET: Error "Couldn't get ObjectContext" when using saOpenInExcel or saOpenInPlace
- 2009/10/29 :: How to add dropdownlist 'VALUE' Dynamically ?
- 2009/03/16 :: DataFormatString
- 2009/03/05 :: Datagrid에서 Column명 변경
코드부에서 아래와 같이 작성해서 구현
for(int i=0; i<DataGrid2.Items.Count; i++)
{
for(int j=1; j<=3; j++)
{
DataGrid2.Items[i].Cells[j].Attributes.Add("onclick","javascript:goDetailPop('"+txtBaseDate1.Text+"','"+txtBaseDate2.Text+"','"+Ds.Tables[0].Rows[i][6].ToString().Trim()+"','');");
DataGrid2.Items[i].Cells[j].Attributes.Add("onmouseover","this.style.cursor='HAND'");
}
}
button1.OnClientClick = "return confirm('삭제하시겠습니까?');";이라고 조회되길래 시도하였으나 .Net Framework 버전이 낮아서 OnclientClick 기능이 없음
그래서 Attribute 추가하여 구현
button1.Attributes.Add("onclick", "return confirm('삭제하시겠습니까?');");
|
|
|
Use the Number property to set the display format of numbers and dates. Number may be a property of the Style object or of Cell.Format. The table below lists predefined formats. You can also define custom formats, for example, a timestamp format:
set TimeStampStyle = XLW.CreateStyle TimeStampStyle.Number = "mm/dd/yyyy hh:mm:ss AM/PM"
| Format.Number Value | Format String |
|---|---|
| 0 | General |
| 1 | 0 |
| 2 | 0.00 |
| 3 | #,##0 |
| 4 | #,##0.00 |
| 5 | ($#,##0_);($#,##0) |
| 6 | ($#,##0_);($#,##0) |
| 7 | ($#,##0.00_);($#,##0.00) |
| 8 | ($#,##0.00_);($#,##0.00) |
| 9 | 0% |
| 10 | 0.00% |
| 11 | 0.00E+00 |
| 12 | # ?/? |
| 13 | # ??/?? |
| 14 | m/d/yy |
| 15 | 0.00% |
| 16 | d-mmm |
| 17 | mmm-yy |
| 18 | h:mm AM/PM |
| 19 | h:mm:ss AM/PM |
| 20 | h:mm |
| 37 | (#,##0_);(#,##0) |
| 38 | (#,##0_);(#,##0) |
| 39 | (#,##0.00_);(#,##0.00) |
| 40 | (#,##0.00_);(#,##0.00) |
| 41 | _(* #,##0_);_(* (#,##0);_(* "-"_);_(@_) |
| 42 | _($* #,##0_);_($* (#,##0);_(* "-"_);_(@_) |
| 43 | _(* #,##0.00_);_(* (#,##0.00);_(* "-"_);_(@_) |
| 44 | _($* #,##0.00_);_($* (#,##0.00);_(* "-"_);_(@_) |
| 45 | mm:ss |
| 46 | [h]:mm:ss |
| 47 | mm:ss.0 |
| 48 | ##0.0E+0 |
| 49 | @ |
| Problem |
When using ExcelWriter within the ASP.NET framework, you may see this error message which occurs upon calling the Save method when using the saOpenInExcel or saOpenInPlace save options:
System.Runtime.InteropServices.COMException (0x80020009): Couldn't get ObjectContext. Please check "Save" method signature at SoftArtisans.ExcelWriter.SAExcelTemplateClass.Process(String FileName, SAProcessMethod ProcessMethod, Int32 ExcludeMacro) |
| Solution |
| The saOpenInExcel and saOpenInPlace options require the internal availability of conventional ASP's Response object. In order to make this object available within the context of ASP.NET pages, you will need to add ASPCompat=True to your Page directive:
<%@ Page ASPCompat="True" %> |
ListItem1.Selected = true;ListItem1.Value = "M";
ListItem1.Text = "Male";
DropDownList1.Items.Add(ListItem1);
열에 있는 항목의 표시 형식을 지정하는 문자열을 가져오거나 설정합니다.
[Visual Basic] Public Overridable Property DataFormatString As String
[C#] public virtual string DataFormatString {get; set;}
[C++] public: __property virtual String* get_DataFormatString(); public: __property virtual void set_DataFormatString(String*);
[JScript] public function get DataFormatString() : String; public function set DataFormatString(String);
속성 값
열에 있는 항목의 표시 형식을 지정하는 형식 지정 문자열입니다. 기본값은 String.Empty입니다.
설명
DataFormatString 속성을 사용하여 열에 있는 항목에 사용자 지정 형식을 제공합니다.
데이터 형식 문자열은 { A: Bxx } 형식처럼 콜론으로 구분된 두 부분으로 구성됩니다. 예를 들어, 형식 지정 문자열 {0:F2}는 소수 자릿수가 두 자리인 고정 소수점 숫자를 표시합니다.
참고 리터럴 문자열이 아니라 형식 문자열임을 나타내려면 전체 문자열을 중괄호로 묶어야 합니다. 중괄호 외부에 있는 텍스트는 모두 리터럴 텍스트로 표시됩니다.
콜론 앞에 오는 값(예: A)은 0부터 시작하는 매개 변수 목록의 매개 변수 인덱스를 지정합니다.
참고 각 셀에 값이 하나만 있기 때문에 이 값은 0으로만 설정될 수 있습니다.
콜론 다음에 오는 문자(예: B)는 값 표시 형식을 지정합니다. 다음 표에서는 일반 형식을 보여 줍니다.
| 형식 문자 | 설명 |
|---|---|
| C | 통화 형식으로 숫자 값을 표시합니다. |
| D | 10진수로 숫자 값을 표시합니다. |
| E | 지수 형식으로 숫자 값을 표시합니다. |
| F | 고정 형식으로 숫자 값을 표시합니다. |
| G | 일반 형식으로 숫자 값을 표시합니다. |
| N | 숫자 형식으로 숫자 값을 표시합니다. |
| X | 16진수로 숫자 값을 표시합니다. |
참고 형식 문자는 대문자로 사용될 경우 16진 문자를 표시하는 X를 제외하고 대소문자를 구분하지 않습니다.
형식 문자 다음에 오는 값(예: xx)은 표시할 유효 자릿수나 소수 자릿수를 지정합니다.
형식 지정 문자열에 대한 자세한 내용은
예제
[Visual Basic, C#, JScript] 다음 예제에서는 DataFormatString 속성을 사용하여 DataGrid 컨트롤에서 가격을 표시하는 열에 통화 형식을 지정하는 방법을 보여 줍니다.
더보기
참고