CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Highlight selected row in grid

Print topic Send  topic

Author Message
klipkop

Posts: 16
Posted: 11/18/2008, 2:18 AM

There is a lot of examples on how to highlight the selected row in a grid, but they are all in PHP. Can someone please explain it for ASP.NET. The best entry describing it is:

http://forums.yessoftware.com/posts.php?post_id=90764

______________________________________________________________________

Okay, if you're familiar with setting template variables, set one for
the row style. In your HTML:

<tr style="{rowStyle}">

In your BeforeShowRow event:

global $Tpl;
if ($Container->ds->f("id") == CCGetParam("id", "")) {
I dont''understand this $container and the .NET (VB) equivalent
$Tpl->SetVar("rowStyle", "bgcolor='RED'");
}
else {
$Tpl->SetVar("rowStyle", "bgcolor='WHITE'");

}

Where "id" is your link parameter to show the record detail. Note that
if you have any other inline styles in your <TD>'s, those will override
what's in your <TR>. You could just set your <TD> style also as such:

<td style="{dataStyle}">
-------------------------------------------------------------------------------------------------------------

I can't get it to work in .NET. The sample in CCS4 only describe changing celcolour for alternative rows. My partially completed code is as follows:
  
HTML:  
<tr id="task_row" runat="server">  
  
BEFORE SHOW ROW event  
  
Dim ID As Integer ' The ID of the selected row  
  
  If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then  
    Dim task_row As System.Web.UI.HtmlControls.HtmlTableCell = DirectCast(e.Item.FindControl("task_row"),System.Web.UI.HtmlControls.HtmlTableCell)  
     
    If CONTAINER = ID Then ' Need the pointer to the selected row  
      task_row.Attributes("bgcolor") = "RED" ' will bgcolour work here?  
	  task_row.Attributes  
    Else   
      task_row.Attributes("Class") = "AltRow"  
      Counter = 0  
	End IF   
  End If   
  
View profile  Send private message
Oper


Posts: 1195
Posted: 11/25/2008, 10:10 PM

bgcolor wont work if ther is a class defined use style="......." instead
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.