How do you customize the column content inside the datagrid?
Answer Posted / ashutosh rai
We will add a function signature of OnItemDataBind in
DataGrid or by creating an event handler in code file for
DataGrid Binding. Now in the definition of function we will
check that is DataGrid Item type is of ListItemType or
AlternatingItemType then we will costomize the column by
setting the property of particular column in code window.
for eg.
event handler of funcion:
this.DataGrid.ItemDataBound += new
system.Web.UI.WebControls.DataGridItemEventHandler(this.DataGrid_ItemDataBound);
definition of function:
private void DataGrid_ItemDataBound(object sender,
DataGridItemEventArgs e)
{
if (e.Item.ItemType ==
ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
e.Item.Cells[1].Font.Bold;
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Name the property which of menu cannot be set at run time?
How can you pause a timer control?
How to use the FindControl() function to preselect an item in my dropdownlist?
What is an example of form?
What are windows applications?
What are the three states set in a checkstate property?
What is the difference between a document and a form?
How insert record in the database?
What is the difference between desktop application and windows application?
How save rerecord in the database?
Are windows forms still used?
Explain how barcode create in the report?
What is form and its uses?
how see report periviwe
Explain how save rerecord in the database?