GridView in C#. Only alternate colum gets binded in DataControlRowState
-
In RowDataBound event of GridView the DataControlRowState.Edit will trigger only alternatively. If we are binding the column with a RadioButtonList,only alternate columns will only get binded.Is there any solution for this.
Regards Bino http://www.technix.co.nr
-
In RowDataBound event of GridView the DataControlRowState.Edit will trigger only alternatively. If we are binding the column with a RadioButtonList,only alternate columns will only get binded.Is there any solution for this.
Regards Bino http://www.technix.co.nr
private void dgContacts_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { DataGridItem item = e.Item; if (item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.Item) { if ((e.Item.ItemIndex % 2) != 0) { LinkButton editButton = item.Cells[0].Controls[0] as LinkButton; if (editButton != null && editButton.CommandName == "Edit") { editButton.Visible = false; } } } }
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
-
private void dgContacts_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { DataGridItem item = e.Item; if (item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.Item) { if ((e.Item.ItemIndex % 2) != 0) { LinkButton editButton = item.Cells[0].Controls[0] as LinkButton; if (editButton != null && editButton.CommandName == "Edit") { editButton.Visible = false; } } } }
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
we need to check both conditions (e.Row.Rowstate & DataControlRowSatate)>0 now it will work fine www.codepal.co.nr
Regards Bino http://www.codepal.co.nr