Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 5250 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > I have problem in gridview selected Row ...
Nuwan

I have problem in gridview selected Row

Replies: 4 | Posted by: Nuwan on 5/8/2012 | Category: ASP.NET Forums | Views: 414 | Status: [Member] | Points: 10  


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


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Prabhakar
Prabhakar  
Posted on: 5/8/2012 4:41:30 AM
Level: Starter | Status: [Member] [MVP] | Points: 25

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. | Reply | Alert Moderator 

Nuwan
Nuwan  
Posted on: 5/8/2012 5:27:11 AM
Level: Starter | Status: [Member] | Points: 25

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

Rathnayake

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

Edwin
Edwin  
Posted on: 5/9/2012 8:44:14 AM
Level: Starter | Status: [Member] | Points: 25

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. | Reply | Alert Moderator 

Edwin
Edwin  
Posted on: 5/9/2012 8:52:30 AM
Level: Starter | Status: [Member] | Points: 25

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. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/20/2013 9:02:54 PM