Select multiple rows in GridView without using a Select Command ?


Does anyone knows a way to select multiple rows in GridView without using a Select command, control button or a checkbox control?

Thank you very much.

3/4/2009 3:46:05 AM 72751 articles. 3 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 13

Does anyone knows a way to select multiple rows in GridView without using a Select command, control button or a checkbox control?

I believe that this is what you are looking for:

GridView Clickable Rows


"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
3/4/2009 4:12:18 AM

Thanks Vinz for replying,

The  sample in the "GridView Clickable Rows" only returns the number of row selected, is there a way to highline a single row/multiple rows selected in GridView and return the total number of row selected?  Thanks


3/4/2009 4:32:16 AM

Hi olaamigos,

GridView control can enable only one row in Selected mode . So if you want to select multi-rows , to use checkbox is a good option .

And you can loop through row collection of GV , and set row's color according to whether checkbox is checked .

Samu Zhang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
3/6/2009 6:42:32 AM

Similar Artilces:

Problem in Using DropDownList Control to select a selected row of SqlDataSource that is under GridView Control
Hi all,In my SQL Server Management Studio Express, I have a database "ChemDatabase" that has a table "LabData"  formatted in the following way: SampleID int PRIMARY KEY, SampleName nvarchar(25), ChemicalName, nvarchar(25), Concentration decimal(6.2) with 5 rows of records in this .dbo table. In my Visual Web Developer Express, I created a website "RPD-TCE" for extracting a row of record from the LabData table by using a DropDownList, a GridView and a SqlDataSource.  I want to click DropDownList to list one number of S...

Problem in GridView Row Selection without using Select button
Hi All, I want to Select a Gridview Row without using Select button, So i have used following Javascript in Row DataBound Event.... e.Row.Attributes["onmousedown"] = ClientScript.GetPostBackClientHyperlink(this.grdDocs, "Select$" + e.Row.RowIndex,false); It is working fine. But the page is refreshing every time when i select a row. how can i avoid that....? Using an UpdatePanel is one option, off the top of my head,C# <---> VB.Net Translator I am not using Ajax here. Can't i do with Javascript...? Row selection in a Grid is only handled server-side...

Selecting the multiple rows in GridView and inserting the selected rows to another Gridview & Performing some operations on it
 Dear All, I have become mad for solving this problem. Please Help me. I have a Gridview bound to a datasource. I inserted the CheckBox Control in Templet to select certain rows. Gridview1 contains some products id & name.I want to insert the selected rows in to second Gridview  and in the second Gridview I need to add two more colums AdvicedQty & AcceptedQty(TextBox Cotrol).The user will select few products in Gridview1 & clicks add which will be added another gridview then in second Gridview he enters the AdviceQty & AcceptedQty.After entering the data he cli...

Gridview paging enabled. Has checkbox to select the row . If user select the checkbox on one page and move to 2nd page to select the rows there also to export the selected rows to excel. But doing so
HiI am using Gridview and that has paging enabled. Using checkbox to select the particular row of the gridview to export the selected rows to the excel . Everything is working fine except for one case.Let user selected the "check" box for, five rows which user would like to export to excel (two of rows on page 1 of results and 3 of them on page 2 of results), however it only exports the 3 row details from page 2, because it seems to de-select the 2 rows from page 1 when I move to page 2 and vice versa. The code i am using is as :protected void BtnExcel_Click(object sender, EventArg...

Select a gridview row without a select button
Hi Does anyone have a vb code sample of how to select a gridview row without having to click on a select button?   Thanks    ASPX <asp:label id="Label1" runat="server" /> <asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" datakeynames="ProductID,ProductName" datasourceid="SqlDataSource1" style="margin-top: 12px;"> <columns> <asp:boundfield datafield="ProductID" headertext="ProductID" readonly="True" sort...

Selecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row.
What is the best way to show a gridview row highlighted once selected and keep it highlighted once the mouse moves over a different row? Thanks, Steve hi,you can use <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="#FFFFFF" /> plz let me know if i misunderstood you Thanks for your help. One problem; however, is that after the row has been selected and I check the "grid.SelectedIndex" it has a value of -1 and not the index of the row that was selected on the grid. What do you recommend? Thanks, Steve hi, sorry i din...

how can i select a row in a gridview without the select link
how can i select a row in a gridview without the select link, i mean, by click in the row no in the select link?i know that it is not a custom control but i couldnt do that yet. Hi, it is a custom control. ;-) Please see my blog post: Developing a row-clickable GridView,Teemu KeiskiFinland, EU...

how to update a row using a seperate update button not command button without selecting the row?
How to update a row using a seperate update button not command button without selecting a row? Simple question but dificult to do. The reason I ask this is that when a user clicks 'Update' I want each row to update the database. Please note I can't use findcontrol as their are no headers This is my code so far: protected void UpdateButton_Click(object sender, EventArgs e){    foreach (GridViewRow row in CellGridView.Rows)     {          string stext = CellGridView.Rows.ToString();     &nb...

