FIX: ???????? ?? ??? ??? ???? ???? ??? ???? ???? DataGrid ?? ??????? Windows ?? .NET Framework 1.1

?????? ????????? ?????? ?????????
???? ???????: 828099 - ??? ???????? ???? ????? ????? ??? ???????.
??????
????? ???? | ?? ????

?? ??? ??????

???????

??? ????? ???? ???? DataGrid ??? ????? Windows ???? ??? ?????? ???????? Microsoft Visual Studio .NET ?? ?? ?????? ????? DataSource ?????? DataGrid ? ?? ????? ?? ???????? ?? ??? ??? ???? ???? ??? ??? ??? ?????? ?? ???? ????????.

????

??????? ????? ???????

??? ??? ???????? ??? ?????? ??? ???? ???? ???? ??????? Microsoft .NET Framework 1.1. ?????? ???? ???? ???? ?? ?????? ???? Microsoft ?????? ??? ?????:
http://www.microsoft.com/downloads/details.aspx?FamilyId=A8F5654F-088E-40B2-BBDB-A83353618B38

???? ??????

??????? ?????? ??? ??? ??????? ???? ??????? ???????:
  1. ????? ???? ????? ??? ?? ??? Form1.cs:
    frm.Controls.Add(dataGrid); 
    		dataGrid.DataSource = dv;
  2. ??????? ????????? ???????? ???? ??? ?????? ????? ?? ?????? 1 ?? ????????? ???????? ???????:
    dataGrid.DataSource = dv;
    		frm.Controls.Add(dataGrid);
  3. ????? ????? ??????? ?? ?? ?????? ???????.

    ??? ?? ????? ?????? ??????? ?? ??? "???????".

?????

???? Microsoft ?? ??? ????? ?? ?????? Microsoft ??????? ?? ??? "????? ???". ?? ????? ??? ??????? ???? ??? ?? Microsoft .NET Framework 1.1 Service Pack 1.

??????? ????

???? ???????? ???????? ?? ????? "????? ????? ????? ??????" ??? ???????. ????? ??? ??????? ??? ???? ?? ?????? ???????? ???? ????? ??? ???? ????????. ??? ????? ???? ???????? ?? ???? ???? ???? ????????? ????????. ?? ??? ??? ???????? ?? ??? ??????? ???? ?? ????? ??? ???? ?? ???? ????????. ??? ???? ???? ???????? ???????? ??? ?????? ?? ???? ????????.

????? ????? ????? ??????

  1. ??? ????? Visual Studio .NET.
  2. ?? ??????? ???? ??? ??? ???? ?? ???? ??? ???????. ???? ???? ?????? ????? ????.
  3. ??? ????? Project ? ???? ??? Visual C# ????????.
  4. ??? ????? ? ???? ??? ????? Windows ?? ???? ??? ?????. ?????????? ??? ????? ????? ?????? Form1.
  5. ?? ???? ?????? ?????? ? ???? ??? ?????? ?????? ??? ????? Form1.cs ?? ???? ??? ??? ????????? ????????.
  6. Replace the existing code with the following code:
    using System;
    using System.Data;
    using System.Windows.Forms;
    
    class TestForm : Form 
    {
    	public TestForm()
    	{
    		InitializeComponent();
    	}
    
    	private void InitializeComponent()
    	{
    		DataSet ds = new DataSet();
    		DataTable dt = ds.Tables.Add("Customers");
    		DataColumn c = dt.Columns.Add("Id", typeof(int));
    		dt.Columns.Add("Name", typeof(string));
    		dt.Columns.Add("Related", typeof(string));
    		DataRow dr= dt.NewRow();
    		DataRow dr1= dt.NewRow();
    		DataRow dr2= dt.NewRow();
    		DataRow dr3= dt.NewRow();
    		DataRow dr4= dt.NewRow();
    		//
    		dr["Id"]=1;
    		dr["Name"]="A";
    		dr["Related"]="";
    		dt.Rows.Add(dr);
    		//
    		dr1["Id"]=2;
    		dr1["Name"]="B";
    		dr1["Related"]="A";
    		dt.Rows.Add(dr1);
    		//
    		dr2["Id"]=3;
    		dr2["Name"]="C";
    		dr2["Related"]="";
    		dt.Rows.Add(dr2);
    		//
    		dr3["Id"]=4;
    		dr3["Name"]="D";
    		dr3["Related"]="A";
    		dt.Rows.Add(dr3);
    		//
    		dr4["Id"]=5;
    		dr4["Name"]="E";
    		dr4["Related"]="";
    		dt.Rows.Add(dr4);
    		//	
    		DataView dv = new DataView(ds.Tables["Customers"]);
    		dv.Sort = "Id ASC";
    		//
    		Bind(dv);
    		//Create another view with the rowFilter property that is set 
      //to the name value of the row that will be deleted.
    		DataView dv1 = new DataView(ds.Tables["Customers"]);
    		dv1.RowFilter = String.Format("Related = '{0}'", dv[0]["Name"]);
    		for (int i = 0; i < dv1.Count; i++) 
    		{
    			dv1[i].Delete();
    		}
    
    		dv[0].Delete();
    
    		for (int i = 0; i < dv.Count; i++) 
    		{
    			dv[i][0] = i + 1;
    		} 
    	}
    
    	public void Bind(DataView dv)
    	{
    		Form frm = this;
    		DataGrid dataGrid = new DataGrid();
    		dataGrid.Dock = DockStyle.Fill;
    		dataGrid.Size = frm.ClientSize;
    		frm.Controls.Add(dataGrid); 
    		dataGrid.DataSource = dv;
    	}
    
    	public static void Main()
    	{
    		try 
    		{
    			Application.Run(new TestForm());
    		} 
    		catch (Exception exc) 
    		{
    			MessageBox.Show(exc.ToString());
    		} 
    	}
    }
  7. ?? ??????? ????? ? ???? ??? ????? ????.
  8. ?? ??????? ????? ? ???? ??? ????. ???? ?????? ??????? ?? ??? "???????".
?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
824684??? ????????? ???????? ????????? ?? ??? ??????? ????? Microsoft
????? ?? ?????????? ?? ?????? ???? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
??? ? ????? ???????? ???????? DataView
http://msdn2.microsoft.com/en-us/library/13wb36xf(vs.71).aspx

???????

???? ???????: 828099 - ????? ??? ??????: 04/????? ??????/1428 - ??????: 1.3
????? ???
  • Microsoft .NET Framework 1.1
????? ??????: 
kbmt kbhotfixserver kbqfe kbbug kbnetframe110sp1fix kbdatabinding kbwindowsforms kbtable kbdll kbcontrol kbqfe kbnetframe110presp1fix kbfix KB828099 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????828099

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com