I have added a table to my FormView Edit template for structure and a button that pops up a form for information.
When the button is clicked I want a check box in neighboring cell to become checked. But I am having problems in the VB code behind, establishing the name of the check box to change its state. Its something like this....
I keep getting a null reference when I try to access a listbox inside the EditItemTemplate of a formview. I check the mode before accessing the control (Formview1.CurrentMode) to make sure it is in edit mode and even set it manually to edit mode again! But formview1.findcontrol("blah") returns null. Formview1.EditItemTemplate does not have a FindControl method, not sure what else to try.
In almost all cases, my edit template and insert template in the formview are the same.
So instead of copying pasting the same markup, i decided to put it in a user control. The display works fine, however, the databinding doesn't work anymore. It works fine if I put the markup directly in to the formview template.
When the FormView is in Edit mode, ddlCategory is populated as expected by calling GetCategories(), which returns a List of categories. However, when the ListView is in Insert mode, ddlCountry is empty. I put a break point in GetCountries(), but it never gets called. If I change the name of the method, I get an error. So it recognizes the method at compile time, but does not call it at run time. I'm guessing this is an embedded binding issue of some kind, but I'm hoping someone can save me a lot of time by pointing out the solution.
I am having trouble trying to access a UserControl I created and placed inside the EditTemplate of the ListView. How is it done? I've tried to access it at the ListView's ItemDataBound, ItemEditing and Databound with the following code with no luck:
I have a radiobutton inside an itemTemplate in datalist , and i'm binding this radiobutton dynamically from database, the problem is that all the radiobuttons generated are selectable at the same time which is wrong. (Multiple radiobuttons selcted at the same time)
I have an ItemTemplate inside a listview with a linkbutton wrapped around three table rows. The linkbutton is supposed to make the whole rows clickable but this only works in IE. Does anyone have an idea about why? The link works if I move the rows out of the linkbutton and write some gibberish text instead, but that's not what I want.
Very new to ASP.NET (using C# behind) and am having trouble figuring out the following scenario. I have a DataList that is populated (code below) and wanted each cell to be clickable. When the cell is clicked I wanted to know the unique ID for that cell. In my code behind, my OnClick method looks like this:
I have a GridView with two templatefields, one with a DropDownList and the other with a TextBox, both loose their values once I hit the "update" button. Is it any way I can make the controls keep the values?
I have a ListView showing just a list of concatenated strings obtained from different field of the objects of the datasource.
A LinkButton (with CommandName="Edit") in each row Event handlers for OnItemDataBound and OnItemEditing
A UserControl in EditTemplate.
Now the problem is, I don't know how to use Bind expression in the UserControl. I mean, how to populate this usercontrol when the linkbutton is clicked? (I tried capturing the control in theOnItemEditing handler. But FindControl returned null, as that handler is called before going to edit mode.)
I have a usercontrol with a datagrid that is used throughout my web application. The datasource is passed in a public method from the master page to this usercontrol, as the data selection is different on each page where this usercontrol is used.But by doing this, I'm having a problem with paging, as the datasource is lost after postback. I can't do the data selection in the usercontrol itself as the dataset is passed as a parameter.