I am sending the code for color in a cell in gridview . write the code in
RowDataBound event of your gridview as shown below.

   /// <summary>
      /// RowDataBound event of NewLeads gridview
      /// </summary>
      /// <param name="sender">Instance of an object</param>
      /// <param name="e">Instance of GridViewPageEventArgs</param>
      protected void gvNewLeads_RowDataBound(object sender,
GridViewRowEventArgs e)
      {
         // Condition checking for row type
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
            long _expiresAfterTicks = Convert.ToInt64(e.Row.Cells[5].Text);
            TimeSpan _newResult = new TimeSpan(_expiresAfterTicks -
DateTime.Now.ToUniversalTime().Ticks);
            // Checking number of days, hours and minutes of newResult
timespan
            if (_newResult.Days < 0 || _newResult.Hours < 1 ||
_newResult.Minutes < 0)
            {
               e.Row.Cells[5].ForeColor = Color.Red;
            }
          }
      }
      #endregion [gvNewLeads_RowDataBound]

- Srihari


On Wed, Oct 8, 2008 at 6:07 PM, CK <[EMAIL PROTECTED]> wrote:

>
> sorry, i haven't got the time to write it all up.  if you search for
> sql rollup it should lead you to the function for adding a flag to
> show which is the rollup column, and the hadnling the row_databound is
> just setting a method for the event, you can set the flag to a hidden
> column then retrieve its data and change properties of the row as
> necessary.
>
> On 8 Oct, 04:22, "vanitha palanisamy" <[EMAIL PROTECTED]> wrote:
> > Hi
> > Can u say how to achive this in detail?
> >
> > On 10/7/08, CK <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > ther eis a function you can call to set a flag to show which is the
> > > rollup total column.
> >
> > > You can then handle the row_databound method to updat3e the row when
> > > it encounters that flag in the data.
> >
> > > On 7 Oct, 11:50, "vanitha palanisamy" <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> > > > Am Vanitha.
> >
> > > > Can anyone help me in the following scenario.
> >
> > > > I got result from select statement using Rollup Query.
> > > > Am binding these result set into gridview.
> > > > I need to change the particular row color that contains the sub-total
> > > coming
> > > > from the select statement.
> >
> > > > Thankz in advance.- Hide quoted text -
> >
> > - Show quoted text -
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/DotNetDevelopment

You may subscribe to group Feeds using a RSS Feed Reader to stay upto date 
using following url  

<a href="http://feeds.feedburner.com/DotNetDevelopment";> 
http://feeds.feedburner.com/DotNetDevelopment</a>
-~----------~----~----~----~------~----~------~--~---

Reply via email to