음수 값을 피할 수 있어야합니다. 창 브라우저의 크기를 조정할 때 오류가 발생하지 않도록 음수 값에 도달하지 않을 때 축소하려면 DataGrid가 필요합니다. 그게 가능하니? 미리 감사드립니다.음수 값을 피하는 방법은 무엇입니까?
public SilverlightResizeTest()
{
InitializeComponent();
// Set the height for the DataGrid when the browser window changes size
App.Current.Host.Content.Resized += new System.EventHandler(Content_Resized);
// Set the initial height for the DataGrid
double x = App.Current.Host.Content.ActualHeight;
if (x != 0)
{
DataGrid.Height = (x - 485.0);
}
}
void Content_Resized(object sender, System.EventArgs e)
{
// Set the height for the DataGrid when the browser window changes size
double x = App.Current.Host.Content.ActualHeight;
if (x != 0)
{
DataGrid.Height = (x - 485.0);
}
}
그것은 잘 작동합니다. 도와 주셔서 감사합니다! 나는 그것을 아주 좋아한다. – vladc77