public WebControl CreateControl(TemplateField field, DataRowView rowInPage, IDictionary <TemplateField, int> fieldIndices) { #if trueWWW DateTime data = (DateTime)rowInPage.Row.ItemArray[fieldIndices[field]]; var text = data.ToString(new CultureInfo("ru-RU")); #else var text = string.Format(field.Format.Provider, field.Format.FormatString, rowInPage.Row.ItemArray[fieldIndices[field]]); text = CellControlNewAttributes.GetDateTimeValue(text, field); #endif if (EntityInstance != null) { if (EntityInstance.EntityInstanceID == rowInPage["objID"].ToString() && EntityInstance.SelfColumnsValue != null) { foreach (var colValue in EntityInstance.SelfColumnsValue) { if (colValue.Key == field.Attribute.FPath) { //text = colValue.Value.ToString("g", new CultureInfo("ru-RU")); text = CellControlNewAttributes.GetDateTimeValue(colValue.Value, field); } } } } TextBox TextBox; TextBox = new TextBox { ID = field.Attribute.FPath + "TableCellDateTextBox" + field.Order.ToString() + rowInPage.Row.ItemArray[0], ReadOnly = false, //Height = Unit.Pixel(15), BorderWidth = Unit.Pixel(0), Text = text }; TextBox.Attributes.Add("onchange", "getTableCellControlsData()"); TextBox.Attributes.Add("attributeName", field.Attribute.FPath); TextBox.Attributes.Add("class", "AlternativeRow"); TextBox.Attributes.Add("type", "date"); return(TextBox); }