CSharp/C# >> DataGridView AutoComplete

by Qm9i » Mon, 08 Sep 2008 21:57:01 GMT

I have a datagridview bound to a linq-to-sql dataset expenses.

The grid has columns for Description, Amount and Tax Rate.

The Description column has an AutoComplete source derived from another
linq-to-sql table ExpenseTypes. This source contains descriptions for
example, Travel, Meals, Airfares and a corresponding tax rate for each
expenditure type.

As the Autocomplete entry is selected in the Description part of the expense
grid I'd like to automatically complete the Tax Rate column of the same grid.
I only want this update to happen on newly added rows, and if the user
chooses to override the automatically entered tax rate it must stand.

So how can I cause one AutoComplete event update two columns please?

Best Regards
Bob Morris
--
Bob

Similar Threads

1. Datagridview, Combo-box column: Dropdown on Autocomplete? - .NET Windows Forms

2. Refreshing Linq query to update second DataGridView when position in first DataGridView changes

This seems to be something so simple that none of the hundred-odd tutorials 
and forum threads that I have looked at (:-)) apparently thinks it's a 
problem.

In a nutshell, I have two DataGridViews. Each has a BindingSource (and a 
BindingNavigator). The first view populates successfully based upon a Linq 
to SQL query in the Form Load (that is, the query is assigned to the 
DataSource of that view's BindingSource, and the BindingSource is assigned 
to the DataSource of the view). Or:

var personsQuery = from p in pim.persons
                               select p;

personBindingSource.DataSource = personsQuery;
personDataGridView.DataSource = personBindingSource;

The second view (which is actually address data accessed through a 
person_address join table) is set up like:

addressBindingSource.DataSource = personsQuery;
addressDataGridView.DataSource = addressBindingSource;
addressDataGridView.DataMember = "addresses";

The method "addresses" in class "person" handles the join table. In any 
case, when I run the app, the second DataGridView successfully populates 
with the rows of the address table that correspond to the first row (first 
"person") in the first DataGridView. So far so good.

Problem being, if I select another row in the first DataGridView (in this 
example, a different "person"), I'd like to see the address or addresses 
corresponding to that selected person. I have a SelectionChanged event 
handler set up on the personDataGridView, and it is successfully reporting 
the Position changes in the personBindingSource. I'll be damned if I can 
figure out how to get the addressBindingSource to update, that is, to 
effectively re-run the person.addresses method for a different person.

Any suggestions?

AHS 


3. dataGridView.Rows.Count and datagridview.RowCount - CSharp/C#

4. dataGridView.Rows.Count and datagridview.RowCount

On Jan 15, 11:05燼m, SePp < XXXX@XXXXX.COM > wrote:
> Hello all,
>
> I want to display the number of items in an datagridview. I use this
> one datagridview for different datasets.
>
> The datagridview.Rowcount works fine for the most of the dataset. But
> there is one dataset which has more items
> than the others and the Rowcount wont work. The result is all the time
> 0, but it should be something like 85.
>
> // Datsource
> this.dataGridView1.DataSource = this.REMINDERBindingSource;
> this.v_REMINDERTableAdapter.Fill(this.subnr.REMINDER);
>
> // Display number of items
> lbl_row.Text = dataGridView1.RowCount.ToString();
> MessageBox.Show(this, dataGridView1.Rows.Count.ToString());
>
> Has somebody an Idea? 燭hanks in advance.
>
> Greets
> SePp

I have a solution....

I don't use the count for the datagridview I use the Dataset instead:

 MessageBox.Show(this, this.dataset_name.Rows.Count.ToString());

Thanks

5. DataGridView into another DataGridView - CSharp/C#

6. Copy from datagridview and paste to second datagridview

I need usage possibility when I double click on any row in datagridview,
that row must be copied in second datagridview.
Any good link about that?!

7. Autocomplete combobox with button click - CSharp / C#

8. TextBox AutoComplete not quite good enough

I want to have AutoSuggest based on a database (or webservice) query.  So as 
the user types say... a last name I will make an async call to a service to 
get matches, then set the suggestion list at runtime.

I tried this quick by handling the key down event and building a "dumb" 
Suggestion list and assigning to the TextBox control but it seem to lock the 
control up from any additional text input and the autocomplete list is not 
displayed.

Has anyone mananaged to put this feature of the TextBox to use beyond the 
built is sources?