I have problem in gridview selected Row

Posted by Nuwan under ASP.NET on 5/8/2012 | Points: 10 | Views : 1103 | Status : [Member] | Replies : 4
Dear All,

I bind a sql table in gridview, I include in gridview Command button field,
Now i want to if I select 5 rows in that gridview give me a message Like "YOU CAN SELECT 5 ROWS ONLY".
How can i do that Please help me.

Thank you.

Rathnayake


Responses

Posted by: Prabhakar on: 5/8/2012 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Nuwan ,

if u want to select 5 or lot's of item in gridvew . . so u use Multiple Selection in Gridview with Check boxes .

Go with this link and Read it . .

http://www.codeproject.com/Articles/14437/Extending-GridView-by-allowing-Multiple-Selections

Best Regard's
Prabhakar

Nuwan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nuwan on: 5/8/2012 [Member] Starter | Points: 25

Up
0
Down
I want to if I selected 5 rows in gridview enable false.

Rathnayake

Nuwan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Edwin on: 5/9/2012 [Member] Starter | Points: 25

Up
0
Down
Please Get the Selected Row count and Check using if loop and display the message

Nuwan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Edwin on: 5/9/2012 [Member] Starter | Points: 25

Up
0
Down
if (datagrid.SelectedRows.Count > 5)
MessageBox.Show("U Not able to select More than 5 row");

Nuwan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response