개별 열이나 셀의 글꼴을 변경할 수 있는지 확신하지 못합니다. 격자에는 글꼴과 크기를 설정할 수있는 속성이 있습니다. 당신이 바인딩의 DataTable에있는 열을 숨기하고자 할 때이 방법도 도움이된다
private void SetColumnWidth(int columnID, int width)
{
// add table style if first call
if (this.dataGrid1.TableStyles.Count == 0)
{
// Set the DataGridTableStyle.MappingName property
// to the table in the data source to map to.
dataGridColumnTableStyle.MappingName = "<name of your table in the DS here>";
// Add it to the datagrid's TableStyles collection
this.dataGrid1.TableStyles.Add(dataGridColumnTableStyle);
}
// set width
this.dataGrid1.TableStyles[0].GridColumnStyles[columnID].Width = width;
}
:하지만, 나는이 방법을 사용, 열 너비를 설정하려면 (이 그리드에 테이블 스타일을 추가) 당신은 보여주고 싶지 않다. (너는 width = 0으로 설정한다.)
동일한 문제가 발생하는 것으로 알고 있습니까? 모든 사용자가 DataTable에 바인딩 예제를 사용하지만 사용자 지정 개체 또는 DataReaders를 사용하고 있으며 해당 예제가 작동하지 않습니다. –
미안하지만, 나는 단지 일부 셀의 글꼴을 변경하는 방법을 결코 알 수 없었다. – Rossini