나는 데이터 쿼리에서 동적으로 생성 된 테이블 배열을 가지고 있으며 세션 변수에 저장되어 있습니다. 이제는 텍스트 상자를 추가하여 한 번에 표시 할 행 수를 제한하고 싶습니다. 이를 테스트하기 위해 두 개의 버튼 메서드를 작성했습니다. 하나는 일부 행을 visible = false로 설정하고 두 번째 버튼 메서드는 동일한 행을 visible = true로 다시 설정합니다.테이블 행 가시성을 변경하는 ASP.net 문제
protected void limit_btn_Click(object sender, EventArgs e)
{
for (int i = 0; i < traceTables.Length; i++)
for (int j = 2; j < traceTables[i].Rows.Count; j++)
traceTables[i].Rows[j].Visible = false;
Session["Tables"] = traceTables;
table_C();
}//end limit_btn_Click()
protected void obo_btn_Click(object sender, EventArgs e)
{
for (int i = 0; i < traceTables.Length; i++)
for (int j = 2; j < traceTables[i].Rows.Count; j++)
traceTables[i].Rows[j].Visible = true;
Session["Tables"] = traceTables;
table_C();
}//end obo_btn_Click()
protected void table_C()
{
String changeTo = log_locations.SelectedValue;
for (int i = 0; i < sshLoc.Length; i++)
{
if (sshLoc[i].CompareTo(changeTo) == 0)
{
table_panel.ContentTemplateContainer.Controls.Remove(traceTables[currentTable]);
System.Diagnostics.Debug.WriteLine("Removing " + sshLoc[currentTable]);
table_panel.ContentTemplateContainer.Controls.Add(traceTables[i]);
System.Diagnostics.Debug.WriteLine("Adding " + sshLoc[i]);
currentTable = i;
Session["CurrentTable"] = currentTable;
break;
}//end if
}//end for
}//end table_C()
table_C()는 기본적으로 제거하고 패널에서 테이블을 추가 - 내가 (작동) 드롭 다운 목록에서 테이블 사이를 전환 할 때 내가 그것을 사용하고,이 경우에는 단순히 제거하고 동일한 테이블을 추가 패널 내용 컨테이너에서.
문제는 행을 보이지 않게 설정하면 문제가 없다는 것입니다. 행을 다시 볼 수있게 설정하면 안됩니다. 이유는 확실하지 않습니다.