How do I select a row using a button that isnt the select command button
I have an 'UP' and 'DOWN' button by the side of a gridview. When i click 'UP' or 'DOWN' the row swaps places with the row above or below which is correct. However i want the row that moved to continue being selected so that i can keep pressing the 'UP' button to move the row rather than having to select the row click 'UP' then select the row then click 'UP' and so on. I need a line of code that changes the selected index up or down when i press the 'UP' or 'DOWN' button. But the events available to me when clicking on...

Using checkboxes to select multiple gridview rows
I am using a gridview control with a template column containing a checkbox.  My intention is for the user to select one or more items by checking boxes, then click a button control which would run an action query updating all selected items. One difficulty I'm encountering is that if the user sorts the grid or selects another page using paging, all selections are lost, i.e., the checkboxes all become unchecked. So, my question is twofold: 1) How can I cause the user's selections to persist over postbacks; and 2) What is the recommended strategy for enabling selection of multiple ite...

Selecting multiple selections in gridview
 Hii got a gridview where user can select selections from the gridview and this is then converted to string in the TextBoxes..(this is so user can select record of students from that database and when a selection is made this is converted to string and added to a different table...when i select a record and add to the textboxes it does but when i select another record set and add that in, the earlier record disappears..How can i make it so user can select a record it converts to string and when user selects the other record, the earlier record is still there..  You can use CheckB...

Using a row selection in a gridview to create database rows for another gridview
Hi there, I have 2 gridviews on a form, the first displays some template rows from a database table.  The second displays some user specific rows (with additional data added to the template info) from the same table. They both work fine for displaying the info.  Now what I want to do, is allow users to 'select' a template row on the first gridview, and have that action automatically: create a new user-specific row, with added fields from profile data etc. insert it into the table then refresh the second gridview in order to show the new added row. C...

GridView 2.0 VB: How to select row using buttonfields (not select commandfield)
THis is 2nd post.  Hoping someone can share advice in VB .NET 2.0:Anyone have a sample of how to make a ButtonField click select the row like a "select" commandfield does? I have 5 buttonfields in (Master) Gridview1 row, each using command Name to open a (child) Details1 in multiview.The Child datasource has a Param mapped to Gridview1 selected row.  Everything works IF I manually select the row first, then click one of my buttonfields. Guessing RowCommand event is the key, but no clue how to ID the row my buttonfield was cliked in, or which pro...

Gridview: How to select a row using VB & Buttonfield (like the Select Commandfield does)
GridView row contains 7 buttonfields (each using CommandName): When clicked, each button needs to HIGHLIGHT the row (like select commandfield does) AND SAVE the row datakey as a parameter for a 2nd datasource to use??? Thinking its a combination of gridviews _rowCommand & _selectedIndexChanged events.  Need advice on simplest way to proceed using VB. Thanks for your time.   in Rowcommand Event. Check that e.CommandName . do your work like Save data. then get the rowIndex of row then gridview.selectedRowIndex = rowIndex. Hope it will...

Web resources about - Select multiple rows in GridView without using a Select Command ? -

Multiple sequence alignment - Wikipedia, the free encyclopedia
A multiple sequence alignment (MSA) is a sequence alignment of three or more biological sequences , generally protein , DNA , or RNA . In many ...

Sydney Trains missed multiple chances to avoid Edgecliff derailment, says ATSB report
... has highlighted concerns about a focus on a &quot;can-do culture&quot; rather than safety. Sydney Trains staff and senior managers missed multiple ...

Apple Looks to Bring Multiple Colors to 3-D Printing with Patent Filing
... filed by Geoffrey Stall and Howard Miller , and assigned to Apple, is dated December 3rd, and it focuses on the problem of bringing multiple ...

Multiple McDonald’s Locations Forced To Close After Prank Callers Convince Workers To Test Fire System ...
When I think of prank calls, I conjure up images of teenage girls huddled around their clear plastic phones, calling boys in their class and ...

Multiple Victims In San Bernadino Mass Shooting; 1-3 Shooters Sought
When is it enough to actually do something? Fuck the NRA. Fuck the Republican party and the right wing hate machine. Those Syrian refugees might ...

Cowboys Fan Beats Up Multiple Attackers In Parking Lot Brawl
That's the best defense anyone wearing a Tony Romo jersey has ever played

The Philadelphia 76ers announced that they suspended Jahlil Okafor—he of the multiple fights outside
The Philadelphia 76ers announced that they suspended Jahlil Okafor—he of the multiple fights outside of bars and one of their only competent ...

Google's Chromecast Audio beams music to multiple rooms
If you're been eyeing Google's Chromecast Audio for your holiday shopping spree, Mountain View just added some new features to sweeten the deal. ...

China Mobile Ltd. (ADR) on Focus After Forming Bearish Multiple Bottom Chart ...
China Mobile Ltd. (ADR) on Focus After Forming Bearish Multiple Bottom Chart ... The stock of China Mobile Ltd. (ADR) ...

Ohio Teen convicted for multiple swatting attempts
A Painesville, Ohio teen has been sentenced to five years in a juvenile correctional facility this week for calling in multiple fake emergencies ...

Resources last updated: 12/10/2015 8:01:56 PM