iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
good day. A questions how change the backgroundColor of the webgrid in clientside
i do function in javascript
function webfgrid_onafteradd()
{
var wgDetalle = ISGetObject("wgDetalle");
wgDetalle.GetElement.style.backgroundColor = "RED";
wgDetalle.GetActiveEditCell().element.style.fontWeight = "BOLD";
}
in serverside use this code
Protected Sub wgDetalle_AddRow(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.RowEventArgs) Handles wgDetalle.AddRow
wgDetalle.ClientAction.RefreshAll
but not result
Hello,
To change background color via Server-side, you can use OnInitializeRow Server-side event such as following:
protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) { e.Row.Style.BackColor = System.Drawing.Color.Red; }
To change background color via Client-side, you might want to refer to javascript code given by Frank Bruce. The code has been successfully tested and it will change the text color in your WebGrid.
Thank you.
Do you want this ?:Js Code: <script type="text/javascript"> function setForColor() {
var grid = ISGetObject("WebGrid1");
for (var i = 0; i < grid.TotalRows; i++) {
var row = grid.RootTable.GetRow(i); var rowElement = row.GetElement(); rowElement.style.color = "red"; } } </script>
C# code:
//Set webgrid BackColor protected void Button1_Click(object sender, EventArgs e) { WebGrid1.LayoutSettings.AlternatingColors = false; WebGrid1.RootTable.RowStyle.BackColor = Color.Red; }
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname