ListView Default Button



I drag a listview control onto a form and attach it to a table in mssql 2008
and enable all modes.
It displays great with the bottom row being an insert row for new data.
I type data into the row and naively hit the enter key expecting the row of
data to be added to the table. Instead, because the very first button in the
first row is the default button. I delete the first row in the table instead
of adding a new row. What a surprise.

So I try to set the default button like this: form1.DefaultButton =
InsertButton.ID.ToString (), but I get a InsertButton does not exists in
the current context.
The insert button in the list view control is not visible to the code behind
file, and it doesn’t show up in intellisense.

How would you set the default button in a list view to something other than
the delete button. Like maybe the Insert button.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question