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
We use the grids extensively in our application and only in a few cases do we need to do some manipulation that is a bit out of the norm when it comes to the data. We have a couple read only grids that we need to configure using a different style row line to separate some data segments. The Alert column is nicely configured using the conditional formatting, however, without the "diving" lines (see grid configuration summary.jpg) the data would be run together and a bit more difficult to read.
Our normal grids (see normal grid.jpg), for comparison, are fine because they just process the data which is sortable and all that so no issues there.
So the question is can we create a configuration where the data is seperated by the darker horizontal lines, that in the image create the 4 sections? Can conditional formatting be used to format an entire row to have a bottom border of a certain color? Thank you.
I think we have this figured out. It looks like we can use the row-based conditional formatting to add the border we need based on a hidden value.
The one thing, during testing, that I noticed is that using a target column to check equal to a string value doesn't seem to work. We wind up using the custom condition text to set up a formula, e.g.,
ISNet.WebUI.WebGrid.WebGridFormatCondition fmt = new ISNet.WebUI.WebGrid.WebGridFormatCondition(); fmt.Name = "RowConditional1"; fmt.TargetObject = ISNet.WebUI.WebGrid.TargetObjectType.Row; fmt.CustomConditionText = "testTargetColumn = 'String Value'"; fmt.Operator = ColumnFilterType.NotSet; fmt.FormatStyle.BorderSettings.Bottom.Color = System.Drawing.Color.Gray; fmt.FormatStyle.BorderSettings.Bottom.Style = BorderStyle.Solid; fmt.FormatStyle.BorderSettings.Bottom.Width = Unit.Pixel(1); fmt.Enabled = true; this.RootTable.FormatConditions.Add(fmt);
Why does the grid crash when we use the built-in operator and condition but works when we use the custom condition for Boolean and Int types?
If we set a custom condition of "underline=1" this works fine.
If we set the TargetColumnMember to "underline", set Operator to ColumnFiltertype.EqualTo and set ConditionText to "1" the grid crashes upon rendering which doesn't make any sense. The same thing happens if we use an Int where the value is other than 0 or 1. Any ideas? At least the workaround of using the custom condition text is working right now.
I tried to reproduce the problem in my local test by creating a simple sample of WebGrid. The grid is bind to “Products” table of Northwind.mdb database. In InitializeLayout server-side event WebGridFormatCondition with following configuration is added.
protected void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e) { //specific row WebGridFormatCondition a = new WebGridFormatCondition(); a.Name = "Format3"; a.ColumnMember = "UnitPrice"; a.ConditionText = "14"; a.Operator = ColumnFilterType.GreaterThan; a.FormatStyle.Font.Italic = true; a.FormatStyle.Font.Bold = true; a.TargetObject = TargetObjectType.Row; WebGrid1.RootTable.FormatConditions.Add(a); }
The format condition configuration uses a simple matching mode where the specified ColumnMember – UnitPrice –; Operator – GreaterThan –; and ConditionText – 14 – match.
When viewed in browser, rows which has “UnitPrice” greater than 14 are rendered with bold format and italic. The problematic behavior is not reproducible in the attached simple sample.
Please kindly let me know if you have different result.
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