Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
19693
Styling rows depending on the contained data
posted
In WebDataGrid ,

programatically rows should be colored in different "Group" color depending on contained data.

For example if the Cell in "Status" column contain Approved, the row backgrouned should be green, otherwise - red

Parents
  • 19693
    posted


    The following article regarding styling WebDataGrid is recommended:


     


    http://community.infragistics.com/blogs/engineering/archive/2010/08/25/webdatagrid-css-styling-guide.aspx


     


    In this InitializeRow event should be used for the purpose.

     


    protected void WebDataGrid1_InitializeRow(object sender, RowEventArgs e)


            {


                GridRecord row = e.Row;


                if (row.Items[WebDataGrid1.Columns.FromKey("Status").Index].Text == "Approved")


                {


                    row.Items[WebDataGrid1.Columns.FromKey("ClientName").Index].Text = "*" + row.Items[WebDataGrid1.Columns.FromKey("ClientName").Index].Text;


                    row.CssClass = altItemCssClass;


                } else


                {


                    row.CssClass = itemCssClass;


                }


            }

Reply Children
No Data