DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 01 Aug 2007 04:43:51 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Dinu
          2    Mark Rae [MVP]
          3    Dinu
                 4    Mark Rae [MVP]
                        5    Mark Rae [MVP]
          6    Dinu


how to select a row in gridview in asp.net   
hi

how can we select a row in a gridview with out select column and get
events fired

thanks
Date:Wed, 01 Aug 2007 04:43:51 -0700   Author:  

Re: how to select a row in gridview in asp.net   
"Dinu"  wrote in message 
news:1185968631.540663.113560@e16g2000pri.googlegroups.com...


> how can we select a row in a gridview with out select column and get
> events fired


<asp:GridView ID="MyGridView" runat="server" 
OnRowDataBound="MyGridView_RowDataBound" 
OnSelectedIndexChanged="MyGridView_SelectedIndexChanged">
....
....
....
</asp:GridView>

protected void MyGridView_RowDataBound(object sender, GridViewRowEventArgs 
e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        e.Row.Attributes.Add("onclick", 
ClientScript.GetPostBackEventReference(MyGridView, "Select$" + 
e.Row.RowIndex.ToString()));
        e.Row.Style.Add("cursor", "pointer");
    }
}

protected void MyGridView_SelectedIndexChanged(object sender, EventArgs e)
{
    string strSelectedID = MyGridView.SelectedValue.ToString();
}


-- 
Mark Rae
ASP.NET MVP
http://www.markrae.net
Date:Wed, 1 Aug 2007 13:20:11 +0100   Author:  

Re: how to select a row in gridview in asp.net   
On Aug 1, 5:20 pm, "Mark Rae [MVP]"  wrote:

> "Dinu"  wrote in message
>
> news:1185968631.540663.113560@e16g2000pri.googlegroups.com...
>
> > how can we select a row in a gridview with out select column and get
> > events fired
>
> <asp:GridView ID="MyGridView" runat="server"
> OnRowDataBound="MyGridView_RowDataBound"
> OnSelectedIndexChanged="MyGridView_SelectedIndexChanged">
> ...
> ...
> ...
> </asp:GridView>
>
> protected void MyGridView_RowDataBound(object sender, GridViewRowEventArgs
> e)
> {
>     if (e.Row.RowType == DataControlRowType.DataRow)
>     {
>         e.Row.Attributes.Add("onclick",
> ClientScript.GetPostBackEventReference(MyGridView, "Select$" +
> e.Row.RowIndex.ToString()));
>         e.Row.Style.Add("cursor", "pointer");
>     }
>
> }
>
> protected void MyGridView_SelectedIndexChanged(object sender, EventArgs e)
> {
>     string strSelectedID = MyGridView.SelectedValue.ToString();
>
> }
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net


It is not working, the page got hanged (i am using vb.net as code-
behind)

Protected Sub gvwServices_RowDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
gvwServices.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            e.Row.Attributes.Add("onclick",
ClientScript.GetPostBackEventReference(gvwServices, "Select$" +
e.Row.RowIndex.ToString()))
            e.Row.Style.Add("cursor", "pointer")
End If
End Sub
Date:Wed, 01 Aug 2007 08:12:57 -0700   Author:  

Re: how to select a row in gridview in asp.net   
"Dinu"  wrote in message 
news:1185981177.175373.100140@e16g2000pri.googlegroups.com...


> It is not working, the page got hanged


On which line does the code hang...?


> (i am using vb.net as code-behind)


That certainly shouldn't make any difference...


-- 
Mark Rae
ASP.NET MVP
http://www.markrae.net
Date:Wed, 1 Aug 2007 16:20:53 +0100   Author:  

Re: how to select a row in gridview in asp.net   
On Aug 1, 8:20 pm, "Mark Rae [MVP]"  wrote:

> "Dinu"  wrote in message
>
> news:1185981177.175373.100140@e16g2000pri.googlegroups.com...
>
> > It is not working, the page got hanged
>
> On which line does the code hang...?
>
> > (i am using vb.net as code-behind)
>
> That certainly shouldn't make any difference...
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net


hi

my page has huge amount of data nearly(12500 records to be fetched
from database) and so it is hanged........if i use paging its working.

Thanks
Date:Wed, 01 Aug 2007 23:21:57 -0700   Author:  

Re: how to select a row in gridview in asp.net   
"Dinu"  wrote in message 
news:1186035717.035118.288120@e9g2000prf.googlegroups.com...


> my page has huge amount of data nearly(12500 records to be fetched
> from database) and so it is hanged........if i use paging its working.


Sorted then... :-)


-- 
Mark Rae
ASP.NET MVP
http://www.markrae.net
Date:Thu, 2 Aug 2007 07:31:47 +0100   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us