C rowupdating newvalues

trim to "Lennon" I have those Textbox in Form View, binding with property using Bind("First Name"). I want those value to be trim before saving, what is the best way to do this ? This way, i was saved from logging individual query parameters at different code points.Computers are generally excellent at repeating tasks multiple times, be it 10, 15, or 1,478,239,129 times - I think the idea I'm sharing is for acting on a single instance of your problem, it's your perogative to work out how to modularise it. If you have such intercepting point inside Bind(String property Name), you can do trimming there.I'm not advocating that you write a For saving the labor, what you can do is to create a helper method, and intercept it before any binding set. Or You can create Trim Bind function, and call Trim Bind instead of Bind If you don't know how many textboxes are going to use or there are many textboxes and you want to trim them all , even for multiple pages , I prefer to create Extended Property for Text Box and override its Text property to return always trimmed value.I had once such similar scenario, where i need to log every SQL query (Execute Reader, Execute Non Query) with parameters. If you don't use one of the Data Source controls, you are required to handle the Row Updating event. I confirmed this using Reflector: protected virtual void On Row Updating(Grid View Update Event Args e) { bool flag1 = base.

I have a Grid View control and use old style manual binding with a Data Source property and invoke the Data Bind() method.

Note: Instead of using Text Box in normal mode use Labels.

Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.

What i simply did was to create a static method excepting IDBCommand.

I've a sample below, the Grid View Template is bound to Category Name.

Leave a Reply