|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How can I select a row by clicking on ANY columnI am using the following to highlight a row when mousing over a GridView:
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='Silver'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='White'"); Now, what I would like to do would seem simple, but apparently is not. I would like to be able to select the row by clicking on any column within it. Does anyone know the best way to do this? Unfortuneately the gridview component doesn't come with a fullrowselect
property that would be too easy :) To get the behaviour you require you need to do a bit of work, see http://msdn.microsoft.com/msdnmag/issues/01/05/cutting/ if you search for "full row select" it should take you too the relevant section. HTH Darren Sim Show quoteHide quote "John Wilmot" <nfr@nospam.com> wrote in message news:uRPdryGUHHA.4076@TK2MSFTNGP05.phx.gbl... >I am using the following to highlight a row when mousing over a GridView: > > e.Row.Attributes.Add("onmouseover", > "this.style.backgroundColor='Silver'"); > e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='White'"); > > Now, what I would like to do would seem simple, but apparently is not. I > would like to be able to select the row by clicking on any column within > it. Does anyone know the best way to do this? > Thanks, this is helpful.
Strange that MS would neglect such an obvious need. I wonder what the reason is? Show quoteHide quote "Darren Sim" <darr***@sirius.co.uk> wrote in message news:%23d9zhdRUHHA.1200@TK2MSFTNGP04.phx.gbl... > Unfortuneately the gridview component doesn't come with a fullrowselect > property that would be too easy :) > > To get the behaviour you require you need to do a bit of work, see > http://msdn.microsoft.com/msdnmag/issues/01/05/cutting/ > if you search for "full row select" it should take you too the relevant > section. > > HTH > Darren Sim > > > > "John Wilmot" <nfr@nospam.com> wrote in message > news:uRPdryGUHHA.4076@TK2MSFTNGP05.phx.gbl... >>I am using the following to highlight a row when mousing over a GridView: >> >> e.Row.Attributes.Add("onmouseover", >> "this.style.backgroundColor='Silver'"); >> e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='White'"); >> >> Now, what I would like to do would seem simple, but apparently is not. I >> would like to be able to select the row by clicking on any column within >> it. Does anyone know the best way to do this? >> > >
AJAX and embeded controls
menu navigation control and CSS interference how to change email defined when creating account? GridView Header Height ControlToValidate Script manager equivalent... How can I do? why is this html table still visible? Put the date of today in a text control Datagrid HeaderStyle.CssClass applied to <tr> page is postback while using validation |
|||||||||||||||||||||||