User GridView Row databound event:
protected void GVSample_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataRowView drview = e.Row.DataItem as DataRowView;
if (e.Row.RowType == DataControlRowType.DataRow)
{
TextBox txtname = (TextBox)e.Row.FindControl("txtName");
String text = "ABC~12"
txtname.Text = text.Split('~')[0].ToString();
}
}