I have 2 set of dropdownlist controls in asp.net page i want to create one set in one group and other set as one group. eg there are 15 dropdownlist which indicates internal dropdown and other 15 dropdownlist indicates as external drop down.
Related
I am writing a web form using controls from DevExpress.
There is a Grid which has 3 GridViewDataComboBoxColumns and I am going to create a SelectedIndexChanged event to update the value of the other combo boxes in newitemrow once one of the combo boxes is filled.
For example, there are 3 columns: EmployeeID, EmployeeName and EmployeeEmail
When I selected a EmployeeID in the newitemrow, then the other two boxes in newitemrow (employeename and employeeemail) will be filled by the SelectedIndexChanged Event.
However, I don't know how to locate the other combo boxes in the SelectedIndexChanged Event.
Please help!!
Since you are using MS UpdatePanel, I would suggest that you use ComboBoxes within the columns' EditItemTemplate and set their AutoPostBack property to true. Handle the editor's SelectedIndexChanged to update editor values. Here is the example project:
How to use cascading comboboxes in an inline edit mode
I need to create a usercontrol that will have a datalist or repeater. This data control (datalist or repeater) will have all of its rows in edit mode and I need to get the values entered by the user after he submits the page that contains this usercontrol (the page will have 3 instances of the same usercontrol).
How can I do this?
I'm looking for previous question on StackOverflow, but I can't find one about a data control with all rows in edit mode.
I have a gridview which is being populated by a Javascript. Now after this action I want to add Start and Stop buttons to the data that has already being bound via the Javascript. So the final Gridview row would consist of 2 buttons and the column values that have been set by the Javascript.Can someone please suggest
Simply, if I have a GridView with a SqlDataSource control declarative set as its data source, when does that data source retrieve its data and when does the binding take place in the page lifecycle?
In the 'preRender' phase - look at the ASP.NET Page Life Cycle Overview for more info.
This article about Page Cycle is pretty good.
For example, suppose you have a GridView that displays a company record in each row along with a list of the company officers in a ListBox control. To fill the list of officers, you would bind the ListBox control to a data source control (such as SqlDataSource) that retrieves the company officer data using the CompanyID in a query.
If the ListBox control's data-binding
properties, such as DataSourceID and
DataMember, are set declaratively, the
ListBox control will try to bind to
its data source during the containing
row's DataBinding event. However, the
CompanyID field of the row does not
contain a value until the GridView
control's RowDataBound event occurs.
In this case, the child control (the
ListBox control) is bound before the
containing control (the GridView
control) is bound, so their
data-binding stages are out of sync.
To avoid this condition, put the data
source control for the ListBox control
in the same template item as the
ListBox control itself, and do not set
the data binding properties of the
ListBox declaratively. Instead, set
them programmatically at run time
during the RowDataBound event, so that
the ListBox control does not bind to
its data until the CompanyID
information is available.
I am using a telerik radgrid so there are around 5 columns each column edittemplate contains a control along with a required field validator and also a property called AllowMultiRowEdit is set to true so i am able to multiple rows in edit mode.
If any of the values are cleared the for multiple rows I want only those to be validated on update of that particular row.
So i implemented the Grids item data bound event find each and every validator along with the update button and set a unique validation group.
The above implementation most times but fails at some time. Is there any other way of going about this ?
You could use a customvalidator that uses code to check the other textboxes to ensure no value is being updated... requiredfieldvalidator always validates that a value has been supplied in the database, but CustomValidator gives you the ability to control the validation on the client and server. The issue becomes though, how to validate the other controls, and that will be tricky.
You will have to, from within the servervalidate or on the client, navigate up the control hierarchy from the validated control to the row level of the control and then find the other controls in the same row.