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
What is form design?
What are window based applications?
Explain how to get records from a database?
What is form based application?
Explain how to find the current record position in data control?
What is the use of play() playlooping() functions?
How insert record in the database?
Where is system windows forms dll?
Explain the need of z-order method?
What is dynamic linking?
Explain how save rerecord in the database?
Explain the difference between listbox and combo box?
How many navigational features are provided by visual studio.net ide?
Name the property which is used to specify the source from where the crystal reports would be accessed.
Name the event that enables the user to prevent shifting of focus from control until all the validation rules have been met.