Ask a Question related to ASP.NET General, Design and Development.
-
Mark Kamoski #1
how to connect a validator programmatically to a bound datagrid
Everyone--
I have a DataGrid that is bound at run-time.
Upon the click of the Add, a new row is added to the top and it has several
types of controls, (but, it is not permissible to use the built-in editing
functionality of the DataGrid).
The DataGrid is bound.
Now, the user fills out the controls and clicks Save at which point I need
to validate.
However, the ReqFieldValidator controls cannot be bound to the controls
they should because sometimes the grid is empty to begin with.
Therefore, I have a placeholder which is loaded programmatically with a
ValidationSummary control and several validation controls.
The problem is that the page is choking on trying to set the
controlToValidate property. Somehow, it cannot find the control it has to
bind, even though it is in the Declarations section and on the ASPX page.
I think this is because it is part of an itemTemplate, but I don't know for
sure.
So, how can this be done programmatically?
(The run-time engine will not allow it if I try to add the
ReqFieldValidators to the ASPX page and set their ControlToValidate
property to a control in an ItemTemplate-- it cannot find the control.)
Any ideas are welcome.
Thank you.
--Mark
Mark Kamoski Guest
-
DataGrid cellRenderer with Validator
Folks, I have a DataGrid with a cellRenderer that has a DateValidator. It works fine. My problem is that I have a button called "SaveGrid" that... -
UserControl inside of datagrid - loses its viewstate when datagrid is re-bound on postback
I have a simple usercontrol, a datepicker which contains 3 dropdownlist , it resides inside a datagrid column and i set the selecteddate property of... -
DataGrid with validator
Hi, I want to add a custom validator to a dataGrid's boundcolumn. I use datagrid's "edit, update, cancel" button to do. But I cannot find a... -
dynamic datagrid and validator
Hello, I have a problem with one datagrid and a CompareValidator : I have a datagrid, filled with textbox, and a button. I expect integer in... -
Sort on bound DataGrid
I have create a page with SQLDateAdapter, SQLConnetion, DataSet and Datagrid. I have bound the Datagrid at design time. I could not find a way to...



Reply With Quote

