This is a migrated thread and some comments may be shown as answers.

RadGrid Bind

1 Answer 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tamim
Top achievements
Rank 1
Tamim asked on 14 Jul 2014, 04:15 AM

Hi All,

 Here i have paste my coding.
 for Example ClaimNo value= 'PCL/15 and new project PREPARED on 15/07/2014 '

 I want Split and concatenate for claimno ('PCL/15 and new project EDITED on 15/07/2014')

 and one more question how to color change text in PREPARED / EDITED condition where a.status='ADD / MOD'

protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
  var Bind = (from a in db.MY_Alerts
   select new { ClaimNo = a.ClaimNo, a.ProjRefNo }).ToList();
  RadGrid17.DataSource = Bind;
}

Thanks
Ansari.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Jul 2014, 01:06 PM
Hi Tamim,

I guess you want to change a cell value based on a condition. Please try the following code snippet:

C#:
protected void rgrdSample_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridDataItem)
  {
    GridDataItem dataItem = (GridDataItem)e.Item;
    string checkcode = "PREPARED";
    string ClaimNo=dataItem["ClaimNo"].Text;
    if (ClaimNo.Contains(checkcode))
    {
     //set new text
     dataItem["ClaimNo"].Text = "PCL/15 and new project EDITED on 15/07/2014";
     //set color
     dataItem["ClaimNo"].ForeColor = Color.Blue;
    }
  }
}

Thanks,
Princy
Tags
Grid
Asked by
Tamim
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or