I had a Dropdrowlist and FormView to work hand in hand to edit/update data.
Now I need to add a radGrid and when a user clicks on the row, I need the FormView to be populated or I need my existing FormView to be populated inside the RadGrid's edit item template.
Related
I am trying to figure out what the correct event would be to populate a ComboBox in a Telerik RadGrid or any ASP.NET grid from the CodeBehind. When the user clicks Edit on a row the ComboBox should be populated with its items.
The only examples I have seen are using the DataSourceID property in the aspx page. I prefer doing all of my populating manually in the code behind:
ComboBox1.DataSource = colorList;
Combobox1.DataBind();
You can access child controls in a grid column in:
ItemDataBound - fired for each item (so you need to check for GridDataItem types or GridEditItem, depending on your goal)
ItemCreated - similar, but you don't have the data item object associated with each item
ItemCommand - when Edit is clicked an Edit command is invoked so you can access it.
I am doing jobsite i want the dropdownlist to display the job category like ex(itsoftware) if
the user click that all the IT related information will display below that category
i used treeview control inside dropdownlist. but it will not work
You can't place anything except ListItem into DropDown control. Consider to place TreeView below the dropdown and update it on SelectedIndexChanged dropdown's event. Or use some client-side staff like this one: mcDropdown jQuery Plug-in
I've Creted Composite control which has FormView and two custom server control. The Control renders correctly. now when i add control to page from toolbox i want to edit Composite Control's FormView ItemTemplte as we edit ItemTemplate for generic formview (by clicking small arrow head).
any adeas?
When you create an instance of the FormView, programmatically add the templates to the FormView before adding it to the CompoisteControl in the CreateControlHierarchy() method.
Here is an extensive example
I have a RadGrid bound to a LinqDataSource. The grid has auto generated Edit and Delete columns. It displays a simple table without any hierarchical organization.
I am taking the following steps.
Populate a RadGrid using a LinqDataSource
Click Edit on the last row of the grid
From another control on the page, update the linqdatasource and call rebind on the grid
The grid loses track of the current editing item, and opens a different item in edit mode
Please help.
If you rebind the datasource, everything will be reset. You will need to keep track of the current 'edit' item, and 're-activate' it after your rebound the datasource.
Make sure that:
All binding occcurs in the OnInit event (or after the button click is handled)
Viewstate is not disabled for the grid
I'm binding a hashtable to a detailsview web control in ASP.NET 2.0. I have my edit/delete/insert link buttons on the detailsview, but when clicking new, the mode does not change.
Any ideas why?
I'm assuming that you have created a 'New' Button within the DetailsView. You should be able to simply handle the click event in your CodeBehind, and call the DetailsView.ChangeMode Method.
DetailsViewName.ChangeMode(DetailsViewMode.Insert)
DetailsViewName.DataBind()
In this case, I simply rebinded the DetailsView to show a blank form. You can also use the Click event to bind controls within the DetailsView form as well.
Fill out the form, click Add, and the Item_Inserting Event should get handled.