Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

DataGridView - Change recordsource by button click event

$
0
0

Hello all. VS 2010 & SQL Server 2008 R2 on Win7 machine. All code is written in VB.NET 4.0

I have a windows form with a split container. On the left container I have a DevXpress NavBar control. On the right container I have a ToolStripContainer with individual buttons for each letter in the alphabet. Each button Tag property has the corresponding letter of the button. Under the toolstrip container I have a DatagridView.

Here is where I am needing guidance. Basically when the user clicks on the button of their choice (example "A") then the datagrid would populate all of our customers that start with the letter "A". What I need help and guidance on is to pass the Tag property of the button as a parameter to the stored procedure that returns the data source for the datagridview and refresh the view. 

I have Googled and searched through MSDN but haven't had any luck. Thanks in advance to any help!


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>