当用户点击我的文本框时,我想在文本框中输入值OK,当他动作双击时我想在文本框中放入NOK。我知道有可能属性但是如何?
我的网格视图中的列如下:
protected void Application_Start()
{
#if DEBUG
XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging_DEBUG.config")));
#else
if (AppDomain.CurrentDomain.BaseDirectory.Contains("DevTrackerweb")
|| AppDomain.CurrentDomain.BaseDirectory.Contains("Trackerweb4Test"))
{
XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging_DEBUG.config")));
}
else
XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging.config")));
#endif
var log = LogManager.GetLogger(AppDomain.CurrentDomain.BaseDirectory);
log.Info("Application start");
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
ModelBinders.Binders.Add(typeof(decimal), new DecimalModelBinder());
ModelBinders.Binders.Add(typeof(decimal?), new NullableDecimalModelBinder());
Translator.Prefetch().Wait();
HttpContext.Current.Application.Add("TrackerwebServiceStatus", TrackerwebServiceStatus.OK);
sitesByHostName = InitializeSites();
mainCustomerIDByCustomerID = InitializeCustomerIDDictionary();
}
我在我的文本框中添加了这样的值(以及我的表格):
<asp:TemplateField HeaderText = "Rating" >
< ItemTemplate >
< asp:TextBox ID = "BOX_Rating" runat="server" Text='<%# Bind("Rating") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
一切都很好但是当我尝试为我的文本框添加属性时不起作用。 我尝试这个但是不起作用:
dr = dt.NewRow()
dr("Item_number") = Paragraphorder
dr("Station") = ActivityResource
dr("Verified_characteristic") = Description
dr("Measurement_techinque") = ActivityName
dr("Specification") = RequirementNom
dr("Frequency") = Frequency
dr("Responsible_person") = "VMO"
dr("Rating") = "OK"
dr("Result_1") = "OK"
我的表是这样的:
我希望当用户点击进入文本框以确定并且当操作双击以放置NOK时,但是当我点击进入文本框时我的代码没有反应。