Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:794324
More Search Options
RSS Available
Matching Posts
Programmatically create two-way templatefield in GridView
Hello, I have a programatically generated GridView with a TemplateField in it. I can create the TemplateField and the controls within the TemplateField without an issue. I can also Bind the data from my GridView to the controls in the TemplateField, but only one-way. I'd like the control to also work with the Update command on the GridView. To bind the data to the control I add an event handler for the DataBinding event, and in that event I use the following code: ck.Checked = (bool)DataBinder
Posted to
Data Presentation Controls
(Forum)
by
benfinkel
on 11/12/2009
Re: creating 2-way databinding templatefields programmatically
I realize this is an old topic but I came across it searching for the same answer. I have resolved the problem for myself, see my post here: http://forums.asp.net/p/1492028/3509400.aspx#3509400 Short Story: Override the RowUpdating event (or FormUpdating or whatever control you're using) and add the fields manually to the keys.
Posted to
Data Presentation Controls
(Forum)
by
benfinkel
on 11/12/2009
Re: Programmatically create two-way templatefield in GridView
I have resolved this issue. To get two-way binding working, I had to override the RowUpdating event of the GridView itself and add the keys manually. See this code: void eCRFContactGrid_RowUpdating(object sender, GridViewUpdateEventArgs e) { bool value; value = ((CheckBox)this.Rows[e.RowIndex].Cells[5].FindControl("ckQueries")).Checked; e.NewValues.Add("Queries",value.ToString()); }
Posted to
Data Presentation Controls
(Forum)
by
benfinkel
on 11/12/2009
CustomValidator, client-side validation, and a custom composite control
I am trying to get a CustomValidator doing client-side validation on my custom composite control, and having very little luck. Here is my Custom control code (truncated for brevity): [ ValidationPropertyAttribute("IsValid"), ToolboxData("<{0}:eCRFDate runat=\"server\"> </{0}:eCRFDate>") ] public class eCRFDate : CompositeControl { ... public string IsValid { get { if (_boxA.CheckValidity() && _boxB.CheckValidity() && _boxYear.CheckValidity
Posted to
Web Forms
(Forum)
by
benfinkel
on 11/10/2009
Get the System.IO.Stream of a Panel object?
Hey guys, For drawing purposes, I'm trying to get a reference to the IO.Stream of an asp.net Panel object. Any idea how this is done? Thanks!
Posted to
Web Forms
(Forum)
by
benfinkel
on 9/24/2009
Re: Textboxes, SQLDataSource, Blanks, and Zeros
It's a good thought, but 0 IS a valid response. I can't blank out a 0, which was a correct entry. The root problem is that NULL is different than 0 and I need to know which was entered.
Posted to
Web Forms
(Forum)
by
benfinkel
on 3/12/2009
Re: Textboxes, SQLDataSource, Blanks, and Zeros
Thank you for the quick reply, It helps some. I don't entriely follow the int/nullable int line of discussion. In an SQL Table fields defined as int can be null. A Stored Procedure that accepts a parameter of type int can accept null as a valid value for that parameter and will successfully insert that value into your table. In my ASP.NET code (see below) I am using a TextBox with the Bind("MyIntField") function on a FormView, that then references a SQLDataSource which has an UpdateCommend
Posted to
Web Forms
(Forum)
by
benfinkel
on 3/12/2009
Textboxes, SQLDataSource, Blanks, and Zeros
Good Morning, I've got a problem: When you update an integer field in SQL Table, with a Stored Procedure, through a SQLDataSource using a TextBox on a FormView control, if the TextBox is left blank a 0 ends up in the table, as opposed to a NULL. Now, this may not SEEM like a big deal, but in my case it is. My app is being used to collect clinical data and there is a big difference between a 0 and a NULL. In short, a 0 is a valid, correct entry for the field that was (supposedly) keyed in by the
Posted to
Web Forms
(Forum)
by
benfinkel
on 3/12/2009
Re: Converting kgs to lbs with dynamic javascript in Formview
I moved it all to the FormView prerender event. That seems to have done the trick.
Posted to
Web Forms
(Forum)
by
benfinkel
on 2/11/2009
Re: Converting kgs to lbs with dynamic javascript in Formview
Okay, I tried setting my DefaultMode to Edit and the FindControl STILL returns Null. What am I missing? Thanks!
Posted to
Web Forms
(Forum)
by
benfinkel
on 2/11/2009
Page 1 of 4 (35 items) 1
2
3
4
Next >
TechNet Edge:
TechNet Radio: Community Corner with John Weston (Episode 1)
TechNet Edge:
Windows Firestarter Events (Part 3 of 5): IE8 - Browse the Web in Style!
WindowsClient:
The year ahead, 2010.
TechNet Edge:
FOPE Policies Deep Dive Interview
Silverlight:
Silverlight HVP Design Update
WindowsClient:
Windows Client Developer Roundup for 12/28/2009
WindowsClient:
Snoop with 64 bit support
ASP.NET:
jQuery Hide/Close Link
ASP.NET:
Merry Christmas
TechNet Edge:
FPE Customer Story
Silverlight:
Being a writer, and having an editor. A Short Rant.
Channel 9:
Channel 9 Live at PDC09: Dr Brian Brooks (3M)
Channel 9:
C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals Chapter 13 of 13
Silverlight:
Information for Silverlight HVP Developers…
WindowsClient:
Custom Content Loaders in Silverlight 4.0
WindowsClient:
MVVM Links\Info
TechNet Edge:
Check out how Dolly Parton uses IE8 and Web slices!!!
Silverlight:
A Silverlight HVP Update
Channel 9:
Channel 9 Live at PDC09: This Week on Channel 9 - PDC09 Daily Show Edition Day 1
Channel 9:
Maria Klawe: Scholar, Scientist and Microsoft Board Member
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online