2011-07-12 2 views
0

私のウェブサイトで2つの言語をサポートする必要があります。 各列ヘッダーに正しい言語を設定する正しい方法はどれですか? カラムインデックスを使用してアクセスしたくありません。私はすべての列をループしたいし、それぞれの列には名前やキャッシュの他のキーを使って正しいテキストを取得したい。DatagridViewデュアル言語ヘッダー

フレームワーク4.0、asp.net、C#を使用しています。

ありがとうございました。

答えて

0

私はもっとこのような何かを意味:

 if (ctl is GridView) 
     { 
      GridView oGrid = (GridView)ctl; 
      foreach (DataControlField oClm in oGrid.Columns) 
      { 
       string str = string.Empty; 

       str = frm.Page.ToString().Replace("ASP.", "").Replace("_aspx", "") + "_" + ctl.ID.ToString() + "_" + oClm.HeaderText.Replace(" ", ""); 
       Dr = DsGuiText.Tables[0].Select("Language = '" + sLang + "' And Key = '" + str + "'"); 
       if (Dr.Length > 0) 
       { 
        oClm.HeaderText = Dr[0]["Value"].ToString(); 
       } 

      } 
     }