Questions tagged [formview]

FormView is a data-bound control that is nothing but a templated version of DetailsView control.

The FormView control is used to display a single record from a data source in a table. When using the FormView control, you specify templates to display and edit bound values. The templates contain formatting, controls, and binding expressions to create the form. The FormView control is often used in combination with a GridView control for master/detail scenarios.

565 questions
27
votes
1 answer

Curious about get_form_kwargs in FormView

I was having trouble with FormView recently and found that the way to go about doing it was to use get_form_kwargs. Here is my code: class InternalResetPasswordView(FormView): template_name = 'reset_password.html' form_class =…
22
votes
3 answers

How to prevent asp:FormView from rendering as a table?

I have an asp:FormView with an ItemTemplate. I'd like to design the content within the FormView with some div elements:
Stuff... …
Slauma
  • 175,098
  • 59
  • 401
  • 420
16
votes
1 answer

Django FormView does not have form context

When defining a FormView derived class: class PrefsView(FormView): template_name = "prefs.html" form_class = MyForm # What's wrong with this? def get(self,request): context = self.get_context_data() …
tonjo
  • 1,394
  • 1
  • 14
  • 27
13
votes
7 answers

"value cannot be null parameter name: key"

I am getting a "yellow screen of death" when debugging a website I'm working on. The error message is "value cannot be null. Parameter name: key." I'm trying to bind a formview to the selected index of a gridview. Everything appears to bind…
user3064073
  • 566
  • 2
  • 6
  • 17
13
votes
1 answer

Django: ListView with post() method?

I am trying to process two forms in a Django class based view. The site contains a form called form (based on GET) for narrowing the list results of the ListView and the second form status_form (based on POST). Both forms are required since the…
neurix
  • 4,126
  • 6
  • 46
  • 71
12
votes
3 answers

DropDownList in FormView binding

I want to bind dropdownlist to List, in code behind.
markiz
  • 2,164
  • 6
  • 34
  • 47
9
votes
3 answers

How to go to Edit Mode in FormView?

I have FormView: protected void fvReport_ModeChanging(Object sender, FormViewModeEventArgs e) { …
DmitryB
  • 147
  • 1
  • 3
  • 7
9
votes
3 answers

Django FormView Not Saving

My form isn't saving the models that I need it to. My form: class RewardForm(forms.Form): quantity = forms.IntegerField(max_value=10, min_value=1, label=_('quantity'), initial=1) reward = forms.CharField(max_length=50, label=_('reward')) …
user3084860
  • 421
  • 5
  • 19
8
votes
3 answers

ASP.NET, VB: how to access controls inside a FormView from the code behind?

I have a checkbox and a panel inside of a FormView control, and I need to access them from the code behind in order to use the checkbox to determine whether or not the panel is visible. This is the code that I originally used, but since I put the…
Sara
  • 185
  • 2
  • 5
  • 16
8
votes
0 answers

File handling in Django's FormView - request.FILES is empty

I am trying to implement a FormView in Django, as it seems to cut down on a bit of boilerplate code. One of the fields is a file upload field. class LibraryUploadLastStageForm(forms.Form): technician = forms.ModelChoiceField(label="prepeared…
wobbily_col
  • 11,390
  • 12
  • 62
  • 86
7
votes
1 answer

How to size UIWebView in a UIModalPresentationFormSheet?

I tried every permutation known to mankind and I cannot get a UIWebView to size properly in a modal form view for the iPad. The web page still displays the full iPad portrait width of 768 points. Where and how do I tell UIWebView to display width…
Christopher
  • 5,806
  • 7
  • 31
  • 41
7
votes
3 answers

Could not find a property named 'xxx.yyy' in FormView (two-way binding for nested properties)

I have this error when I try to update a FormView Could not find a property named 'MainContact.FirstName' on the type specified by the DataObjectTypeName property in ObjectDataSource 'odsForm'. I think it is because I use in the EditTemplate a…
Vinzcent
  • 1,438
  • 6
  • 33
  • 59
6
votes
6 answers

Controls not retaining values after postback when FormView set to insert mode

I am setting the CurrentMode of a FormView to insert mode using the ChangeMode method in the Page_Load event like so: if(!Page.IsPostBack) { MyFormView.ChangeMode(FormViewMode.Insert); } Within my FormView's insert template I have a…
joshb
  • 5,182
  • 4
  • 41
  • 55
6
votes
2 answers

Automatically bind ASP.NET FormView to newly inserted record

Is it possible to get a FormView to automatically default to ReadOnly mode on the record that it has just inserted via its InsertItemTemplate? It seems like this would be somethign that should come naturally to a FormView.
ProfK
  • 49,207
  • 121
  • 399
  • 775
6
votes
4 answers

Assign Event Programmatically to Child Inside FormView

I realize you can declaratively assign an event handler to a child control inside a formview by adding its attribute on the aspx page (i.e. onclick="Button_Click"), but if I wanted to do this programmatically, how would I go about it? That control…
Matt
  • 61
  • 2
1
2 3
37 38