C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Problem in GridView


Posted Date: 21 Nov 2008      Posted By: savithri      Member Level: Silver     Points: 1   Responses: 4



Hi to all,

Am using GridView in my application, In that i used to select a particular row. In that i write the code behind under GridView_SelectedIndexChange event...

While am running my application. Whenever i select the row. This event occurs two times..

Whats wrong in me? what can i do? Tell me the way. Please.. Am so much Confused in this...





Responses

Author: Deepika Haridas    21 Nov 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 5

protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';";
e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";

e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.GridView, "Select$" + e.Row.RowIndex);
}



Thanks & Regards,
Deepika
Editor

If U want to shine like a SUN..First U have to burn like the SUN!!
Need a Guide? Join my mentor program..



Author: sankar    21 Nov 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

within selectedindexchanged event
Bind Once again
gv.datasource=dt.defalutview();
gv.dataBind()



Author: Arjunvino    21 Nov 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 0

hey u can try for GridView_focusedRowChanged


Author: savithri    22 Nov 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 1

I tried all these but still it going for second time only on execution..


Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Make MS word as Read Only
Previous : Updating the cell data type in excel sheet
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use